Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_piksi module

Swift-Nav Piksi RTK GPS.

Driver for Swift-Nav Piksi RTK GPS connected via UART.

Example for airframe file

Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!

1 <module name="gps_piksi">
2  <configure name="PIKSI_GPS_PORT" value="UARTx" />
3  <configure name="PIKSI_GPS_BAUD" value="B115200" />
4 </module>

Module configuration options

Configure Options

  • name: PIKSI_GPS_PORT value: UARTx
    Description: UART where the GPS is connected to (UART1, UART2, etc
  • name: PIKSI_GPS_BAUD value: B115200
    Description: UART baud rate

Auto-loaded modules

The following modules are automatically loaded (just as if you had added them in the airframe file)

Module functions

Init Functions

These initialization functions are called once on startup.

Event Functions

These event functions are called in each cycle of the module event loop.

Periodic Functions

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

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw gps_piksi.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="gps_piksi" dir="gps">
<doc>
<description>
Swift-Nav Piksi RTK GPS.
Driver for Swift-Nav Piksi RTK GPS connected via UART.
</description>
<configure name="PIKSI_GPS_PORT" value="UARTx" description="UART where the GPS is connected to (UART1, UART2, etc"/>
<configure name="PIKSI_GPS_BAUD" value="B115200" description="UART baud rate"/>
</doc>
<autoload name="gps"/>
<autoload name="gps_nps"/>
<autoload name="gps_sim"/>
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_piksi_init()"/>
<periodic fun="gps_piksi_periodic_check()" freq="1." autorun="TRUE"/>
<event fun="gps_piksi_event()"/>
<makefile target="ap|fbw">
<configure name="PIKSI_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
<configure name="PIKSI_GPS_BAUD" default="B115200"/>
<file name="gps_piksi.c" dir="subsystems/gps"/>
<include name="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/include"/>
<file name="sbp.c" dir="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/src"/>
<file name="edc.c" dir="$(PAPARAZZI_SRC)/sw/ext/libsbp/c/src"/>
<define name="USE_$(PIKSI_GPS_PORT_UPPER)"/>
<define name="PIKSI_GPS_LINK" value="$(PIKSI_GPS_PORT_LOWER)"/>
<define name="$(PIKSI_GPS_PORT_UPPER)_BAUD" value="$(PIKSI_GPS_BAUD)"/>
<raw>
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), piksi))
# this is the secondary GPS
$(TARGET).CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_piksi.h\"
$(TARGET).CFLAGS += -DSECONDARY_GPS=GPS_PIKSI
else
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
$(TARGET).CFLAGS += -DPRIMARY_GPS=GPS_PIKSI
endif
else
# plain old single GPS usage
$(TARGET).CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
endif
</raw>
</makefile>
<makefile target="fbw">
<define name="USE_GPS"/>
</makefile>
</module>