Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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).
static void stateSetSpeedEnu_i (uint16_t id, struct EnuCoor_i *enu_speed)
 Set ground speed in local ENU coordinates (int).
static void stateSetSpeedEcef_i (uint16_t id, struct EcefCoor_i *ecef_speed)
 Set ground speed in ECEF coordinates (int).
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).
static void stateSetSpeedNed_f (uint16_t id, struct NedCoor_f *ned_speed)
 Set ground speed in local NED coordinates (float).
static void stateSetSpeedEnu_f (uint16_t id, struct EnuCoor_f *enu_speed)
 Set ground speed in local ENU coordinates (float).
static void stateSetSpeedEcef_f (uint16_t id, struct EcefCoor_f *ecef_speed)
 Set ground speed in ECEF coordinates (float).
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).
static struct NedCoor_i * stateGetSpeedNed_i (void)
 Get ground speed in local NED coordinates (int).
static struct EnuCoor_i * stateGetSpeedEnu_i (void)
 Get ground speed in local ENU coordinates (int).
static struct EcefCoor_i * stateGetSpeedEcef_i (void)
 Get ground speed in ECEF coordinates (int).
static uint32_t stateGetHorizontalSpeedNorm_i (void)
 Get norm of horizontal ground speed (int).
static int32_t stateGetHorizontalSpeedDir_i (void)
 Get dir of horizontal ground speed (int).
static struct NedCoor_f * stateGetSpeedNed_f (void)
 Get ground speed in local NED coordinates (float).
static struct EnuCoor_f * stateGetSpeedEnu_f (void)
 Get ground speed in local ENU coordinates (float).
static struct EcefCoor_f * stateGetSpeedEcef_f (void)
 Get ground speed in ECEF coordinates (float).
static float stateGetHorizontalSpeedNorm_f (void)
 Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f (void)
 Get dir of horizontal ground speed (float).
static struct Int32Vect3 * stateGetAccelBody_i (void)
 Get acceleration in Body coordinates (int).

Variables

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

Detailed Description

Macro Definition Documentation

◆ SPEED_ECEF_F

◆ SPEED_ECEF_I

◆ SPEED_ENU_F

◆ SPEED_ENU_I

◆ SPEED_HDIR_F

#define SPEED_HDIR_F   9

◆ SPEED_HDIR_I

#define SPEED_HDIR_I   4

◆ SPEED_HNORM_F

#define SPEED_HNORM_F   8

◆ SPEED_HNORM_I

#define SPEED_HNORM_I   3

◆ 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.

Referenced by stateSetLocalOrigin_i(), and stateSetLocalUtmOrigin_f().

◆ SPEED_NED_F

◆ SPEED_NED_I

Function Documentation

◆ stateCalcHorizontalSpeedDir_f()

void stateCalcHorizontalSpeedDir_f ( void )

Definition at line 1185 of file state.c.

References SPEED_ENU_F, SPEED_ENU_I, SPEED_FLOAT_OF_BFP, SPEED_HDIR_F, SPEED_HDIR_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_FLOAT_OF_BFP, and state.

Referenced by stateGetHorizontalSpeedDir_f().

Here is the caller graph for this function:

◆ stateCalcHorizontalSpeedDir_i()

void stateCalcHorizontalSpeedDir_i ( void )

Definition at line 1002 of file state.c.

References int32_atan2(), INT32_COURSE_NORMALIZE, SPEED_BFP_OF_REAL, SPEED_ENU_F, SPEED_ENU_I, SPEED_HDIR_F, SPEED_HDIR_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_BFP_OF_REAL, and state.

Referenced by stateGetHorizontalSpeedDir_i().

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

◆ stateCalcHorizontalSpeedNorm_f()

void stateCalcHorizontalSpeedNorm_f ( void )

Definition at line 1158 of file state.c.

References FLOAT_VECT2_NORM, SPEED_ENU_F, SPEED_ENU_I, SPEED_FLOAT_OF_BFP, SPEED_HNORM_F, SPEED_HNORM_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_FLOAT_OF_BFP, and state.

