|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Air Data interface. More...
#include "modules/air_data/air_data.h"#include "modules/core/abi.h"#include "math/pprz_isa.h"#include "state.h"#include "generated/airframe.h"#include "generated/modules.h"#include "pprzlink/dl_protocol.h"#include "modules/datalink/telemetry.h"
Include dependency graph for air_data.c:Go to the source code of this file.
Macros | |
| #define | AIR_DATA_BARO_ABS_ID ABI_BROADCAST |
| ABI binding for absolute pressure. | |
| #define | AIR_DATA_BARO_DIFF_ID ABI_BROADCAST |
| ABI binding for differential pressure. | |
| #define | AIR_DATA_TEMPERATURE_ID ABI_BROADCAST |
| ABI binding for temperature. | |
| #define | AIR_DATA_AIRSPEED_ID ABI_BROADCAST |
| ABI binding for airspeed. | |
| #define | AIR_DATA_INCIDENCE_ID ABI_BROADCAST |
| ABI binding for incidence angles. | |
| #define | AIR_DATA_TAS_FACTOR 1.0 |
| Default factor to convert estimated airspeed (EAS) to true airspeed (TAS) | |
| #define | AIR_DATA_CALC_AIRSPEED TRUE |
| Calculate Airspeed from differential pressure by default. | |
| #define | AIR_DATA_CALC_TAS_FACTOR TRUE |
| Calculate tas_factor from temp and pressure by default. | |
| #define | AIR_DATA_CALC_AMSL_BARO FALSE |
| Don't calculate AMSL from baro and QNH by default. | |
Variables | |
| struct AirData | air_data |
| global AirData state | |
| static abi_event | pressure_abs_ev |
| static abi_event | pressure_diff_ev |
| static abi_event | temperature_ev |
| static abi_event | airspeed_ev |
| static abi_event | incidence_ev |
| static uint8_t | baro_health_counter |
| counter to check baro health | |
Air Data interface.
Definition in file air_data.c.
| #define AIR_DATA_AIRSPEED_ID ABI_BROADCAST |
ABI binding for airspeed.
Definition at line 67 of file air_data.c.
| #define AIR_DATA_BARO_ABS_ID ABI_BROADCAST |
ABI binding for absolute pressure.
Definition at line 46 of file air_data.c.
| #define AIR_DATA_BARO_DIFF_ID ABI_BROADCAST |
ABI binding for differential pressure.
Definition at line 53 of file air_data.c.
Calculate Airspeed from differential pressure by default.
Definition at line 85 of file air_data.c.
Don't calculate AMSL from baro and QNH by default.
Definition at line 95 of file air_data.c.
Calculate tas_factor from temp and pressure by default.
Definition at line 90 of file air_data.c.
| #define AIR_DATA_INCIDENCE_ID ABI_BROADCAST |
ABI binding for incidence angles.
Definition at line 74 of file air_data.c.
| #define AIR_DATA_TAS_FACTOR 1.0 |
Default factor to convert estimated airspeed (EAS) to true airspeed (TAS)
Definition at line 80 of file air_data.c.
| #define AIR_DATA_TEMPERATURE_ID ABI_BROADCAST |
ABI binding for temperature.
Definition at line 60 of file air_data.c.
Return AMSL (altitude AboveSeaLevel).
If AMSL from baro is valid, return that, otherwise from gps.
Definition at line 259 of file air_data.c.
References air_data, LlaCoor_f::alt, AirData::amsl_baro, AirData::amsl_baro_valid, and stateGetPositionLla_f().
Referenced by compute_tas_factor().
Here is the call graph for this function:
Here is the caller graph for this function:AirData initialization.
Called at startup. Bind ABI messages
Definition at line 218 of file air_data.c.
References air_data, AIR_DATA_AIRSPEED_ID, 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_INCIDENCE_ID, AIR_DATA_TAS_FACTOR, AIR_DATA_TEMPERATURE_ID, AirData::airspeed, airspeed_cb(), airspeed_ev, AirData::amsl_baro, AirData::amsl_baro_valid, AirData::aoa, baro_health_counter, AirData::calc_airspeed, AirData::calc_amsl_baro, AirData::calc_qnh_once, AirData::calc_tas_factor, DefaultPeriodic, AirData::differential, foo, incidence_cb(), incidence_ev, AirData::pressure, pressure_abs_cb(), pressure_abs_ev, pressure_diff_cb(), pressure_diff_ev, AirData::qnh, register_periodic_telemetry(), send_air_data(), send_amsl(), send_baro_raw(), AirData::sideslip, AirData::tas, AirData::tas_factor, AirData::temperature, temperature_cb(), temperature_ev, AirData::wind_dir, and AirData::wind_speed.
Here is the call graph for this function:| void air_data_parse_WIND_INFO | ( | struct link_device * | dev, |
| struct transport_tx * | trans, | ||
| uint8_t * | buf | ||
| ) |
Parse datalink wind info message.
Definition at line 279 of file air_data.c.
References air_data, AirData::airspeed, dev, eas_from_tas(), float_vect2_norm(), foo, stateGetAirspeed_f(), stateSetAirspeed_f(), stateSetHorizontalWindspeed_f(), stateSetVerticalWindspeed_f(), AirData::tas, AirData::wind_dir, AirData::wind_speed, FloatVect2::x, and FloatVect2::y.
Here is the call graph for this function:Check health.
Needs to be called periodically.
Definition at line 269 of file air_data.c.
References air_data, AirData::amsl_baro_valid, and baro_health_counter.
Definition at line 163 of file air_data.c.
References air_data, AirData::airspeed, AirData::calc_airspeed, foo, stateSetAirspeed_f(), AirData::tas, and tas_from_eas().
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:Internal utility function to compute current tas factor if needed.
Definition at line 368 of file air_data.c.
References air_data, air_data_get_amsl(), AirData::calc_tas_factor, CelsiusOfKelvin, foo, get_tas_factor(), p, pprz_isa_pressure_of_altitude(), pprz_isa_temperature_of_altitude(), AirData::pressure, AirData::tas_factor, and AirData::temperature.
Referenced by eas_from_tas(), and tas_from_eas().
Here is the call graph for this function:
Here is the caller graph for this function:Calculate equivalent airspeed from dynamic pressure.
Dynamic pressure 
Airspeed from dynamic pressure:
![\[ v = \frac12 \sqrt{\frac{2q}{\rho}} \]](form_14.png)
with 

