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