Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ AIRSPEED_F

#define AIRSPEED_F   5

Definition at line 125 of file state.h.

◆ AIRSPEED_I

#define AIRSPEED_I   2

Definition at line 122 of file state.h.

◆ AOA_F

#define AOA_F   6

Definition at line 126 of file state.h.

◆ DOWNWIND_F

#define DOWNWIND_F   4

Definition at line 124 of file state.h.

◆ DOWNWIND_I

#define DOWNWIND_I   1

Definition at line 121 of file state.h.

◆ SIDESLIP_F

#define SIDESLIP_F   7

Definition at line 127 of file state.h.

◆ WINDSPEED_F

#define WINDSPEED_F   3

Definition at line 123 of file state.h.

◆ WINDSPEED_I

#define WINDSPEED_I   0

Definition at line 120 of file state.h.

Function Documentation

◆ stateCalcAirspeed_f()

void stateCalcAirspeed_f ( void  )

Definition at line 1344 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:

◆ stateCalcAirspeed_i()

void stateCalcAirspeed_i ( void  )

Definition at line 1298 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:

◆ stateCalcHorizontalWindspeed_f()

void stateCalcHorizontalWindspeed_f ( void  )

Definition at line 1313 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:

◆ stateCalcHorizontalWindspeed_i()

void stateCalcHorizontalWindspeed_i ( void  )

Definition at line 1267 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:

◆ stateCalcVerticalWindspeed_f()

void stateCalcVerticalWindspeed_f ( void  )

Definition at line 1329 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:

◆ stateCalcVerticalWindspeed_i()

void stateCalcVerticalWindspeed_i ( void  )

Definition at line 1283 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:

◆ stateGetAirspeed_f()

◆ stateGetAirspeed_i()

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:

◆ stateGetAngleOfAttack_f()

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:

◆ stateGetHorizontalWindspeed_f()

static struct FloatVect2* stateGetHorizontalWindspeed_f ( void  )
inlinestatic

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 compute_TOD(), get_time_to_home(), gls_compute_TOD(), mf_daq_send_state(), parse_mf_daq_msg(), and snav_on_time().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stateGetHorizontalWindspeed_i()

static struct Int32Vect2* stateGetHorizontalWindspeed_i ( void  )
inlinestatic

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:

◆ stateGetSideslip_f()

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:

◆ stateGetVerticalWindspeed_f()

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:

◆ stateGetVerticalWindspeed_i()

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:

◆ stateGetWindspeed_f()

static struct FloatVect3* stateGetWindspeed_f ( void  )
inlinestatic

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:

◆ stateGetWindspeed_i()

static struct Int32Vect3* stateGetWindspeed_i ( void  )
inlinestatic

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:

◆ stateIsAirspeedValid()

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.

Referenced by get_time_to_home().

+ Here is the caller graph for this function:

◆ stateIsAngleOfAttackValid()

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.

◆ stateIsSideslipValid()

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.

◆ stateIsVerticalWindspeedValid()

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.

◆ stateIsWindspeedValid()

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.

Referenced by get_time_to_home().

+ Here is the caller graph for this function:

◆ stateSetAirspeed_f()

static void stateSetAirspeed_f ( float  airspeed)
inlinestatic

◆ stateSetAirspeed_i()

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.

◆ stateSetAngleOfAttack_f()

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:

◆ stateSetHorizontalWindspeed_f()

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 air_data_parse_WIND_INFO(), wind_estimation_quadrotor_periodic(), wind_estimation_quadrotor_stop(), and wind_estimator_event().

+ Here is the caller graph for this function:

◆ stateSetHorizontalWindspeed_i()

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.

◆ stateSetSideslip_f()

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:

◆ stateSetVerticalWindspeed_f()

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 air_data_parse_WIND_INFO(), and wind_estimator_event().

+ Here is the caller graph for this function:

◆ stateSetVerticalWindspeed_i()

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

◆ airspeed_f

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().

◆ airspeed_i

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().

◆ angle_of_attack_f

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().

◆ sideslip_f

float State::sideslip_f

Sideslip angle Unit: rad.

Definition at line 443 of file state.h.

Referenced by stateGetSideslip_f(), and stateSetSideslip_f().

◆  [1/2]

struct { ... } ::vect2

Definition at line 443 of file state.h.

◆  [2/2]

struct { ... } ::vect2

Definition at line 443 of file state.h.

◆  [1/2]

struct { ... } ::vect3

Definition at line 443 of file state.h.

◆  [2/2]

struct { ... } ::vect3

Definition at line 443 of file state.h.

◆ wind_air_status

◆ 

◆