| q | dynamic pressure in Pa |
Definition at line 322 of file air_data.c.
References foo, PPRZ_ISA_AIR_DENSITY, and sign().
Referenced by pressure_diff_cb(), and tas_from_dynamic_pressure().
Here is the call graph for this function:
Here is the caller graph for this function:Calculate equivalent airspeed from true airspeed.
EAS from True airspeed (TAS): EAS = TAS / air_data.tas_factor
| tas | true airspeed (TAS) in m/s |
Definition at line 410 of file air_data.c.
References air_data, compute_tas_factor(), and AirData::tas_factor.
Referenced by air_data_parse_WIND_INFO(), and wind_estimation_quadrotor_periodic().
Here is the call graph for this function:
Here is the caller graph for this function:Calculate true airspeed (TAS) factor.
TAS = tas_factor * EAS
True airspeed (TAS) from equivalent airspeed (EAS):
![\[\mbox{TAS} = \mbox{EAS} \sqrt{\frac{\rho_0}{\rho}}\]](form_17.png)
and 




| p | current air pressure in Pa |
| t | current air temperature in degrees Celcius |
Definition at line 355 of file air_data.c.
References foo, KelvinOfCelsius, p, PPRZ_ISA_SEA_LEVEL_PRESSURE, and PPRZ_ISA_SEA_LEVEL_TEMP.
Referenced by compute_tas_factor(), and temperature_cb().
Here is the caller graph for this function:Definition at line 174 of file air_data.c.
References air_data, AirData::aoa, foo, AirData::sideslip, stateSetAngleOfAttack_f(), and stateSetSideslip_f().
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:FIXME: use height above MSL (geoid) and not WGS84 ellipsoid here
Definition at line 114 of file air_data.c.
References air_data, LlaCoor_f::alt, AirData::amsl_baro, AirData::amsl_baro_valid, baro_health_counter, AirData::calc_amsl_baro, AirData::calc_qnh_once, foo, h(), State::ned_initialized_f, pprz_isa_height_of_pressure_full(), pprz_isa_ref_pressure_of_height_full(), AirData::pressure, AirData::qnh, state, stateGetHmslOrigin_f(), stateGetLlaOrigin_f(), stateGetPositionLla_f(), and stateIsGlobalCoordinateValid().
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 141 of file air_data.c.
References air_data, AirData::airspeed, AirData::calc_airspeed, AirData::differential, eas_from_dynamic_pressure(), foo, AirData::pressure, stateSetAirspeed_f(), AirData::tas, and tas_from_eas().
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 197 of file air_data.c.
References air_data, AirData::airspeed, AirData::amsl_baro, dev, AirData::differential, foo, AirData::pressure, AirData::qnh, AirData::tas, and AirData::temperature.
Referenced by air_data_init().
Here is the caller graph for this function:
|
static |
Definition at line 206 of file air_data.c.
References air_data, LlaCoor_f::alt, AirData::amsl_baro, dev, foo, and stateGetPositionLla_f().
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 191 of file air_data.c.
References air_data, dev, AirData::differential, foo, and AirData::pressure.
Referenced by air_data_init().
Here is the caller graph for this function:Calculate true airspeed from dynamic pressure.
Dynamic pressure 
| q | dynamic pressure in Pa |
Definition at line 424 of file air_data.c.
References eas_from_dynamic_pressure(), and tas_from_eas().
Referenced by pressure_diff_cb().
Here is the call graph for this function:
Here is the caller graph for this function:Calculate true airspeed from equivalent airspeed.
True airspeed (TAS) from EAS: TAS = air_data.tas_factor * EAS
| eas | equivalent airspeed (EAS) in m/s |
Definition at line 395 of file air_data.c.
References air_data, compute_tas_factor(), foo, and AirData::tas_factor.
Referenced by airspeed_cb(), airspeed_cb(), pressure_diff_cb(), and tas_from_dynamic_pressure().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 153 of file air_data.c.
References air_data, AirData::airspeed, baro_health_counter, AirData::calc_tas_factor, get_tas_factor(), AirData::pressure, AirData::tas_factor, and AirData::temperature.
Referenced by air_data_init().
Here is the call graph for this function:
Here is the caller graph for this function:| struct AirData air_data |
global AirData state
Definition at line 41 of file air_data.c.
Referenced by air_data_get_amsl(), air_data_init(), air_data_parse_WIND_INFO(), air_data_periodic(), airspeed_cb(), compute_tas_factor(), eas_from_tas(), incidence_cb(), pressure_abs_cb(), pressure_diff_cb(), save_speeds(), send_air_data(), send_amsl(), send_baro_raw(), send_windtunnel_meas(), tas_from_eas(), and temperature_cb().
|
static |
Definition at line 69 of file air_data.c.
Referenced by air_data_init().
|
static |
counter to check baro health
Definition at line 111 of file air_data.c.
Referenced by air_data_init(), air_data_periodic(), pressure_abs_cb(), and temperature_cb().
|
static |
Definition at line 76 of file air_data.c.
Referenced by air_data_init().
|
static |
Definition at line 48 of file air_data.c.
Referenced by air_data_init().
|
static |
Definition at line 55 of file air_data.c.
Referenced by air_data_init().
|
static |
Definition at line 62 of file air_data.c.
Referenced by air_data_init().