Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
state.h File Reference

API to get/set the generic vehicle states. More...

#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_geodetic_int.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_orientation_conversion.h"
#include "std.h"
#include <string.h>
+ Include dependency graph for state.h:

Go to the source code of this file.

Data Structures

struct  State
 Structure holding vehicle state data. More...
 

Macros

#define POS_ECEF_I   0
 
#define POS_NED_I   1
 
#define POS_ENU_I   2
 
#define POS_LLA_I   3
 
#define POS_UTM_I   4
 
#define POS_ECEF_F   5
 
#define POS_NED_F   6
 
#define POS_ENU_F   7
 
#define POS_LLA_F   8
 
#define POS_UTM_F   9
 
#define POS_LOCAL_COORD   ((1<<POS_NED_I)|(1<<POS_NED_F)|(1<<POS_ENU_I)|(1<<POS_ENU_F))
 
#define POS_GLOBAL_COORD   ((1<<POS_ECEF_I)|(1<<POS_ECEF_F)|(1<<POS_LLA_I)|(1<<POS_LLA_F)|(1<<POS_UTM_I)|(1<<POS_UTM_F))
 
#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))
 
#define ACCEL_ECEF_I   0
 
#define ACCEL_NED_I   1
 
#define ACCEL_ECEF_F   2
 
#define ACCEL_NED_F   3
 
#define RATE_I   0
 
#define RATE_F   1
 
#define WINDSPEED_I   0
 
#define AIRSPEED_I   1
 
#define WINDSPEED_F   2
 
#define AIRSPEED_F   3
 
#define AOA_F   4
 
#define SIDESLIP_F   5
 

Functions

void stateInit (void)
 
static void stateSetLocalOrigin_i (struct LtpDef_i *ltp_def)
 Set the local (flat earth) coordinate frame origin (int). More...
 
static void stateSetLocalUtmOrigin_f (struct UtmCoor_f *utm_def)
 Set the local (flat earth) coordinate frame origin from UTM (float). More...
 
void stateCalcPositionEcef_i (void)
 
void stateCalcPositionNed_i (void)
 
void stateCalcPositionEnu_i (void)
 
void stateCalcPositionLla_i (void)
 
void stateCalcPositionUtm_f (void)
 
void stateCalcPositionEcef_f (void)
 
void stateCalcPositionNed_f (void)
 
void stateCalcPositionEnu_f (void)
 
void stateCalcPositionLla_f (void)
 
static bool_t stateIsLocalCoordinateValid (void)
 Test if local coordinates are valid. More...
 
static bool_t stateIsGlobalCoordinateValid (void)
 Test if global coordinates are valid. More...
 
static void stateSetPositionEcef_i (struct EcefCoor_i *ecef_pos)
 Set position from ECEF coordinates (int). More...
 
static void stateSetPositionNed_i (struct NedCoor_i *ned_pos)
 Set position from local NED coordinates (int). More...
 
static void stateSetPositionEnu_i (struct EnuCoor_i *enu_pos)
 Set position from local ENU coordinates (int). More...
 
static void stateSetPositionLla_i (struct LlaCoor_i *lla_pos)
 Set position from LLA coordinates (int). More...
 
static void stateSetPosition_i (struct EcefCoor_i *ecef_pos, struct NedCoor_i *ned_pos, struct EnuCoor_i *enu_pos, struct LlaCoor_i *lla_pos)
 Set multiple position coordinates (int). More...
 
static void stateSetPositionUtm_f (struct UtmCoor_f *utm_pos)
 Set position from UTM coordinates (float). More...
 
static void stateSetPositionEcef_f (struct EcefCoor_f *ecef_pos)
 Set position from ECEF coordinates (float). More...
 
static void stateSetPositionNed_f (struct NedCoor_f *ned_pos)
 Set position from local NED coordinates (float). More...
 
static void stateSetPositionEnu_f (struct EnuCoor_f *enu_pos)
 Set position from local ENU coordinates (float). More...
 
static void stateSetPositionLla_f (struct LlaCoor_f *lla_pos)
 Set position from LLA coordinates (float). More...
 
static void stateSetPosition_f (struct EcefCoor_f *ecef_pos, struct NedCoor_f *ned_pos, struct EnuCoor_f *enu_pos, struct LlaCoor_f *lla_pos, struct UtmCoor_f *utm_pos)
 Set multiple position coordinates (float). More...
 
static struct EcefCoor_istateGetPositionEcef_i (void)
 Get position in ECEF coordinates (int). More...
 
static struct NedCoor_istateGetPositionNed_i (void)
 Get position in local NED coordinates (int). More...
 
static struct EnuCoor_istateGetPositionEnu_i (void)
 Get position in local ENU coordinates (int). More...
 
static struct LlaCoor_istateGetPositionLla_i (void)
 Get position in LLA coordinates (int). More...
 
static struct UtmCoor_fstateGetPositionUtm_f (void)
 Get position in UTM coordinates (float). More...
 
static struct EcefCoor_fstateGetPositionEcef_f (void)
 Get position in ECEF coordinates (float). More...
 
static struct NedCoor_fstateGetPositionNed_f (void)
 Get position in local NED coordinates (float). More...
 
static struct EnuCoor_fstateGetPositionEnu_f (void)
 Get position in local ENU coordinates (float). More...
 
