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