32 #ifndef AHRS_ICE_OUTPUT_ENABLED
33 #define AHRS_ICE_OUTPUT_ENABLED TRUE
44 #if PERIODIC_TELEMETRY
51 pprz_msg_send_FILTER(trans, dev, AC_ID,
73 pprz_msg_send_AHRS_EULER_INT(trans, dev, AC_ID,
85 pprz_msg_send_AHRS_GYRO_BIAS_INT(trans, dev, AC_ID,
97 if (t_diff > 50000) { mde = 5; }
98 pprz_msg_send_STATE_FILTER_STATUS(trans, dev, AC_ID, &
ahrs_ice_id, &mde, &val);
105 #ifndef AHRS_ICE_IMU_ID
106 #define AHRS_ICE_IMU_ID ABI_BROADCAST
112 #ifndef AHRS_ICE_MAG_ID
113 #define AHRS_ICE_MAG_ID AHRS_ICE_IMU_ID
126 ahrs_ice_last_stamp = stamp;
134 uint32_t stamp __attribute__((unused)),
143 uint32_t stamp __attribute__((unused)),
152 uint32_t stamp __attribute__((unused)),
171 ahrs_ice_output_enabled = enable;
178 if (ahrs_ice_output_enabled) {
180 struct Int32RMat ltp_to_imu_rmat, ltp_to_body_rmat;
211 #if PERIODIC_TELEMETRY
int32_t psi
in rad with INT32_ANGLE_FRAC
Event structure to store callbacks in a linked list.
#define AHRS_ICE_IMU_ID
ABI binding for IMU data.
struct Int32Eulers ltp_to_imu_euler
static struct Int32RMat * orientationGetRMat_i(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (int).
void ahrs_ice_propagate(struct Int32Rates *gyro)
void ahrs_ice_register(void)
Dispatcher to register actual AHRS implementations.
static uint8_t ahrs_ice_id
Generic transmission transport header.
static uint32_t ahrs_ice_last_stamp
Periodic telemetry system header (includes downlink utility and generated code).
int32_t theta
in rad with INT32_ANGLE_FRAC
static bool_t ahrs_ice_output_enabled
if TRUE with push the estimation results to the state interface
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
void ahrs_ice_set_body_to_imu_quat(struct FloatQuat *q_b2i)
Main include for ABI (AirBorneInterface).
struct AhrsIntCmplEuler ahrs_ice
void ahrs_ice_update_mag(struct Int32Vect3 *mag)
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
int32_t r
in rad/s with INT32_RATE_FRAC
static abi_event body_to_imu_ev
static bool_t ahrs_ice_enable_output(bool_t enable)
void int32_rmat_comp_inv(struct Int32RMat *m_a2b, struct Int32RMat *m_a2c, struct Int32RMat *m_b2c)
Composition (multiplication) of two rotation matrices.
static abi_event aligner_ev
void ahrs_register_impl(AhrsEnableOutput enable)
Register an AHRS implementation.
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
Architecture independent timing functions.
#define AHRS_ICE_MAG_ID
ABI binding for magnetometer data.
#define DefaultPeriodic
Set default periodic telemetry.
struct Int32Eulers measure
#define AHRS_ICE_OUTPUT_ENABLED
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
struct Int32Eulers hi_res_euler
static void stateSetBodyRates_i(struct Int32Rates *body_rate)
Set vehicle body angular rate (int).
static const struct usb_device_descriptor dev
static abi_event accel_ev
bool_t ahrs_ice_align(struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
struct OrientationReps body_to_imu
int32_t phi
in rad with INT32_ANGLE_FRAC
API to get/set the generic vehicle states.
struct Int32Rates imu_rate
void ahrs_ice_update_accel(struct Int32Vect3 *accel)
int32_t p
in rad/s with INT32_RATE_FRAC
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
#define ABI_BROADCAST
Broadcast address.
Paparazzi specific wrapper to run floating point DCM filter.
static void set_body_state_from_euler(void)
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
void int32_rmat_transp_ratemult(struct Int32Rates *rb, struct Int32RMat *m_b2a, struct Int32Rates *ra)
rotate anglular rates by transposed rotation matrix.
struct Int32Rates gyro_bias
static void body_to_imu_cb(uint8_t sender_id, struct FloatQuat *q_b2i_f)
static void stateSetNedToBodyRMat_i(struct Int32RMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (int).
int32_t q
in rad/s with INT32_RATE_FRAC
#define int32_rmat_of_eulers
Rotation matrix from Euler angles.
struct Int32Eulers residual
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.