32 #ifndef AHRS_DCM_OUTPUT_ENABLED
33 #define AHRS_DCM_OUTPUT_ENABLED TRUE
44 #if PERIODIC_TELEMETRY
55 if (t_diff > 50000) { mde = 5; }
56 pprz_msg_send_STATE_FILTER_STATUS(trans, dev, AC_ID, &
ahrs_dcm_id, &mde, &val);
63 #ifndef AHRS_DCM_IMU_ID
64 #define AHRS_DCM_IMU_ID ABI_BROADCAST
70 #ifndef AHRS_DCM_MAG_ID
71 #define AHRS_DCM_MAG_ID AHRS_DCM_IMU_ID
85 ahrs_dcm_last_stamp = stamp;
86 #if USE_AUTO_AHRS_FREQ || !defined(AHRS_PROPAGATE_FREQUENCY)
91 float dt = (float)(stamp - last_stamp) * 1e-6;
97 PRINT_CONFIG_MSG(
"Using fixed AHRS_PROPAGATE_FREQUENCY for AHRS dcm propagation.")
108 uint32_t stamp __attribute__((unused)),
117 uint32_t stamp __attribute__((unused)),
126 uint32_t stamp __attribute__((unused)),
144 uint32_t stamp __attribute__((unused)),
152 ahrs_dcm_output_enabled = enable;
161 if (ahrs_dcm_output_enabled) {
168 struct FloatRMat ltp_to_imu_rmat, ltp_to_body_rmat;
192 #if PERIODIC_TELEMETRY
#define AHRS_DCM_OUTPUT_ENABLED
Event structure to store callbacks in a linked list.
static void stateSetNedToBodyRMat_f(struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
bool_t ahrs_dcm_align(struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
static abi_event aligner_ev
Dispatcher to register actual AHRS implementations.
#define float_rmat_of_eulers
Generic transmission transport header.
#define AHRS_PROPAGATE_FREQUENCY
Periodic telemetry system header (includes downlink utility and generated code).
static void set_body_orientation_and_rates(void)
Compute body orientation and rates from imu orientation and rates.
static struct FloatRMat * orientationGetRMat_f(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (float).
Main include for ABI (AirBorneInterface).
void float_rmat_comp_inv(struct FloatRMat *m_a2b, struct FloatRMat *m_a2c, struct FloatRMat *m_b2c)
Composition (multiplication) of two rotation matrices.
static uint8_t ahrs_dcm_id
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
static bool_t ahrs_dcm_output_enabled
if TRUE with push the estimation results to the state interface
Paparazzi specific wrapper to run floating point DCM filter.
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct FloatEulers ltp_to_imu_euler
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
void ahrs_register_impl(AhrsEnableOutput enable)
Register an AHRS implementation.
Architecture independent timing functions.
data structure for GPS information
struct AhrsFloatDCM ahrs_dcm
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void ahrs_dcm_update_gps(struct GpsState *gps_s)
#define DefaultPeriodic
Set default periodic telemetry.
static abi_event body_to_imu_ev
void ahrs_dcm_update_mag(struct Int32Vect3 *mag)
#define AHRS_DCM_MAG_ID
ABI binding for magnetometer data.
static const struct usb_device_descriptor dev
struct OrientationReps body_to_imu
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
API to get/set the generic vehicle states.
void float_rmat_transp_ratemult(struct FloatRates *rb, struct FloatRMat *m_b2a, struct FloatRates *ra)
rotate anglular rates by transposed rotation matrix.
void ahrs_dcm_set_body_to_imu_quat(struct FloatQuat *q_b2i)
static uint32_t ahrs_dcm_last_stamp
static void body_to_imu_cb(uint8_t sender_id, struct FloatQuat *q_b2i_f)
#define ABI_BROADCAST
Broadcast address.
#define AHRS_DCM_IMU_ID
ABI binding for IMU data.
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
void ahrs_dcm_update_accel(struct Int32Vect3 *accel)
static void stateSetBodyRates_f(struct FloatRates *body_rate)
Set vehicle body angular rate (float).
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
static abi_event accel_ev
struct FloatRates imu_rate
static bool_t ahrs_dcm_enable_output(bool_t enable)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
void ahrs_dcm_propagate(struct Int32Rates *gyro, float dt)
void ahrs_dcm_register(void)