Referenced by stateGetHorizontalSpeedNorm_f().

Here is the caller graph for this function:

◆ stateCalcHorizontalSpeedNorm_i()

void stateCalcHorizontalSpeedNorm_i ( void )

Definition at line 956 of file state.c.

References FLOAT_VECT2_NORM, INT32_SPEED_FRAC, int32_sqrt(), ned_of_ecef_vect_f(), ned_of_ecef_vect_i(), SPEED_BFP_OF_REAL, SPEED_ECEF_F, SPEED_ECEF_I, SPEED_ENU_F, SPEED_ENU_I, SPEED_HNORM_F, SPEED_HNORM_I, SPEED_NED_F, SPEED_NED_I, and state.

Referenced by stateGetHorizontalSpeedNorm_i().

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

◆ stateCalcSpeedEcef_f()

void stateCalcSpeedEcef_f ( void )

Definition at line 1133 of file state.c.

References ecef_of_ned_vect_f(), SPEED_ECEF_F, SPEED_ECEF_I, SPEED_NED_F, SPEED_NED_I, 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 931 of file state.c.

References ecef_of_ned_vect_i(), SPEED_ECEF_F, SPEED_ECEF_I, SPEED_NED_F, SPEED_NED_I, 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()

void stateCalcSpeedEnu_f ( void )

Definition at line 1083 of file state.c.

References enu_of_ecef_vect_f(), SPEED_ECEF_F, SPEED_ECEF_I, SPEED_ENU_F, SPEED_ENU_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_FLOAT_OF_BFP, state, and VECT3_ENU_OF_NED.

Referenced by stateGetSpeedEnu_f().

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

◆ stateCalcSpeedEnu_i()

void stateCalcSpeedEnu_i ( void )

Definition at line 879 of file state.c.

References enu_of_ecef_vect_i(), INT32_VECT3_ENU_OF_NED, SPEED_ECEF_F, SPEED_ECEF_I, SPEED_ENU_F, SPEED_ENU_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_BFP_OF_REAL, and state.

Referenced by stateGetSpeedEnu_i().

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

◆ stateCalcSpeedNed_f()

void stateCalcSpeedNed_f ( void )

Definition at line 1033 of file state.c.

References ned_of_ecef_vect_f(), SPEED_ECEF_F, SPEED_ECEF_I, SPEED_ENU_F, SPEED_ENU_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_FLOAT_OF_BFP, state, and VECT3_NED_OF_ENU.

Referenced by stateGetSpeedNed_f().

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

◆ stateCalcSpeedNed_i()

void stateCalcSpeedNed_i ( void )

Definition at line 829 of file state.c.

References INT32_VECT3_NED_OF_ENU, ned_of_ecef_vect_i(), SPEED_ECEF_F, SPEED_ECEF_I, SPEED_ENU_F, SPEED_ENU_I, SPEED_NED_F, SPEED_NED_I, SPEEDS_BFP_OF_REAL, and state.

Referenced by stateGetSpeedNed_i().

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

◆ stateGetAccelBody_i()

struct Int32Vect3 * stateGetAccelBody_i ( void )
inlinestatic

◆ stateGetHorizontalSpeedDir_f()

float stateGetHorizontalSpeedDir_f ( void )
inlinestatic

◆ stateGetHorizontalSpeedDir_i()

int32_t stateGetHorizontalSpeedDir_i ( void )
inlinestatic

Get dir of horizontal ground speed (int).

Definition at line 1051 of file state.h.

References SPEED_HDIR_I, 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()

uint32_t stateGetHorizontalSpeedNorm_i ( void )
inlinestatic

Get norm of horizontal ground speed (int).

Definition at line 1042 of file state.h.

References SPEED_HNORM_I, 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()

struct EcefCoor_f * stateGetSpeedEcef_f ( void )
inlinestatic

