Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Air Data interface. More...
#include "std.h"
Go to the source code of this file.
Data Structures | |
struct | AirData |
Air Data strucute. More... | |
Functions | |
void | air_data_init (void) |
AirData initialization. More... | |
void | air_data_periodic (void) |
Check health. More... | |
float | air_data_get_amsl (void) |
Return AMSL (altitude AboveSeaLevel). More... | |
float | eas_from_dynamic_pressure (float q) |
Calculate equivalent airspeed from dynamic pressure. More... | |
float | get_tas_factor (float p, float t) |
Calculate true airspeed (TAS) factor. More... | |
float | tas_from_eas (float eas) |
Calculate true airspeed from equivalent airspeed. More... | |
float | tas_from_dynamic_pressure (float q) |
Calculate true airspeed from dynamic pressure. More... | |
Variables | |
struct AirData | air_data |
global AirData state More... | |
Air Data interface.
Definition in file air_data.h.
struct AirData |
Air Data strucute.
Definition at line 37 of file air_data.h.
Data Fields | ||
---|---|---|
float | airspeed | Equivalent Air Speed (equals to Calibrated Air Speed at low speed/altitude) (in m/s, -1 if unknown. |
float | amsl_baro | altitude above sea level in m from pressure and QNH |
bool_t | amsl_baro_valid | TRUE if amsl_baro is currently valid. |
float | aoa | angle of attack (rad) |
bool_t | calc_airspeed | if TRUE, calculate airspeed from differential pressure |
bool_t | calc_amsl_baro | if TRUE, calculate amsl_baro |
bool_t | calc_qnh_once | flag to calculate QNH with next pressure measurement |
bool_t | calc_tas_factor | if TRUE, calculate tas_factor when getting a temp measurement |
float | differential | Differential pressure (total - static pressure) (Pa) |
float | pressure | Static atmospheric pressure (Pa), -1 if unknown. |
float | qnh | Barometric pressure adjusted to sea level in hPa, -1 if unknown. |
float | sideslip | sideslip angle (rad) |
float | tas | True Air Speed (TAS) in m/s, -1 if unknown. |
float | tas_factor | factor to convert equivalent airspeed (EAS) to true airspeed (TAS) |
float | temperature | temperature in degrees Celcius, -1000 if unknown |
float | wind_dir | wind direction (rad, 0 north, >0 clockwise) |
float | wind_speed | wind speed (m/s) |
float air_data_get_amsl | ( | void | ) |
Return AMSL (altitude AboveSeaLevel).
If AMSL from baro is valid, return that, otherwise from gps.
Definition at line 216 of file air_data.c.
References air_data, LlaCoor_f::alt, AirData::amsl_baro, AirData::amsl_baro_valid, and stateGetPositionLla_f().
void air_data_init | ( | void | ) |
AirData initialization.
Called at startup.
Called at startup. Bind ABI messages
Definition at line 177 of file air_data.c.
References air_data, AIR_DATA_BARO_ABS_ID, AIR_DATA_BARO_DIFF_ID, AIR_DATA_CALC_AIRSPEED, AIR_DATA_CALC_AMSL_BARO, AIR_DATA_CALC_TAS_FACTOR, AIR_DATA_TAS_FACTOR, AIR_DATA_TEMPERATURE_ID, AirData::airspeed, AirData::amsl_baro, AirData::amsl_baro_valid, AirData::aoa, AirData::calc_airspeed, AirData::calc_amsl_baro, AirData::calc_qnh_once, AirData::calc_tas_factor, DefaultPeriodic, AirData::differential, FALSE, AirData::pressure, pressure_abs_cb(), pressure_diff_cb(), AirData::qnh, register_periodic_telemetry(), AirData::sideslip, AirData::tas, AirData::tas_factor, AirData::temperature, temperature_cb(), TRUE, AirData::wind_dir, and AirData::wind_speed.
void air_data_periodic | ( | void | ) |
Check health.
Needs to be called periodically.
Definition at line 226 of file air_data.c.
References air_data, AirData::amsl_baro_valid, and FALSE.
float eas_from_dynamic_pressure | ( | float | q | ) |
Calculate equivalent airspeed from dynamic pressure.
Dynamic pressure (also called impact pressure) is the difference between total(pitot) and static pressure.
q | dynamic pressure in Pa |
Dynamic pressure (also called impact pressure) is the difference between total(pitot) and static pressure.
Airspeed from dynamic pressure:
with as air density. Using standard sea level air density gives you equivalent airspeed (EAS).
q | dynamic pressure in Pa |
Definition at line 250 of file air_data.c.
References Max, and PPRZ_ISA_AIR_DENSITY.
Referenced by pressure_diff_cb(), and tas_from_dynamic_pressure().
float get_tas_factor | ( | float | p, |
float | t | ||
) |
Calculate true airspeed (TAS) factor.
TAS = tas_factor * EAS
p | current air pressure in Pa |
t | current air temperature in degrees Celcius |
TAS = tas_factor * EAS
True airspeed (TAS) from equivalent airspeed (EAS):
and where
p | current air pressure in Pa |
t | current air temperature in degrees Celcius |
Definition at line 278 of file air_data.c.
References PPRZ_ISA_SEA_LEVEL_PRESSURE, and PPRZ_ISA_SEA_LEVEL_TEMP.
Referenced by temperature_cb().
float tas_from_dynamic_pressure | ( | float | q | ) |
Calculate true airspeed from dynamic pressure.
Dynamic pressure (also called impact pressure) is the difference between total(pitot) and static pressure.
q | dynamic pressure in Pa |
Definition at line 310 of file air_data.c.
References eas_from_dynamic_pressure(), and tas_from_eas().
float tas_from_eas | ( | float | eas | ) |
Calculate true airspeed from equivalent airspeed.
eas | equivalent airspeed (EAS) in m/s |
True airspeed (TAS) from EAS: TAS = air_data.tas_factor * EAS
eas | equivalent airspeed (EAS) in m/s |
Definition at line 297 of file air_data.c.
References air_data, and AirData::tas_factor.
Referenced by pressure_diff_cb(), and tas_from_dynamic_pressure().
struct AirData air_data |
global AirData state
Definition at line 39 of file air_data.c.
Referenced by air_data_get_amsl(), air_data_init(), air_data_periodic(), pressure_abs_cb(), pressure_diff_cb(), tas_from_eas(), and temperature_cb().