Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gps_datalink module

Remote GPS via datalink.

Parses the EXTERNAL_POSE, EXTERNAL_POSE_SMALL and REMOTE_GPS_LOCAL datalink messages and publishes it as GPS onboard via ABI.

Example for airframe file

Add to your firmware section:

<module name="gps_datalink"/>

Module functions

Init Functions

These initialization functions are called once on startup.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

Datalink Functions

Whenever the specified datalink message is received, the corresponing handler function is called.

  • on message EXTERNAL_POSE call gps_datalink_parse_EXTERNAL_POSE(buf)
  • on message EXTERNAL_POSE_SMALL call gps_datalink_parse_EXTERNAL_POSE_SMALL(buf)
  • on message REMOTE_GPS_LOCAL call gps_datalink_parse_REMOTE_GPS_LOCAL(buf)

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw gps_datalink.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_datalink" dir="gps" task="sensors">
<doc>
<description>
Remote GPS via datalink.
Parses the EXTERNAL_POSE, EXTERNAL_POSE_SMALL and REMOTE_GPS_LOCAL datalink messages and publishes it as GPS onboard via ABI.
</description>
</doc>
<dep>
<depends>gps,@datalink</depends>
<provides>gps</provides>
</dep>
<header>
<file name="gps.h"/>
</header>
<init fun="gps_datalink_init()"/>
<periodic fun="gps_datalink_periodic_check()" freq="1." autorun="TRUE"/>
<datalink message="EXTERNAL_POSE" fun="gps_datalink_parse_EXTERNAL_POSE(buf)"/>
<datalink message="EXTERNAL_POSE_SMALL" fun="gps_datalink_parse_EXTERNAL_POSE_SMALL(buf)"/>
<datalink message="REMOTE_GPS_LOCAL" fun="gps_datalink_parse_REMOTE_GPS_LOCAL(buf)"/>
<makefile target="ap|fbw">
<file name="gps_datalink.c"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), datalink))
# this is the secondary GPS
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"modules/gps/gps_datalink.h\"
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_DATALINK
else
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_datalink.h\"
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_DATALINK
endif
else
# plain old single GPS usage
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"modules/gps/gps_datalink.h\"
endif
</raw>
<test firmware="rotorcraft">
<define name="PRIMARY_GPS" value="GPS_DATALINK"/>
</test>
</makefile>
<makefile target="fbw">
<define name="USE_GPS"/>
</makefile>
</module>