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;
int32_t psi
in rad with INT32_ANGLE_FRAC
static void ahrs_int_get_quat_from_accel_mag(struct Int32Quat *q, struct Int32Vect3 *accel, struct Int32Vect3 *mag)
int32_t theta
in rad with INT32_ANGLE_FRAC
Utility functions for floating point AHRS implementations.
#define PPRZ_ITRIG_SIN(_s, _a)
#define INT32_ANGLE_NORMALIZE(_a)
#define QUAT_BFP_OF_REAL(_qi, _qf)
static void ahrs_float_get_quat_from_accel_mag(struct FloatQuat *q, struct Int32Vect3 *accel, struct Int32Vect3 *mag)
static void ahrs_int_get_quat_from_accel(struct Int32Quat *q, struct Int32Vect3 *accel)
#define ANGLE_BFP_OF_REAL(_af)
static void ahrs_int_get_euler_from_accel_mag(struct Int32Eulers *e, struct Int32Vect3 *accel, struct Int32Vect3 *mag)
static void ahrs_float_get_quat_from_accel(struct FloatQuat *q, struct Int32Vect3 *accel)
Compute a quaternion representing roll and pitch from an accelerometer measurement.
int32_t phi
in rad with INT32_ANGLE_FRAC
#define INT_MULT_RSHIFT(_a, _b, _r)
#define PPRZ_ITRIG_COS(_c, _a)
Paparazzi fixed point algebra.