Paparazzi UAS  v5.15_devel-112-g521f3cf
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Wind- and airspeed representations
+ Collaboration diagram for Wind- and airspeed representations:

Macros

#define WINDSPEED_I   0
 
#define DOWNWIND_I   1
 
#define AIRSPEED_I   2
 
#define WINDSPEED_F   3
 
#define DOWNWIND_F   4
 
#define AIRSPEED_F   5
 
#define AOA_F   6
 
#define SIDESLIP_F   7
 

Functions

void stateCalcHorizontalWindspeed_i (void)
 
void stateCalcVerticalWindspeed_i (void)
 
void stateCalcAirspeed_i (void)
 
void stateCalcHorizontalWindspeed_f (void)
 
void stateCalcVerticalWindspeed_f (void)
 
void stateCalcAirspeed_f (void)
 
static bool stateIsWindspeedValid (void)
 test if wind speed is available. More...
 
static bool stateIsVerticalWindspeedValid (void)
 test if vertical wind speed is available. More...
 
static bool stateIsAirspeedValid (void)
 test if air speed is available. More...
 
static bool stateIsAngleOfAttackValid (void)
 test if angle of attack is available. More...
 
static bool stateIsSideslipValid (void)
 test if sideslip is available. More...
 
static void stateSetHorizontalWindspeed_i (struct Int32Vect2 *h_windspeed)
 Set horizontal windspeed (int). More...
 
static void stateSetVerticalWindspeed_i (int32_t v_windspeed)
 Set vertical windspeed (int). More...
 
static void stateSetAirspeed_i (int32_t airspeed)
 Set airspeed (int). More...
 
static void stateSetHorizontalWindspeed_f (struct FloatVect2 *h_windspeed)
 Set horizontal windspeed (float). More...
 
static void stateSetVerticalWindspeed_f (float v_windspeed)
 Set vertical windspeed (float). More...
 
static void stateSetAirspeed_f (float airspeed)
 Set airspeed (float). More...
 
static void stateSetAngleOfAttack_f (float aoa)
 Set angle of attack in radians (float). More...
 
static void stateSetSideslip_f (float sideslip)
 Set sideslip angle in radians (float). More...
 
static struct Int32Vect2stateGetHorizontalWindspeed_i (void)
 Get horizontal windspeed (int). More...
 
static float stateGetVerticalWindspeed_i (void)
 Get vertical windspeed (int). More...
 
static struct Int32Vect3stateGetWindspeed_i (void)
 Get windspeed (int). More...
 
static int32_t stateGetAirspeed_i (void)
 Get airspeed (int). More...
 
static struct FloatVect2stateGetHorizontalWindspeed_f (void)
 Get horizontal windspeed (float). More...
 
static float stateGetVerticalWindspeed_f (void)
 Get vertical windspeed (float). More...
 
static struct FloatVect3stateGetWindspeed_f (void)
 Get windspeed (float). More...
 
static float stateGetAirspeed_f (void)
 Get airspeed (float). More...
 
static float stateGetAngleOfAttack_f (void)
 Get angle of attack (float). More...
 
static float stateGetSideslip_f (void)
 Get sideslip (float). More...
 

Variables

uint8_t State::wind_air_status
 Holds the status bits for all wind- and airspeed representations. More...
 