Get ground speed in ECEF coordinates (float).

Definition at line 1078 of file state.h.

References SPEED_ECEF_F, state, and stateCalcSpeedEcef_f().

Here is the call graph for this function:

◆ stateGetSpeedEcef_i()

struct EcefCoor_i * stateGetSpeedEcef_i ( void )
inlinestatic

Get ground speed in ECEF coordinates (int).

Definition at line 1033 of file state.h.

References SPEED_ECEF_I, state, and stateCalcSpeedEcef_i().

Here is the call graph for this function:

◆ stateGetSpeedEnu_f()

◆ stateGetSpeedEnu_i()

struct EnuCoor_i * stateGetSpeedEnu_i ( void )
inlinestatic

Get ground speed in local ENU coordinates (int).

Definition at line 1024 of file state.h.

References SPEED_ENU_I, 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()

◆ stateSetSpeed_f()

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

Set multiple speed coordinates (float).

Definition at line 988 of file state.h.

References SPEED_ECEF_F, SPEED_ENU_F, SPEED_NED_F, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeed_i()

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

Set multiple speed coordinates (int).

Definition at line 933 of file state.h.

References SPEED_ECEF_I, SPEED_ENU_I, SPEED_NED_I, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEcef_f()

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

Set ground speed in ECEF coordinates (float).

Definition at line 978 of file state.h.

References SPEED_ECEF_F, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEcef_i()

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

Set ground speed in ECEF coordinates (int).

Definition at line 923 of file state.h.

References SPEED_ECEF_I, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEnu_f()

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

Set ground speed in local ENU coordinates (float).

Definition at line 968 of file state.h.

References SPEED_ENU_F, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedEnu_i()

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

Set ground speed in local ENU coordinates (int).

Definition at line 913 of file state.h.

References SPEED_ENU_I, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

◆ stateSetSpeedNed_f()

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

Set ground speed in local NED coordinates (float).

Definition at line 958 of file state.h.

References SPEED_NED_F, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

Referenced by ekf_run(), gps_cb(), gps_cb(), 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()

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

Set ground speed in local NED coordinates (int).

Definition at line 903 of file state.h.

References SPEED_NED_I, state, STATE_CHECK_INPUT_AND_RETURN, and VECT3_COPY.

Referenced by gps_cb(), gps_cb(), ins_ned_to_state(), and ins_ned_to_state().

Here is the caller graph for this function:

Variable Documentation

◆ ecef_speed_f

struct EcefCoor_f State::ecef_speed_f

Velocity in EarthCenteredEarthFixed coordinates.

Units: m/s

Definition at line 331 of file state.h.

◆ ecef_speed_i

struct EcefCoor_i State::ecef_speed_i

Velocity in EarthCenteredEarthFixed coordinates.

Units: m/s in BFP with INT32_SPEED_FRAC

Definition at line 300 of file state.h.

◆ enu_speed_f

struct EnuCoor_f State::enu_speed_f

Velocity in East North Up coordinates.

Units: m/s

Definition at line 342 of file state.h.

◆ enu_speed_i

struct EnuCoor_i State::enu_speed_i

Velocity in East North Up coordinates.

Units: m/s in BFP with INT32_SPEED_FRAC

Definition at line 312 of file state.h.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ ned_speed_f

struct NedCoor_f State::ned_speed_f

speed in North East Down coordinates

Units: m/s

Definition at line 336 of file state.h.

◆ ned_speed_i

struct NedCoor_i State::ned_speed_i

Velocity in North East Down coordinates.

Units: m/s in BFP with INT32_SPEED_FRAC

Definition at line 306 of file state.h.

◆ speed_input_filter

uint16_t State::speed_input_filter

Holds the input filter id for speed.

Definition at line 294 of file state.h.

◆ speed_status

uint16_t State::speed_status

Holds the status bits for all ground speed representations.

When the corresponding bit is one the representation is already computed.

Definition at line 289 of file state.h.