Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Speed representations
+ Collaboration diagram for Speed representations:

Macros

#define SPEED_ECEF_I   0
 
#define SPEED_NED_I   1
 
#define SPEED_ENU_I   2
 
#define SPEED_HNORM_I   3
 
#define SPEED_HDIR_I   4
 
#define SPEED_ECEF_F   5
 
#define SPEED_NED_F   6
 
#define SPEED_ENU_F   7
 
#define SPEED_HNORM_F   8
 
#define SPEED_HDIR_F   9
 
#define SPEED_LOCAL_COORD   ((1<<SPEED_NED_I)|(1<<SPEED_ENU_I)|(1<<SPEED_NED_F)|(1<<SPEED_ENU_F))
 

Functions

void stateCalcSpeedNed_i (void)
 
void stateCalcSpeedEnu_i (void)
 
void stateCalcSpeedEcef_i (void)
 
void stateCalcHorizontalSpeedNorm_i (void)
 
void stateCalcHorizontalSpeedDir_i (void)
 
void stateCalcSpeedNed_f (void)
 
void stateCalcSpeedEnu_f (void)
 
void stateCalcSpeedEcef_f (void)
 
void stateCalcHorizontalSpeedNorm_f (void)
 
void stateCalcHorizontalSpeedDir_f (void)
 
static void stateSetSpeedNed_i (uint16_t id, struct NedCoor_i *ned_speed)
 Set ground speed in local NED coordinates (int). More...
 
static void stateSetSpeedEnu_i (uint16_t id, struct EnuCoor_i *enu_speed)
 Set ground speed in local ENU coordinates (int). More...
 
static void stateSetSpeedEcef_i (uint16_t id, struct EcefCoor_i *ecef_speed)
 Set ground speed in ECEF coordinates (int). More...
 
static void stateSetSpeed_i (uint16_t id, struct EcefCoor_i *ecef_speed, struct NedCoor_i *ned_speed, struct EnuCoor_i *enu_speed)
 Set multiple speed coordinates (int). More...
 
static void stateSetSpeedNed_f (uint16_t id, struct NedCoor_f *ned_speed)
 Set ground speed in local NED coordinates (float). More...
 
static void stateSetSpeedEnu_f (uint16_t id, struct EnuCoor_f *enu_speed)
 Set ground speed in local ENU coordinates (float). More...
 
static void stateSetSpeedEcef_f (uint16_t id, struct EcefCoor_f *ecef_speed)
 Set ground speed in ECEF coordinates (float). More...
 
static void stateSetSpeed_f (uint16_t id, struct EcefCoor_f *ecef_speed, struct NedCoor_f *ned_speed, struct EnuCoor_f *enu_speed)
 Set multiple speed coordinates (float). More...
 
static struct NedCoor_istateGetSpeedNed_i (void)
 Get ground speed in local NED coordinates (int). More...
 
static struct EnuCoor_istateGetSpeedEnu_i (void)
 Get ground speed in local ENU coordinates (int). More...
 
static struct EcefCoor_istateGetSpeedEcef_i (void)
 Get ground speed in ECEF coordinates (int). More...
 
static uint32_t stateGetHorizontalSpeedNorm_i (void)
 Get norm of horizontal ground speed (int). More...
 
static int32_t stateGetHorizontalSpeedDir_i (void)
 Get dir of horizontal ground speed (int). More...
 
static struct NedCoor_fstateGetSpeedNed_f (void)
 Get ground speed in local NED coordinates (float). More...
 
static struct EnuCoor_fstateGetSpeedEnu_f (void)
 Get ground speed in local ENU coordinates (float). More...
 
static struct EcefCoor_fstateGetSpeedEcef_f (void)
 Get ground speed in ECEF coordinates (float). More...
 
static float stateGetHorizontalSpeedNorm_f (void)
 Get norm of horizontal ground speed (float). More...
 
static float stateGetHorizontalSpeedDir_f (void)
 Get dir of horizontal ground speed (float). More...
 
static struct Int32Vect3stateGetAccelBody_i (void)
 Get acceleration in Body coordinates (int). More...
 

Variables

uint16_t State::speed_status
 Holds the status bits for all ground speed representations. More...
 
uint16_t State::speed_input_filter
 Holds the input filter id for speed. More...
 
struct EcefCoor_i State::ecef_speed_i
 Velocity in EarthCenteredEarthFixed coordinates. More...
 
struct NedCoor_i State::ned_speed_i
 Velocity in North East Down coordinates. More...
 
struct EnuCoor_i State::enu_speed_i
 Velocity in East North Up coordinates. More...
 
uint32_t State::h_speed_norm_i
 Norm of horizontal ground speed. More...
 
int32_t State::h_speed_dir_i
 Direction of horizontal ground speed. More...
 
struct EcefCoor_f State::ecef_speed_f
 Velocity in EarthCenteredEarthFixed coordinates. More...
 
struct NedCoor_f State::ned_speed_f
 speed in North East Down coordinates More...
 