union {
struct Int32Vect3 vect3
 
struct Int32Vect2 vect2
 
State::windspeed_i
 Horizontal windspeed in north/east/down. More...
 
int32_t State::airspeed_i
 Norm of relative wind speed. More...
 
union {
struct FloatVect3 vect3
 
struct FloatVect2 vect2
 
State::windspeed_f
 Horizontal windspeed. More...
 
float State::airspeed_f
 Norm of relative air speed. More...
 
float State::angle_of_attack_f
 Angle of attack Unit: rad. More...
 
float State::sideslip_f
 Sideslip angle Unit: rad. More...
 

Detailed Description

Macro Definition Documentation

#define AOA_F   6

Definition at line 126 of file state.h.

Referenced by stateIsAngleOfAttackValid(), and stateSetAngleOfAttack_f().

#define SIDESLIP_F   7

Definition at line 127 of file state.h.

Referenced by stateIsSideslipValid(), and stateSetSideslip_f().

Function Documentation

void stateCalcAirspeed_f ( void  )

Definition at line 1325 of file state.c.

References AIRSPEED_F, State::airspeed_f, AIRSPEED_I, State::airspeed_i, SPEED_FLOAT_OF_BFP, state, and State::wind_air_status.

Referenced by stateGetAirspeed_f().

+ Here is the caller graph for this function:

void stateCalcAirspeed_i ( void  )

Definition at line 1279 of file state.c.

References AIRSPEED_F, State::airspeed_f, AIRSPEED_I, State::airspeed_i, SPEED_BFP_OF_REAL, state, and State::wind_air_status.

Referenced by stateGetAirspeed_i().

+ Here is the caller graph for this function:

void stateCalcHorizontalWindspeed_f ( void  )

Definition at line 1294 of file state.c.

References SPEED_FLOAT_OF_BFP, state, State::wind_air_status, WINDSPEED_F, State::windspeed_f, WINDSPEED_I, and State::windspeed_i.

Referenced by stateGetHorizontalWindspeed_f(), and stateGetWindspeed_f().

+ Here is the caller graph for this function:

void stateCalcHorizontalWindspeed_i ( void  )

Definition at line 1248 of file state.c.

References SPEED_BFP_OF_REAL, state, State::wind_air_status, WINDSPEED_F, State::windspeed_f, WINDSPEED_I, and State::windspeed_i.

Referenced by stateGetHorizontalWindspeed_i(), and stateGetWindspeed_i().

+ Here is the caller graph for this function:

void stateCalcVerticalWindspeed_f ( void  )

Definition at line 1310 of file state.c.

References DOWNWIND_F, DOWNWIND_I, SPEED_FLOAT_OF_BFP, state, State::wind_air_status, State::windspeed_f, and State::windspeed_i.

Referenced by stateGetVerticalWindspeed_f(), and stateGetWindspeed_f().

+ Here is the caller graph for this function:

void stateCalcVerticalWindspeed_i ( void  )

Definition at line 1264 of file state.c.

References DOWNWIND_F, DOWNWIND_I, SPEED_BFP_OF_REAL, state, State::wind_air_status, State::windspeed_f, and State::windspeed_i.

Referenced by stateGetVerticalWindspeed_i(), and stateGetWindspeed_i().

+ Here is the caller graph for this function:

static float stateGetAirspeed_f ( void  )
inlinestatic

Get airspeed (float).

Definition at line 1407 of file state.h.

References AIRSPEED_F, State::airspeed_f, state, stateCalcAirspeed_f(), and State::wind_air_status.

Referenced by firmware_parse_msg(), flight_benchmark_periodic(), generic_com_periodic(), mavlink_send_vfr_hud(), nav_bungee_takeoff_run(), send_airspeed(), snav_on_time(), v_ctl_climb_loop(), and wind_estimator_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int32_t stateGetAirspeed_i ( void  )
inlinestatic

Get airspeed (int).

Definition at line 1368 of file state.h.

References AIRSPEED_I, State::airspeed_i, state, stateCalcAirspeed_i(), and State::wind_air_status.

+ Here is the call graph for this function:

static float stateGetAngleOfAttack_f ( void  )
inlinestatic

Get angle of attack (float).

Todo:
only float for now

Definition at line 1416 of file state.h.

References State::angle_of_attack_f, and state.

Referenced by h_ctl_pitch_loop(), and wind_estimator_periodic().

+ Here is the caller graph for this function:

static struct FloatVect2* stateGetHorizontalWindspeed_f ( void  )
static

Get horizontal windspeed (float).

Definition at line 1377 of file state.h.

References state, stateCalcHorizontalWindspeed_f(), State::wind_air_status, WINDSPEED_F, and State::windspeed_f.

Referenced by ahrs_infrared_update_gps(), compute_TOD(), gls_compute_TOD(), mf_daq_send_state(), nav_survey_disc_run(), parse_mf_daq_msg(), and snav_on_time().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct Int32Vect2* stateGetHorizontalWindspeed_i ( void  )
static

Get horizontal windspeed (int).

Definition at line 1338 of file state.h.

References state, stateCalcHorizontalWindspeed_i(), State::wind_air_status, WINDSPEED_I, and State::windspeed_i.

+ Here is the call graph for this function:

static float stateGetSideslip_f ( void  )
inlinestatic

Get sideslip (float).

Todo:
only float for now

Definition at line 1425 of file state.h.

References State::sideslip_f, and state.

Referenced by wind_estimator_periodic().

+ Here is the caller graph for this function:

static float stateGetVerticalWindspeed_f ( void  )
inlinestatic

Get vertical windspeed (float).

Definition at line 1386 of file state.h.

References DOWNWIND_F, state, stateCalcVerticalWindspeed_f(), State::wind_air_status, and State::windspeed_f.

+ Here is the call graph for this function:

static float stateGetVerticalWindspeed_i ( void  )
inlinestatic

Get vertical windspeed (int).

Definition at line 1347 of file state.h.

References DOWNWIND_I, state, stateCalcVerticalWindspeed_i(), State::wind_air_status, and State::windspeed_i.

+ Here is the call graph for this function:

static struct FloatVect3* stateGetWindspeed_f ( void  )
static

Get windspeed (float).

Definition at line 1395 of file state.h.

References DOWNWIND_F, state, stateCalcHorizontalWindspeed_f(), stateCalcVerticalWindspeed_f(), State::wind_air_status, WINDSPEED_F, and State::windspeed_f.

+ Here is the call graph for this function:

static struct Int32Vect3* stateGetWindspeed_i ( void  )
static

Get windspeed (int).

Definition at line 1356 of file state.h.

References DOWNWIND_I, state, stateCalcHorizontalWindspeed_i(), stateCalcVerticalWindspeed_i(), State::wind_air_status, WINDSPEED_I, and State::windspeed_i.

+ Here is the call graph for this function:

static bool stateIsAirspeedValid ( void  )
inlinestatic

test if air speed is available.

Definition at line 1244 of file state.h.

References AIRSPEED_F, AIRSPEED_I, state, and State::wind_air_status.

static bool stateIsAngleOfAttackValid ( void  )
inlinestatic

test if angle of attack is available.

Definition at line 1250 of file state.h.

References AOA_F, state, and State::wind_air_status.

static bool stateIsSideslipValid ( void  )
inlinestatic

test if sideslip is available.

Definition at line 1256 of file state.h.

References SIDESLIP_F, state, and State::wind_air_status.

static bool stateIsVerticalWindspeedValid ( void  )
inlinestatic

test if vertical wind speed is available.

Definition at line 1238 of file state.h.

References DOWNWIND_F, DOWNWIND_I, state, and State::wind_air_status.

static bool stateIsWindspeedValid ( void  )
inlinestatic

test if wind speed is available.

Definition at line 1232 of file state.h.

References state, State::wind_air_status, WINDSPEED_F, and WINDSPEED_I.

static void stateSetAirspeed_f ( float  airspeed)
inlinestatic
static void stateSetAirspeed_i ( int32_t  airspeed)
inlinestatic

Set airspeed (int).

Definition at line 1282 of file state.h.

References AIRSPEED_F, AIRSPEED_I, State::airspeed_i, state, and State::wind_air_status.

static void stateSetAngleOfAttack_f ( float  aoa)
inlinestatic

Set angle of attack in radians (float).

Todo:
no integer yet

Definition at line 1318 of file state.h.

References State::angle_of_attack_f, AOA_F, state, and State::wind_air_status.

Referenced by aoa_adc_update(), and incidence_cb().

+ Here is the caller graph for this function:

static void stateSetHorizontalWindspeed_f ( struct FloatVect2 h_windspeed)
inlinestatic

Set horizontal windspeed (float).

Definition at line 1291 of file state.h.

References state, VECT2_COPY, State::wind_air_status, WINDSPEED_F, State::windspeed_f, and WINDSPEED_I.

Referenced by firmware_parse_msg(), and wind_estimator_event().

+ Here is the caller graph for this function:

static void stateSetHorizontalWindspeed_i ( struct Int32Vect2 h_windspeed)
inlinestatic

Set horizontal windspeed (int).

Definition at line 1264 of file state.h.

References state, VECT2_COPY, State::wind_air_status, WINDSPEED_F, WINDSPEED_I, and State::windspeed_i.

static void stateSetSideslip_f ( float  sideslip)
inlinestatic

Set sideslip angle in radians (float).

Todo:
no integer yet

Definition at line 1327 of file state.h.

References SIDESLIP_F, State::sideslip_f, state, and State::wind_air_status.

Referenced by incidence_cb().

+ Here is the caller graph for this function:

static void stateSetVerticalWindspeed_f ( float  v_windspeed)
inlinestatic

Set vertical windspeed (float).

Definition at line 1300 of file state.h.

References DOWNWIND_F, DOWNWIND_I, state, State::wind_air_status, and State::windspeed_f.

Referenced by firmware_parse_msg(), and wind_estimator_event().

+ Here is the caller graph for this function:

static void stateSetVerticalWindspeed_i ( int32_t  v_windspeed)
inlinestatic

Set vertical windspeed (int).

Definition at line 1273 of file state.h.

References DOWNWIND_F, DOWNWIND_I, state, State::wind_air_status, and State::windspeed_i.

Variable Documentation

float State::airspeed_f

Norm of relative air speed.

Unit: m/s

Definition at line 431 of file state.h.

Referenced by stateCalcAirspeed_f(), stateCalcAirspeed_i(), stateGetAirspeed_f(), and stateSetAirspeed_f().

int32_t State::airspeed_i

Norm of relative wind speed.

Unit: m/s in BFP with INT32_SPEED_FRAC

Definition at line 416 of file state.h.

Referenced by stateCalcAirspeed_f(), stateCalcAirspeed_i(), stateGetAirspeed_i(), and stateSetAirspeed_i().

float State::angle_of_attack_f

Angle of attack Unit: rad.

Definition at line 437 of file state.h.

Referenced by stateGetAngleOfAttack_f(), and stateSetAngleOfAttack_f().

float State::sideslip_f

Sideslip angle Unit: rad.

Definition at line 443 of file state.h.

Referenced by stateGetSideslip_f(), and stateSetSideslip_f().

struct { ... } ::vect2

Definition at line 424 of file state.h.

struct { ... } ::vect2

Definition at line 409 of file state.h.

struct { ... } ::vect3

Definition at line 408 of file state.h.

struct { ... } ::vect3

Definition at line 423 of file state.h.