static struct LlaCoor_fstateGetPositionLla_f (void)
 Get position in LLA coordinates (float). More...
 
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 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 int32_tstateGetHorizontalSpeedNorm_i (void)
 Get norm of horizontal ground speed (int). More...
 
static int32_tstateGetHorizontalSpeedDir_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...
 
void stateCalcAccelNed_i (void)
 
void stateCalcAccelEcef_i (void)
 
void stateCalcAccelNed_f (void)
 
void stateCalcAccelEcef_f (void)
 
static bool_t stateIsAccelValid (void)
 Test if accelerations are valid. More...
 
static void stateSetAccelNed_i (struct NedCoor_i *ned_accel)
 Set acceleration in NED coordinates (int). More...
 
static void stateSetAccelEcef_i (struct EcefCoor_i *ecef_accel)
 Set acceleration in ECEF coordinates (int). More...
 
static void stateSetAccelNed_f (struct NedCoor_f *ned_accel)
 Set acceleration in NED coordinates (float). More...
 
static void stateSetAccelEcef_f (struct EcefCoor_f *ecef_accel)
 Set acceleration in ECEF coordinates (float). More...
 
static struct NedCoor_istateGetAccelNed_i (void)
 Get acceleration in NED coordinates (int). More...
 
static struct EcefCoor_istateGetAccelEcef_i (void)
 Get acceleration in ECEF coordinates (int). More...
 
static struct NedCoor_fstateGetAccelNed_f (void)
 Get acceleration in NED coordinates (float). More...
 
static struct EcefCoor_fstateGetAccelEcef_f (void)
 Get acceleration in ECEF coordinates (float). More...
 
static bool_t stateIsAttitudeValid (void)
 Test if attitudes are valid. More...
 
static void stateSetNedToBodyQuat_i (struct Int32Quat *ned_to_body_quat)
 Set vehicle body attitude from quaternion (int). More...
 
static void stateSetNedToBodyRMat_i (struct Int32RMat *ned_to_body_rmat)
 Set vehicle body attitude from rotation matrix (int). More...
 
static void stateSetNedToBodyEulers_i (struct Int32Eulers *ned_to_body_eulers)
 Set vehicle body attitude from euler angles (int). More...
 
static void stateSetNedToBodyQuat_f (struct FloatQuat *ned_to_body_quat)
 Set vehicle body attitude from quaternion (float). More...
 
static void stateSetNedToBodyRMat_f (struct FloatRMat *ned_to_body_rmat)
 Set vehicle body attitude from rotation matrix (float). More...
 
static void stateSetNedToBodyEulers_f (struct FloatEulers *ned_to_body_eulers)
 Set vehicle body attitude from euler angles (float). More...
 
static struct Int32QuatstateGetNedToBodyQuat_i (void)
 Get vehicle body attitude quaternion (int). More...
 
static struct Int32RMatstateGetNedToBodyRMat_i (void)
 Get vehicle body attitude rotation matrix (int). More...
 
static struct Int32EulersstateGetNedToBodyEulers_i (void)
 Get vehicle body attitude euler angles (int). More...
 
static struct FloatQuatstateGetNedToBodyQuat_f (void)
 Get vehicle body attitude quaternion (float). More...
 
static struct FloatRMatstateGetNedToBodyRMat_f (void)
 Get vehicle body attitude rotation matrix (float). More...
 
static struct FloatEulersstateGetNedToBodyEulers_f (void)
 Get vehicle body attitude euler angles (float). More...
 
void stateCalcBodyRates_i (void)
 
void stateCalcBodyRates_f (void)
 
static bool_t stateIsRateValid (void)
 Test if rates are valid. More...
 
static void stateSetBodyRates_i (struct Int32Rates *body_rate)
 Set vehicle body angular rate (int). More...
 
static void stateSetBodyRates_f (struct FloatRates *body_rate)
 Set vehicle body angular rate (float). More...
 
static struct Int32RatesstateGetBodyRates_i (void)
 Get vehicle body angular rate (int). More...
 
static struct FloatRatesstateGetBodyRates_f (void)
 Get vehicle body angular rate (float). More...
 
void stateCalcHorizontalWindspeed_i (void)
 
void stateCalcAirspeed_i (void)
 
void stateCalcHorizontalWindspeed_f (void)
 
void stateCalcAirspeed_f (void)
 
static bool_t stateIsWindspeedValid (void)
 test if wind speed is available. More...
 
static bool_t stateIsAirspeedValid (void)
 test if air speed is available. More...
 
static bool_t stateIsAngleOfAttackValid (void)
 test if angle of attack is available. More...
 
static bool_t stateIsSideslipValid (void)
 test if sideslip is available. More...
 
static void stateSetHorizontalWindspeed_i (struct Int32Vect2 *h_windspeed)
 Set horizontal 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 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 int32_tstateGetAirspeed_i (void)
 Get airspeed (int). More...
 
static struct FloatVect2stateGetHorizontalWindspeed_f (void)
 Get horizontal 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

struct State state
 

Detailed Description

API to get/set the generic vehicle states.

Also see the State Interface page.

Author
Felix Ruess felix.nosp@m..rue.nosp@m.ss@gm.nosp@m.ail..nosp@m.com

Definition in file state.h.