Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
AirData interface

Module XML file: air_data.xml

Provides an interface for baro absolute and differential pressure as well as airspeed. Subscribes to BARO_ABS, BARO_DIFF and TEMPERATURE ABI messages and calculates QNH and true airspeed from it. Also enables you to fly on "flight levels" using AMSL (AltitudeAboveSeaLevel) calculated from current pressure and QNH.

When using this module to provide airspeed you need a differential pressure sensor module publishing the BARO_DIFF ABI message. Make sure to disable other modules which otherwise directly set the airspeed in the state interface. E.g. when using the airspeed_ms45xx.xml module, define USE_AIRSPEED_MS45XX to FALSE.

Example for airframe file

This example contains all possible configuration options, not all of them are mandatory!

1 <modules>
2  <load name="air_data.xml">
3  <define name="AIR_DATA_BARO_ABS_ID" value="ABI_SENDER_ID" />
4  <define name="AIR_DATA_BARO_DIFF_ID" value="ABI_SENDER_ID" />
5  <define name="AIR_DATA_TEMPERATURE_ID" value="ABI_SENDER_ID" />
6  <define name="AIR_DATA_CALC_AIRSPEED" value="FALSE|TRUE" />
7  <define name="AIR_DATA_CALC_TAS_FACTOR" value="FALSE|TRUE" />
8  <define name="AIR_DATA_CALC_AMSL_BARO" value="FALSE|TRUE" />
9  <define name="USE_AIRSPEED_AIR_DATA" value="TRUE|FALSE" />
10  </load>
11 </modules>

Module configuration options

Define Options

  • name: AIR_DATA_BARO_ABS_ID value: ABI_SENDER_ID
    Description: ABI sender id for absolute baro measurement (default: ABI_BROADCAST)
  • name: AIR_DATA_BARO_DIFF_ID value: ABI_SENDER_ID
    Description: ABI sender id for differential baro measurement (default: ABI_BROADCAST)
  • name: AIR_DATA_TEMPERATURE_ID value: ABI_SENDER_ID
    Description: ABI sender id for temperature measurement (default: ABI_BROADCAST)
  • name: AIR_DATA_CALC_AIRSPEED value: FALSE|TRUE
    Description: Calculate Airspeed from differential pressure (default: TRUE)
  • name: AIR_DATA_CALC_TAS_FACTOR value: FALSE|TRUE
    Description: Calculate TAS factor from temp and pressure (default: TRUE)
  • name: AIR_DATA_CALC_AMSL_BARO value: FALSE|TRUE
    Description: Calculate AMS from baro and QNH (default: FALSE)
  • name: USE_AIRSPEED_AIR_DATA value: TRUE|FALSE
    Description: set airspeed in state interface (defaults to TRUE if USE_AIRSPEED)

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.

  • air_data_periodic()
    • Frequency in Hz: 10
    • Autorun: LOCK
      Periodic function automatically starts after init and can't be stopped.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw air_data.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="air_data">
<doc>
<description>
AirData interface.
Provides an interface for baro absolute and differential pressure as well as airspeed.
Subscribes to BARO_ABS, BARO_DIFF and TEMPERATURE ABI messages and calculates QNH and true airspeed from it.
Also enables you to fly on "flight levels" using AMSL (AltitudeAboveSeaLevel) calculated from current pressure and QNH.
When using this module to provide airspeed you need a differential pressure sensor module publishing the BARO_DIFF ABI message. Make sure to disable other modules which otherwise directly set the airspeed in the state interface. E.g. when using the airspeed_ms45xx.xml module, define USE_AIRSPEED_MS45XX to FALSE.
</description>
<define name="AIR_DATA_BARO_ABS_ID" value="ABI_SENDER_ID" description="ABI sender id for absolute baro measurement (default: ABI_BROADCAST)"/>
<define name="AIR_DATA_BARO_DIFF_ID" value="ABI_SENDER_ID" description="ABI sender id for differential baro measurement (default: ABI_BROADCAST)"/>
<define name="AIR_DATA_TEMPERATURE_ID" value="ABI_SENDER_ID" description="ABI sender id for temperature measurement (default: ABI_BROADCAST)"/>
<define name="AIR_DATA_CALC_AIRSPEED" value="FALSE|TRUE" description="Calculate Airspeed from differential pressure (default: TRUE)"/>
<define name="AIR_DATA_CALC_TAS_FACTOR" value="FALSE|TRUE" description="Calculate TAS factor from temp and pressure (default: TRUE)"/>
<define name="AIR_DATA_CALC_AMSL_BARO" value="FALSE|TRUE" description="Calculate AMS from baro and QNH (default: FALSE)"/>
<define name="USE_AIRSPEED_AIR_DATA" value="TRUE|FALSE" description="set airspeed in state interface (defaults to TRUE if USE_AIRSPEED)"/>
</doc>
<settings>
<dl_settings>
<dl_settings name="air_data">
<dl_setting min="800" max="1200" step="1" module="air_data/air_data" var="air_data.qnh" shortname="QNH"/>
<dl_setting min="0.8" max="1.3" step="0.01" module="air_data/air_data" var="air_data.tas_factor" shortname="TASfactor" param="AIR_DATA_TAS_FACTOR" type="float" persistent="true"/>
<dl_setting min="0" max="1" step="1" var="air_data.calc_qnh_once" module="air_data/air_data" shortname="calcQNH"/>
<dl_setting min="0" max="1" step="1" var="air_data.calc_airspeed" module="air_data/air_data" shortname="calcAirspeed" param="AIR_DATA_CALC_AIRSPEED" type="uint8" persistent="true"/>
<dl_setting min="0" max="1" step="1" var="air_data.calc_tas_factor" module="air_data/air_data" shortname="calcTASfactor" param="AIR_DATA_CALC_TAS_FACTOR" type="uint8" persistent="true"/>
<dl_setting min="0" max="1" step="1" var="air_data.calc_amsl_baro" module="air_data/air_data" shortname="calcAMSL" param="AIR_DATA_CALC_AMSL_BARO" type="uint8" persistent="true"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="air_data.h"/>
</header>
<init fun="air_data_init()"/>
<periodic fun="air_data_periodic()" freq="10"/>
<makefile>
<file name="air_data.c"/>
</makefile>
</module>