77 #define POS_LOCAL_COORD ((1<<POS_NED_I)|(1<<POS_NED_F)|(1<<POS_ENU_I)|(1<<POS_ENU_F))
78 #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))
85 #define SPEED_ECEF_I 0
88 #define SPEED_HNORM_I 3
89 #define SPEED_HDIR_I 4
90 #define SPEED_ECEF_F 5
93 #define SPEED_HNORM_F 8
94 #define SPEED_HDIR_F 9
95 #define SPEED_LOCAL_COORD ((1<<SPEED_NED_I)|(1<<SPEED_ENU_I)|(1<<SPEED_NED_F)|(1<<SPEED_ENU_F))
102 #define ACCEL_ECEF_I 0
103 #define ACCEL_NED_I 1
104 #define ACCEL_ECEF_F 2
105 #define ACCEL_NED_F 3
120 #define WINDSPEED_I 0
123 #define WINDSPEED_F 3
563 if (ecef_pos != NULL) {
567 if (ned_pos != NULL) {
571 if (enu_pos != NULL) {
575 if (lla_pos != NULL) {
631 if (ecef_pos != NULL) {
635 if (ned_pos != NULL) {
639 if (enu_pos != NULL) {
643 if (lla_pos != NULL) {
647 if (utm_pos != NULL) {
794 if (ecef_speed != NULL) {
798 if (ned_speed != NULL) {
802 if (enu_speed != NULL) {
840 if (ecef_speed != NULL) {
844 if (ned_speed != NULL) {
848 if (enu_speed != NULL) {
static struct LtpDef_i ltp_def
#define RATES_COPY(_a, _b)
#define VECT2_COPY(_a, _b)
#define VECT3_COPY(_a, _b)
#define LLA_COPY(_pos1, _pos2)
struct Int32RMat ltp_of_ecef
Rotation matrix.
int32_t hmsl
Height above mean sea level in mm.
struct LlaCoor_i lla
Reference point in lla.
struct EcefCoor_i ecef
Reference point in ecef.
#define ECEF_FLOAT_OF_BFP(_o, _i)
#define HIGH_RES_RMAT_FLOAT_OF_BFP(_ef, _ei)
#define LLA_FLOAT_OF_BFP(_o, _i)
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates
static void orientationSetRMat_f(struct OrientationReps *orientation, struct FloatRMat *rmat)
Set vehicle body attitude from rotation matrix (float).
static void orientationSetQuat_f(struct OrientationReps *orientation, struct FloatQuat *quat)
Set vehicle body attitude from quaternion (float).
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).
static struct Int32RMat * orientationGetRMat_i(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (int).
static bool orienationCheckValid(struct OrientationReps *orientation)
Test if orientations are valid.
static void orientationSetEulers_f(struct OrientationReps *orientation, struct FloatEulers *eulers)
Set vehicle body attitude from euler angles (float).
static struct Int32Quat * orientationGetQuat_i(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (int).
static void orientationSetQuat_i(struct OrientationReps *orientation, struct Int32Quat *quat)
Set vehicle body attitude from quaternion (int).
static void orientationSetEulers_i(struct OrientationReps *orientation, struct Int32Eulers *eulers)
Set vehicle body attitude from euler angles (int).
static struct FloatEulers * orientationGetEulers_f(struct OrientationReps *orientation)
Get vehicle body attitude euler angles (float).
static void orientationSetRMat_i(struct OrientationReps *orientation, struct Int32RMat *rmat)
Set vehicle body attitude from rotation matrix (int).
static struct FloatRMat * orientationGetRMat_f(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (float).
static struct Int32Eulers * orientationGetEulers_i(struct OrientationReps *orientation)
Get vehicle body attitude euler angles (int).
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
struct EcefCoor_f ecef_accel_f
Acceleration in EarthCenteredEarthFixed coordinates.
struct Int32Vect3 body_accel_i
Acceleration in Body coordinates.
static void stateSetAccelNed_f(struct NedCoor_f *ned_accel)
Set acceleration in NED coordinates (float).
struct NedCoor_i ned_accel_i
Acceleration in North East Down coordinates.
static struct EcefCoor_f * stateGetAccelEcef_f(void)
Get acceleration in ECEF coordinates (float).
uint8_t accel_status
Holds the status bits for all acceleration representations.
static void stateSetAccelNed_i(struct NedCoor_i *ned_accel)
Set acceleration in NED coordinates (int).
void stateCalcAccelNed_i(void)
void stateCalcAccelEcef_i(void)
struct EcefCoor_i ecef_accel_i
Acceleration in EarthCenteredEarthFixed coordinates.
static bool stateIsAccelValid(void)
Test if accelerations are valid.
void stateCalcAccelEcef_f(void)
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
static void stateSetAccelEcef_f(struct EcefCoor_f *ecef_accel)
Set acceleration in ECEF coordinates (float).
static void stateSetAccelEcef_i(struct EcefCoor_i *ecef_accel)
Set acceleration in ECEF coordinates (int).
static struct EcefCoor_i * stateGetAccelEcef_i(void)
Get acceleration in ECEF coordinates (int).
struct NedCoor_f ned_accel_f
Acceleration in North East Down coordinates.
void stateCalcAccelNed_f(void)
static void stateSetNedToBodyQuat_f(struct FloatQuat *ned_to_body_quat)
Set vehicle body attitude from quaternion (float).
static void stateSetNedToBodyRMat_i(struct Int32RMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (int).
static struct Int32Quat * stateGetNedToBodyQuat_i(void)
Get vehicle body attitude quaternion (int).
static void stateSetNedToBodyQuat_i(struct Int32Quat *ned_to_body_quat)
Set vehicle body attitude from quaternion (int).
static void stateSetNedToBodyRMat_f(struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
static void stateSetNedToBodyEulers_i(struct Int32Eulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (int).
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
static bool stateIsAttitudeValid(void)
Test if attitudes are valid.
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
static void stateSetNedToBodyEulers_f(struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
struct OrientationReps ned_to_body_orientation
Structure holding vehicle state data.
struct NedCoor_i ned_pos_i
Position in North East Down coordinates.
static void stateSetPositionEcef_f(struct EcefCoor_f *ecef_pos)
Set position from ECEF coordinates (float).
struct NedCoor_f ned_pos_f
Position in North East Down coordinates.
struct EnuCoor_f enu_pos_f
Position in East North Up coordinates.
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).
struct UtmCoor_f utm_pos_f
Position in UTM coordinates.
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).
void stateCalcPositionNed_f(void)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
bool ned_initialized_f
True if local float coordinate frame is initialsed.
uint16_t pos_status
Holds the status bits for all position representations.
struct LlaCoor_i lla_pos_i
Position in Latitude, Longitude and Altitude.
void stateCalcPositionUtm_f(void)
void stateCalcPositionEnu_f(void)
struct EcefCoor_f ecef_pos_f
Position in EarthCenteredEarthFixed coordinates.
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
static void stateSetPositionEnu_f(struct EnuCoor_f *enu_pos)
Set position from local ENU coordinates (float).
static struct EcefCoor_i * stateGetPositionEcef_i(void)
Get position in ECEF coordinates (int).
static void stateSetPositionNed_i(struct NedCoor_i *ned_pos)
Set position from local NED coordinates (int).
bool utm_initialized_f
True if utm origin (float) coordinate frame is initialsed.
static void stateSetPositionEcef_i(struct EcefCoor_i *ecef_pos)
Set position from ECEF coordinates (int).
void stateCalcPositionEcef_f(void)
static void stateSetPositionEnu_i(struct EnuCoor_i *enu_pos)
Set position from local ENU coordinates (int).
struct EnuCoor_i enu_pos_i
Position in East North Up coordinates.
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
bool ned_initialized_i
true if local int coordinate frame is initialsed
static void stateSetPositionLla_f(struct LlaCoor_f *lla_pos)
Set position from LLA coordinates (float).
static void stateSetPositionNed_f(struct NedCoor_f *ned_pos)
Set position from local NED coordinates (float).
static bool stateIsGlobalCoordinateValid(void)
Test if global coordinates are valid.
float alt_agl_f
Altitude above ground level.
static void stateSetPositionLla_i(struct LlaCoor_i *lla_pos)
Set position from LLA coordinates (int).
void stateCalcPositionLla_f(void)
void stateCalcPositionEcef_i(void)
struct UtmCoor_f utm_origin_f
Definition of the origin of Utm coordinate system.
static struct EcefCoor_f * stateGetPositionEcef_f(void)
Get position in ECEF coordinates (float).
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
void stateCalcPositionNed_i(void)
static void stateSetPositionUtm_f(struct UtmCoor_f *utm_pos)
Set position from UTM coordinates (float).
static void stateSetLocalOrigin_i(struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
void stateCalcPositionLla_i(void)
Calculate LLA (int) from any other available representation.
static bool stateIsLocalCoordinateValid(void)
Test if local coordinates are valid.
static void stateSetLocalUtmOrigin_f(struct UtmCoor_f *utm_def)
Set the local (flat earth) coordinate frame origin from UTM (float).
struct LlaCoor_f lla_pos_f
Position in Latitude, Longitude and Altitude.
struct EcefCoor_i ecef_pos_i
Position in EarthCenteredEarthFixed coordinates.
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
void stateCalcPositionEnu_i(void)
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
static struct Int32Rates * stateGetBodyRates_i(void)
Get vehicle body angular rate (int).
void stateCalcBodyRates_f(void)
struct FloatRates body_rates_f
Angular rates in body frame.
static void stateSetBodyRates_f(struct FloatRates *body_rate)
Set vehicle body angular rate (float).
void stateCalcBodyRates_i(void)
struct Int32Rates body_rates_i
Angular rates in body frame.
uint8_t rate_status
Holds the status bits for all angular rate representations.
static void stateSetBodyRates_i(struct Int32Rates *body_rate)
Set vehicle body angular rate (int).
static bool stateIsRateValid(void)
Test if rates are valid.
static void stateSetSpeedEcef_i(struct EcefCoor_i *ecef_speed)
Set ground speed in ECEF coordinates (int).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static struct EnuCoor_i * stateGetSpeedEnu_i(void)
Get ground speed in local ENU coordinates (int).
static void stateSetAccelBody_i(struct Int32Vect3 *body_accel)
Set acceleration in Body coordinates (int).
void stateCalcSpeedEnu_f(void)
struct NedCoor_f ned_speed_f
speed in North East Down coordinates
void stateCalcSpeedNed_f(void)
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
void stateCalcHorizontalSpeedDir_i(void)
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
static void stateSetSpeedEcef_f(struct EcefCoor_f *ecef_speed)
Set ground speed in ECEF coordinates (float).
struct NedCoor_i ned_speed_i
Velocity in North East Down coordinates.
float h_speed_norm_f
Norm of horizontal ground speed.
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
int32_t h_speed_dir_i
Direction of horizontal ground speed.
float h_speed_dir_f
Direction of horizontal ground speed.
void stateCalcHorizontalSpeedNorm_f(void)
void stateCalcHorizontalSpeedNorm_i(void)
#define SPEED_LOCAL_COORD
static int32_t stateGetHorizontalSpeedDir_i(void)
Get dir of horizontal ground speed (int).
static void stateSetSpeedNed_i(struct NedCoor_i *ned_speed)
Set ground speed in local NED coordinates (int).
static void stateSetSpeed_i(struct EcefCoor_i *ecef_speed, struct NedCoor_i *ned_speed, struct EnuCoor_i *enu_speed)
Set multiple speed coordinates (int).
struct EcefCoor_f ecef_speed_f
Velocity in EarthCenteredEarthFixed coordinates.
void stateCalcSpeedEcef_f(void)
void stateCalcSpeedEnu_i(void)
static void stateSetSpeedEnu_f(struct EnuCoor_f *enu_speed)
Set ground speed in local ENU coordinates (float).
static void stateSetSpeed_f(struct EcefCoor_f *ecef_speed, struct NedCoor_f *ned_speed, struct EnuCoor_f *enu_speed)
Set multiple speed coordinates (float).
struct EcefCoor_i ecef_speed_i
Velocity in EarthCenteredEarthFixed coordinates.
static void stateSetSpeedEnu_i(struct EnuCoor_i *enu_speed)
Set ground speed in local ENU coordinates (int).
static struct EcefCoor_i * stateGetSpeedEcef_i(void)
Get ground speed in ECEF coordinates (int).
void stateCalcHorizontalSpeedDir_f(void)
struct EnuCoor_i enu_speed_i
Velocity in East North Up coordinates.
uint16_t speed_status
Holds the status bits for all ground speed representations.
static struct EcefCoor_f * stateGetSpeedEcef_f(void)
Get ground speed in ECEF coordinates (float).
static void stateSetSpeedNed_f(struct NedCoor_f *ned_speed)
Set ground speed in local NED coordinates (float).
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
void stateCalcSpeedNed_i(void)
static struct Int32Vect3 * stateGetAccelBody_i(void)
Get acceleration in Body coordinates (int).
uint32_t h_speed_norm_i
Norm of horizontal ground speed.
static uint32_t stateGetHorizontalSpeedNorm_i(void)
Get norm of horizontal ground speed (int).
struct EnuCoor_f enu_speed_f
Velocity in East North Up coordinates.
void stateCalcSpeedEcef_i(void)
static bool stateIsSideslipValid(void)
test if sideslip is available.
static struct Int32Vect3 * stateGetWindspeed_i(void)
Get windspeed (int).
static bool stateIsWindspeedValid(void)
test if wind speed is available.
static void stateSetAirspeed_i(int32_t airspeed)
Set airspeed (int).
int32_t airspeed_i
Norm of relative wind speed.
static void stateSetAngleOfAttack_f(float aoa)
Set angle of attack in radians (float).
static void stateSetVerticalWindspeed_i(int32_t v_windspeed)
Set vertical windspeed (int).
static struct Int32Vect2 * stateGetHorizontalWindspeed_i(void)
Get horizontal windspeed (int).
static void stateSetHorizontalWindspeed_f(struct FloatVect2 *h_windspeed)
Set horizontal windspeed (float).
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).
static void stateSetHorizontalWindspeed_i(struct Int32Vect2 *h_windspeed)
Set horizontal windspeed (int).
static float stateGetSideslip_f(void)
Get sideslip (float).
float airspeed_f
Norm of relative air speed.
static bool stateIsAirspeedValid(void)
test if air speed is available.
uint8_t wind_air_status
Holds the status bits for all wind- and airspeed representations.
static void stateSetSideslip_f(float sideslip)
Set sideslip angle in radians (float).
void stateCalcAirspeed_i(void)
union State::@354 windspeed_f
Horizontal windspeed.
union State::@353 windspeed_i
Horizontal windspeed in north/east/down.
void stateCalcVerticalWindspeed_i(void)
static float stateGetAirspeed_f(void)
Get airspeed (float).
static float stateGetVerticalWindspeed_i(void)
Get vertical windspeed (int).
static float stateGetAngleOfAttack_f(void)
Get angle of attack (float).
void stateCalcAirspeed_f(void)
float sideslip_f
Sideslip angle Unit: rad.
void stateCalcHorizontalWindspeed_f(void)
static void stateSetVerticalWindspeed_f(float v_windspeed)
Set vertical windspeed (float).
static float stateGetVerticalWindspeed_f(void)
Get vertical windspeed (float).
static int32_t stateGetAirspeed_i(void)
Get airspeed (int).
void stateCalcHorizontalWindspeed_i(void)
float angle_of_attack_f
Angle of attack Unit: rad.
static bool stateIsAngleOfAttackValid(void)
test if angle of attack is available.
void stateCalcVerticalWindspeed_f(void)
static struct FloatVect3 * stateGetWindspeed_f(void)
Get windspeed (float).
static bool stateIsVerticalWindspeedValid(void)
test if vertical wind speed is available.
static struct FloatVect2 * stateGetHorizontalWindspeed_f(void)
Get horizontal windspeed (float).
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
Paparazzi floating point math for geodetic calculations.
float hmsl
Height above mean sea level in meters.
struct FloatRMat ltp_of_ecef
rotation from ECEF to local frame
struct EcefCoor_f ecef
origin of local frame in ECEF
struct LlaCoor_f lla
origin of local frame in LLA
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates Units: meters
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates Units: meters
position in UTM coordinates Units: meters
Paparazzi fixed point math for geodetic calculations.
Generic orientation representation and conversions.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.