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
mavlink module

Basic MAVLink implementation

No detailed description...

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="mavlink">
2  <configure name="MAVLINK_PORT" value="UARTx|UDPx|UsbS" />
3  <configure name="MAVLINK_BAUD" value="B57600" />
4 </module>

Module configuration options

Configure Options

  • name: MAVLINK_PORT value: UARTx|UDPx|UsbS
    Description: The port device to use for mavlink (default: UART1)
  • name: MAVLINK_BAUD value: B57600
    Description: Baud rate if MAVLINK_PORT is a UART

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.

  • mavlink_periodic()
    • Frequency in Hz: 10
    • Autorun: TRUE
      Periodic function automatically starts after init.
  • mavlink_periodic_telemetry()
    • Frequency in Hz: $TELEMETRY_FREQUENCY
    • Autorun: TRUE
      Periodic function automatically starts after init.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw mavlink.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="datalink">
<doc>
<description>Basic MAVLink implementation</description>
<configure name="MAVLINK_PORT" value="UARTx|UDPx|UsbS" description="The port device to use for mavlink (default: UART1)"/>
<configure name="MAVLINK_BAUD" value="B57600" description="Baud rate if MAVLINK_PORT is a UART"/>
</doc>
<header>
<file name="mavlink.h"/>
</header>
<init fun="mavlink_init()"/>
<periodic fun="mavlink_periodic()" freq="10" autorun="TRUE"/>
<periodic fun="mavlink_periodic_telemetry()" freq="$TELEMETRY_FREQUENCY" autorun="TRUE"/>
<event fun="mavlink_event()"/>
<makefile>
<file name="mavlink.c"/>
<file name="mission_manager.c" dir="modules/datalink/missionlib"/>
<file name="waypoints.c" dir="modules/datalink/missionlib"/>
<file name="blocks.c" dir="modules/datalink/missionlib"/>
<configure name="MAVLINK_PORT" default="uart1" case="upper|lower"/>
<raw>
ifneq (,$(findstring usb,$(MAVLINK_PORT_LOWER)))
ap.CFLAGS += -DUSE_USB_SERIAL
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c
ap.CFLAGS += -DMAVLINK_DEV=usb_serial
else
ifneq (,$(findstring udp,$(MAVLINK_PORT_LOWER)))
include $(CFG_SHARED)/udp.makefile
$(TARGET).CFLAGS += -DMAVLINK_DEV=$(MAVLINK_PORT_LOWER)
$(TARGET).CFLAGS += -DUSE_$(MAVLINK_PORT_UPPER)
else
MAVLINK_BAUD ?= B57600
ap.CFLAGS += -DMAVLINK_DEV=$(MAVLINK_PORT_LOWER)
ap.CFLAGS += -DUSE_$(MAVLINK_PORT_UPPER)
ap.CFLAGS += -D$(MAVLINK_PORT_UPPER)_BAUD=$(MAVLINK_BAUD)
endif
endif
</raw>
</makefile>
</module>