Paparazzi UAS  v5.18.0_stable
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 (struct NedCoor_i *ned_speed)
 Set ground speed in local NED coordinates (int). More...
 
static void stateSetSpeedEnu_i (struct EnuCoor_i *enu_speed)
 Set ground speed in local ENU coordinates (int). More...
 
static void stateSetSpeedEcef_i (struct EcefCoor_i *ecef_speed)
 Set ground speed in ECEF coordinates (int). More...
 
static void stateSetSpeed_i (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 (struct NedCoor_f *ned_speed)
 Set ground speed in local NED coordinates (float). More...
 
static void stateSetSpeedEnu_f (struct EnuCoor_f *enu_speed)
 Set ground speed in local ENU coordinates (float). More...
 
static void stateSetSpeedEcef_f (struct EcefCoor_f *ecef_speed)
 Set ground speed in ECEF coordinates (float). More...
 
static void stateSetSpeed_f (struct EcefCoor_f *ecef_speed, struct NedCoor_f *ned_speed, struct EnuCoor_f *enu_speed)
 Set multiple speed coordinates (float). More...
 
static void stateSetAccelBody_i (struct Int32Vect3 *body_accel)
 Set acceleration in Body coordinates (int). 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...
 
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 90 of file state.h.

◆ SPEED_ECEF_I

#define SPEED_ECEF_I   0

Definition at line 85 of file state.h.

◆ SPEED_ENU_F

#define SPEED_ENU_F   7

Definition at line 92 of file state.h.

◆ SPEED_ENU_I

#define SPEED_ENU_I   2

Definition at line 87 of file state.h.

◆ SPEED_HDIR_F

#define SPEED_HDIR_F   9

Definition at line 94 of file state.h.

◆ SPEED_HDIR_I

#define SPEED_HDIR_I   4

Definition at line 89 of file state.h.

◆ SPEED_HNORM_F

#define SPEED_HNORM_F   8

Definition at line 93 of file state.h.

◆ SPEED_HNORM_I

#define SPEED_HNORM_I   3

Definition at line 88 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 95 of file state.h.

◆ SPEED_NED_F

#define SPEED_NED_F   6

Definition at line 91 of file state.h.

◆ SPEED_NED_I

#define SPEED_NED_I   1

Definition at line 86 of file state.h.

Function Documentation

◆ stateCalcHorizontalSpeedDir_f()

◆ stateCalcHorizontalSpeedDir_i()

◆ stateCalcHorizontalSpeedNorm_f()

◆ stateCalcHorizontalSpeedNorm_i()

◆ stateCalcSpeedEcef_f()

void stateCalcSpeedEcef_f ( void  )

Definition at line 978 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 776 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

Get acceleration in Body coordinates (int).

Definition at line 953 of file state.h.

References State::body_accel_i, and state.

Referenced by guidance_indi_propagate_filters(), hff_propagate(), lms_estimation(), and logger_control_effectiveness_periodic().

+ Here is the caller graph for this function:

◆ 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 899 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 890 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 926 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 881 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 872 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(), nav_approaching_from(), and send_fp().

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

◆ stateGetSpeedNed_f()

static struct NedCoor_f* stateGetSpeedNed_f ( void  )
inlinestatic

Get ground speed in local NED coordinates (float).

Definition at line 908 of file state.h.

References State::ned_speed_f, SPEED_NED_F, State::speed_status, state, and stateCalcSpeedNed_f().

Referenced by autopilot_check_in_flight(), file_logger_write_row(), guidance_indi_run(), ins_alt_float_update_baro(), mavlink_send_global_position_int(), mavlink_send_local_position_ned(), mavlink_send_vfr_hud(), OA_update(), range_msg_callback(), and wind_estimator_periodic().

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

◆ stateGetSpeedNed_i()

static struct NedCoor_i* stateGetSpeedNed_i ( void  )
inlinestatic

◆ stateSetAccelBody_i()

static void stateSetAccelBody_i ( struct Int32Vect3 body_accel)
inlinestatic

Set acceleration in Body coordinates (int).

Definition at line 855 of file state.h.

References State::body_accel_i, state, and VECT3_COPY.

Referenced by accel_cb(), ins_ekf2_publish_attitude(), ins_float_invariant_propagate(), ins_int_propagate(), and ins_module_propagate().

+ Here is the caller graph for this function:

◆ stateSetSpeed_f()

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

Set multiple speed coordinates (float).

Definition at line 833 of file state.h.

References State::ecef_speed_f, State::enu_speed_f, State::ned_speed_f, SPEED_ECEF_F, SPEED_ENU_F, SPEED_NED_F, State::speed_status, state, and VECT3_COPY.

◆ stateSetSpeed_i()

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

Set multiple speed coordinates (int).

Definition at line 787 of file state.h.

References State::ecef_speed_i, State::enu_speed_i, State::ned_speed_i, SPEED_ECEF_I, SPEED_ENU_I, SPEED_NED_I, State::speed_status, state, and VECT3_COPY.

◆ stateSetSpeedEcef_f()

static void stateSetSpeedEcef_f ( struct EcefCoor_f ecef_speed)
inlinestatic

Set ground speed in ECEF coordinates (float).

Definition at line 825 of file state.h.

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

◆ stateSetSpeedEcef_i()

static void stateSetSpeedEcef_i ( struct EcefCoor_i ecef_speed)
inlinestatic

Set ground speed in ECEF coordinates (int).

Definition at line 779 of file state.h.

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

◆ stateSetSpeedEnu_f()

static void stateSetSpeedEnu_f ( struct EnuCoor_f enu_speed)
inlinestatic

Set ground speed in local ENU coordinates (float).

Definition at line 817 of file state.h.

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

◆ stateSetSpeedEnu_i()

static void stateSetSpeedEnu_i ( struct EnuCoor_i enu_speed)
inlinestatic

Set ground speed in local ENU coordinates (int).

Definition at line 771 of file state.h.

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

◆ stateSetSpeedNed_f()

static void stateSetSpeedNed_f ( struct NedCoor_f ned_speed)
inlinestatic

Set ground speed in local NED coordinates (float).

Definition at line 809 of file state.h.

References State::ned_speed_f, SPEED_NED_F, State::speed_status, state, and VECT3_COPY.

Referenced by gps_cb(), ins_alt_float_update_baro(), ins_alt_float_update_gps(), ins_ekf2_update(), ins_float_invariant_propagate(), ins_vectornav_propagate(), set_state_from_ins(), and sim_overwrite_ins().

+ Here is the caller graph for this function:

◆ stateSetSpeedNed_i()

static void stateSetSpeedNed_i ( struct NedCoor_i ned_speed)
inlinestatic

Set ground speed in local NED coordinates (int).

Definition at line 763 of file state.h.

References State::ned_speed_i, SPEED_NED_I, State::speed_status, state, 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 321 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 292 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 315 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 285 of file state.h.

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

◆ ned_speed_f

◆ ned_speed_i

◆ speed_status