Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
air_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Gautier Hattenberger
3  * 2014 Felix Ruess <felix.ruess@gmail.com>
4  *
5  * This file is part of paparazzi
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
31 #ifndef AIR_DATA_H
32 #define AIR_DATA_H
33 
34 #include "std.h"
35 
37 struct AirData {
38  float pressure;
39  float differential;
40  float temperature;
41 
42  float airspeed;
43  float tas;
44  float tas_factor;
45  float qnh;
46  float amsl_baro;
52 
53  float aoa;
54  float sideslip;
55  float wind_speed;
56  float wind_dir;
57 };
58 
61 extern struct AirData air_data;
62 
65 extern void air_data_init(void);
66 
69 extern void air_data_periodic(void);
70 
74 extern float air_data_get_amsl(void);
75 
84 extern float eas_from_dynamic_pressure(float q);
85 
94 extern float get_tas_factor(float p, float t);
95 
102 extern float tas_from_eas(float eas);
103 
112 extern float tas_from_dynamic_pressure(float q);
113 
114 
115 #endif
AirData::amsl_baro
float amsl_baro
altitude above sea level in m from pressure and QNH
Definition: air_data.h:46
AirData::wind_dir
float wind_dir
wind direction (rad, 0 north, >0 clockwise)
Definition: air_data.h:56
air_data_periodic
void air_data_periodic(void)
Check health.
Definition: air_data.c:267
AirData::tas_factor
float tas_factor
factor to convert equivalent airspeed (EAS) to true airspeed (TAS)
Definition: air_data.h:44
AirData::calc_amsl_baro
bool calc_amsl_baro
if TRUE, calculate amsl_baro
Definition: air_data.h:50
std.h
air_data
struct AirData air_data
global AirData state
Definition: air_data.c:39
AirData::calc_qnh_once
bool calc_qnh_once
flag to calculate QNH with next pressure measurement
Definition: air_data.h:49
AirData::airspeed
float airspeed
Equivalent Air Speed (equals to Calibrated Air Speed at low speed/altitude) (in m/s,...
Definition: air_data.h:42
air_data_get_amsl
float air_data_get_amsl(void)
Return AMSL (altitude AboveSeaLevel).
Definition: air_data.c:257
AirData::qnh
float qnh
Barometric pressure adjusted to sea level in hPa, -1 if unknown.
Definition: air_data.h:45
AirData::sideslip
float sideslip
sideslip angle (rad)
Definition: air_data.h:54
AirData::calc_airspeed
bool calc_airspeed
if TRUE, calculate airspeed from differential pressure
Definition: air_data.h:48
AirData::wind_speed
float wind_speed
wind speed (m/s)
Definition: air_data.h:55
AirData::differential
float differential
Differential pressure (total - static pressure) (Pa)
Definition: air_data.h:39
AirData::temperature
float temperature
temperature in degrees Celcius, -1000 if unknown
Definition: air_data.h:40
AirData::amsl_baro_valid
bool amsl_baro_valid
TRUE if amsl_baro is currently valid.
Definition: air_data.h:47
air_data_init
void air_data_init(void)
AirData initialization.
Definition: air_data.c:216
AirData::pressure
float pressure
Static atmospheric pressure (Pa), -1 if unknown.
Definition: air_data.h:38
tas_from_dynamic_pressure
float tas_from_dynamic_pressure(float q)
Calculate true airspeed from dynamic pressure.
Definition: air_data.c:365
AirData::aoa
float aoa
angle of attack (rad)
Definition: air_data.h:53
AirData
Air Data strucute.
Definition: air_data.h:37
get_tas_factor
float get_tas_factor(float p, float t)
Calculate true airspeed (TAS) factor.
Definition: air_data.c:319
tas_from_eas
float tas_from_eas(float eas)
Calculate true airspeed from equivalent airspeed.
Definition: air_data.c:338
AirData::calc_tas_factor
bool calc_tas_factor
if TRUE, calculate tas_factor when getting a temp measurement
Definition: air_data.h:51
p
static float p[2][2]
Definition: ins_alt_float.c:268
eas_from_dynamic_pressure
float eas_from_dynamic_pressure(float q)
Calculate equivalent airspeed from dynamic pressure.
Definition: air_data.c:291
AirData::tas
float tas
True Air Speed (TAS) in m/s, -1 if unknown.
Definition: air_data.h:43