struct EnuCoor_f State::enu_speed_f
 Velocity in East North Up coordinates. More...
 
float State::h_speed_norm_f
 Norm of horizontal ground speed. More...
 
float State::h_speed_dir_f
 Direction of horizontal ground speed. More...
 

Detailed Description

Macro Definition Documentation

◆ SPEED_ECEF_F

#define SPEED_ECEF_F   5

Definition at line 94 of file state.h.

◆ SPEED_ECEF_I

#define SPEED_ECEF_I   0

Definition at line 89 of file state.h.

◆ SPEED_ENU_F

#define SPEED_ENU_F   7

Definition at line 96 of file state.h.

◆ SPEED_ENU_I

#define SPEED_ENU_I   2

Definition at line 91 of file state.h.

◆ SPEED_HDIR_F

#define SPEED_HDIR_F   9

Definition at line 98 of file state.h.

◆ SPEED_HDIR_I

#define SPEED_HDIR_I   4

Definition at line 93 of file state.h.

◆ SPEED_HNORM_F

#define SPEED_HNORM_F   8

Definition at line 97 of file state.h.

◆ SPEED_HNORM_I

#define SPEED_HNORM_I   3

Definition at line 92 of file state.h.

◆ SPEED_LOCAL_COORD

#define SPEED_LOCAL_COORD   ((1<<SPEED_NED_I)|(1<<SPEED_ENU_I)|(1<<SPEED_NED_F)|(1<<SPEED_ENU_F))

Definition at line 99 of file state.h.

◆ SPEED_NED_F

#define SPEED_NED_F   6

Definition at line 95 of file state.h.

◆ SPEED_NED_I

#define SPEED_NED_I   1

Definition at line 90 of file state.h.

Function Documentation

◆ stateCalcHorizontalSpeedDir_f()

◆ stateCalcHorizontalSpeedDir_i()

◆ stateCalcHorizontalSpeedNorm_f()

◆ stateCalcHorizontalSpeedNorm_i()

◆ stateCalcSpeedEcef_f()

void stateCalcSpeedEcef_f ( void  )

Definition at line 1127 of file state.c.

References ecef_of_ned_vect_f(), State::ecef_speed_f, State::ned_origin_f, State::ned_speed_f, State::ned_speed_i, SPEED_ECEF_F, SPEED_ECEF_I, SPEED_NED_F, SPEED_NED_I, State::speed_status, SPEEDS_FLOAT_OF_BFP, and state.

Referenced by stateGetSpeedEcef_f().

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

◆ stateCalcSpeedEcef_i()

void stateCalcSpeedEcef_i ( void  )

Definition at line 925 of file state.c.

References ecef_of_ned_vect_i(), State::ecef_speed_f, State::ecef_speed_i, State::ned_origin_i, State::ned_speed_f, State::ned_speed_i, SPEED_ECEF_F, SPEED_ECEF_I, SPEED_NED_F, SPEED_NED_I, State::speed_status, SPEEDS_BFP_OF_REAL, and state.

Referenced by stateGetSpeedEcef_i().

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

◆ stateCalcSpeedEnu_f()

◆ stateCalcSpeedEnu_i()

◆ stateCalcSpeedNed_f()

◆ stateCalcSpeedNed_i()

◆ stateGetAccelBody_i()

static struct Int32Vect3* stateGetAccelBody_i ( void  )
inlinestatic

◆ stateGetHorizontalSpeedDir_f()

static float stateGetHorizontalSpeedDir_f ( void  )
inlinestatic

◆ stateGetHorizontalSpeedDir_i()

static int32_t stateGetHorizontalSpeedDir_i ( void  )
inlinestatic

Get dir of horizontal ground speed (int).

Definition at line 1040 of file state.h.

References State::h_speed_dir_i, SPEED_HDIR_I, State::speed_status, state, and stateCalcHorizontalSpeedDir_i().

Referenced by dc_send_command().

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

◆ stateGetHorizontalSpeedNorm_f()

◆ stateGetHorizontalSpeedNorm_i()

static uint32_t stateGetHorizontalSpeedNorm_i ( void  )
inlinestatic

Get norm of horizontal ground speed (int).

Definition at line 1031 of file state.h.

References State::h_speed_norm_i, SPEED_HNORM_I, State::speed_status, state, and stateCalcHorizontalSpeedNorm_i().

Referenced by dc_send_command(), and hott_update_eam_msg().

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

◆ stateGetSpeedEcef_f()

static struct EcefCoor_f* stateGetSpeedEcef_f ( void  )
inlinestatic

Get ground speed in ECEF coordinates (float).

Definition at line 1067 of file state.h.

References State::ecef_speed_f, SPEED_ECEF_F, State::speed_status, state, and stateCalcSpeedEcef_f().

+ Here is the call graph for this function:

◆ stateGetSpeedEcef_i()

static struct EcefCoor_i* stateGetSpeedEcef_i ( void  )
inlinestatic

Get ground speed in ECEF coordinates (int).

Definition at line 1022 of file state.h.

