30 #ifndef AHRS_INT_UTILS_H
31 #define AHRS_INT_UTILS_H
44 const float fphi = atan2f(-accel->
y, -accel->
z);
51 const float ftheta = atan2f(-cphi_ax, -accel->
z);
66 const int32_t mn = ctheta * mag->
x + sphi_stheta * mag->
y + cphi_stheta * mag->
z;
67 const int32_t me = 0 * mag->
x + cphi * mag->
y - sphi * mag->
z;
73 const float mag_dec = atan2(-AHRS_H_Y, AHRS_H_X);
74 const float fpsi = atan2f(-me, mn) - mag_dec;
Utility functions for floating point AHRS implementations.
static void ahrs_float_get_quat_from_accel_mag(struct FloatQuat *q, struct FloatVect3 *accel, struct FloatVect3 *mag)
static void ahrs_float_get_quat_from_accel(struct FloatQuat *q, struct FloatVect3 *accel)
Compute a quaternion representing roll and pitch from an accelerometer measurement.
static void ahrs_int_get_quat_from_accel(struct Int32Quat *q, struct Int32Vect3 *accel)
static void ahrs_int_get_quat_from_accel_mag(struct Int32Quat *q, struct Int32Vect3 *accel, struct Int32Vect3 *mag)
static void ahrs_int_get_euler_from_accel_mag(struct Int32Eulers *e, struct Int32Vect3 *accel, struct Int32Vect3 *mag)
#define MAGS_FLOAT_OF_BFP(_ef, _ei)
#define QUAT_BFP_OF_REAL(_qi, _qf)
#define ACCELS_FLOAT_OF_BFP(_ef, _ei)
int32_t phi
in rad with INT32_ANGLE_FRAC
int32_t psi
in rad with INT32_ANGLE_FRAC
int32_t theta
in rad with INT32_ANGLE_FRAC
#define INT_MULT_RSHIFT(_a, _b, _r)
#define ANGLE_BFP_OF_REAL(_af)
#define INT32_ANGLE_NORMALIZE(_a)
Paparazzi fixed point algebra.
#define PPRZ_ITRIG_SIN(_s, _a)
#define PPRZ_ITRIG_COS(_c, _a)
int int32_t
Typedef defining 32 bit int type.