References State::ecef_speed_i, SPEED_ECEF_I, State::speed_status, state, and stateCalcSpeedEcef_i().

+ Here is the call graph for this function:

◆ stateGetSpeedEnu_f()

◆ stateGetSpeedEnu_i()

static struct EnuCoor_i* stateGetSpeedEnu_i ( void  )
inlinestatic

Get ground speed in local ENU coordinates (int).

Definition at line 1013 of file state.h.

References State::enu_speed_i, SPEED_ENU_I, State::speed_status, state, and stateCalcSpeedEnu_i().

Referenced by hott_update_eam_msg(), logger_control_effectiveness_periodic(), and send_fp().

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

◆ stateGetSpeedNed_f()

◆ stateGetSpeedNed_i()

static struct NedCoor_i* stateGetSpeedNed_i ( void  )
inlinestatic

◆ stateSetSpeed_f()

static void stateSetSpeed_f ( uint16_t  id,
struct EcefCoor_f ecef_speed,
struct NedCoor_f ned_speed,
struct EnuCoor_f enu_speed 
)
inlinestatic

◆ stateSetSpeed_i()

static void stateSetSpeed_i ( uint16_t  id,
struct EcefCoor_i ecef_speed,
struct NedCoor_i ned_speed,
struct EnuCoor_i enu_speed 
)
inlinestatic

◆ stateSetSpeedEcef_f()

static void stateSetSpeedEcef_f ( uint16_t  id,
struct EcefCoor_f ecef_speed 
)
inlinestatic

Set ground speed in ECEF coordinates (float).

Definition at line 967 of file state.h.

References State::ecef_speed_f, SPEED_ECEF_F, State::speed_input_filter, State::speed_status, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEcef_i()

static void stateSetSpeedEcef_i ( uint16_t  id,
struct EcefCoor_i ecef_speed 
)
inlinestatic

Set ground speed in ECEF coordinates (int).

Definition at line 912 of file state.h.

References State::ecef_speed_i, SPEED_ECEF_I, State::speed_input_filter, State::speed_status, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEnu_f()

static void stateSetSpeedEnu_f ( uint16_t  id,
struct EnuCoor_f enu_speed 
)
inlinestatic

Set ground speed in local ENU coordinates (float).

Definition at line 957 of file state.h.

References State::enu_speed_f, SPEED_ENU_F, State::speed_input_filter, State::speed_status, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEnu_i()

static void stateSetSpeedEnu_i ( uint16_t  id,
struct EnuCoor_i enu_speed 
)
inlinestatic

Set ground speed in local ENU coordinates (int).

Definition at line 902 of file state.h.

References State::enu_speed_i, SPEED_ENU_I, State::speed_input_filter, State::speed_status, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedNed_f()

static void stateSetSpeedNed_f ( uint16_t  id,
struct NedCoor_f ned_speed 
)
inlinestatic

◆ stateSetSpeedNed_i()

static void stateSetSpeedNed_i ( uint16_t  id,
struct NedCoor_i ned_speed 
)
inlinestatic

Set ground speed in local NED coordinates (int).

Definition at line 892 of file state.h.

References State::ned_speed_i, State::speed_input_filter, SPEED_NED_I, State::speed_status, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

Referenced by gps_cb(), and ins_ned_to_state().

+ Here is the caller graph for this function:

Variable Documentation

◆ ecef_speed_f

◆ ecef_speed_i

struct EcefCoor_i State::ecef_speed_i

◆ enu_speed_f

◆ enu_speed_i

◆ h_speed_dir_f

float State::h_speed_dir_f

Direction of horizontal ground speed.

Unit: rad (clockwise, zero=north)

Definition at line 354 of file state.h.

Referenced by stateCalcHorizontalSpeedDir_f(), stateCalcHorizontalSpeedDir_i(), and stateGetHorizontalSpeedDir_f().

◆ h_speed_dir_i

int32_t State::h_speed_dir_i

Direction of horizontal ground speed.

Unit: rad in BFP with INT32_ANGLE_FRAC (clockwise, zero=north)

Definition at line 325 of file state.h.

Referenced by stateCalcHorizontalSpeedDir_f(), stateCalcHorizontalSpeedDir_i(), and stateGetHorizontalSpeedDir_i().

◆ h_speed_norm_f

float State::h_speed_norm_f

Norm of horizontal ground speed.

Unit: m/s

Definition at line 348 of file state.h.

Referenced by stateCalcHorizontalSpeedNorm_f(), stateCalcHorizontalSpeedNorm_i(), and stateGetHorizontalSpeedNorm_f().

◆ h_speed_norm_i

uint32_t State::h_speed_norm_i

Norm of horizontal ground speed.

Unit: m/s in BFP with INT32_SPEED_FRAC

Definition at line 318 of file state.h.

Referenced by stateCalcHorizontalSpeedNorm_f(), stateCalcHorizontalSpeedNorm_i(), and stateGetHorizontalSpeedNorm_i().

◆ ned_speed_f

◆ ned_speed_i

◆ speed_input_filter

◆ speed_status