40 #if PERIODIC_TELEMETRY
51 if (t_diff > 50000) { mde = 5; }
59 #ifndef AHRS_DCM_IMU_ID
60 #define AHRS_DCM_IMU_ID ABI_BROADCAST
66 #ifndef AHRS_DCM_MAG_ID
67 #define AHRS_DCM_MAG_ID AHRS_DCM_IMU_ID
73 #ifndef AHRS_DCM_GPS_ID
74 #define AHRS_DCM_GPS_ID GPS_MULTI_ID
91 #if USE_AUTO_AHRS_FREQ || !defined(AHRS_PROPAGATE_FREQUENCY)
96 float dt = (float)(stamp - last_stamp) * 1e-6;
102 PRINT_CONFIG_MSG(
"Using fixed AHRS_PROPAGATE_FREQUENCY for AHRS dcm propagation.")
113 uint32_t stamp __attribute__((unused)),
124 uint32_t stamp __attribute__((unused)),
135 uint32_t stamp __attribute__((unused)),
155 uint32_t stamp __attribute__((unused)),
193 #if PERIODIC_TELEMETRY
Main include for ABI (AirBorneInterface).
#define ABI_BROADCAST
Broadcast address.
Event structure to store callbacks in a linked list.
void ahrs_dcm_propagate(struct FloatRates *gyro, float dt)
void ahrs_dcm_update_gps(struct GpsState *gps_s UNUSED)
void ahrs_dcm_update_mag(struct FloatVect3 *mag)
void ahrs_dcm_update_accel(struct FloatVect3 *accel)
struct AhrsFloatDCM ahrs_dcm
bool ahrs_dcm_align(struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel, struct FloatVect3 *lp_mag)
struct FloatRates body_rate
struct FloatEulers ltp_to_body_euler
void ahrs_dcm_wrapper_init(void)
void ahrs_float_dcm_wrapper_enable(uint8_t enable)
static void gps_cb(uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s)
static abi_event accel_ev
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
static void mag_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *mag)
#define AHRS_DCM_GPS_ID
ABI binding for gps data.
#define AHRS_DCM_IMU_ID
ABI binding for IMU data.
static abi_event aligner_ev
static void send_filter_status(struct transport_tx *trans, struct link_device *dev)
static uint32_t ahrs_dcm_last_stamp
static uint8_t ahrs_dcm_id
static void accel_cb(uint8_t sender_id, uint32_t stamp, struct Int32Vect3 *accel)
static void aligner_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *lp_gyro, struct Int32Vect3 *lp_accel, struct Int32Vect3 *lp_mag)
#define AHRS_DCM_MAG_ID
ABI binding for magnetometer data.
static void set_body_orientation_and_rates(void)
Compute body orientation and rates from imu orientation and rates.
Paparazzi specific wrapper to run floating point DCM filter.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
data structure for GPS information
#define float_rmat_of_eulers
#define MAGS_FLOAT_OF_BFP(_ef, _ei)
#define RATES_FLOAT_OF_BFP(_rf, _ri)
#define ACCELS_FLOAT_OF_BFP(_ef, _ei)
static void stateSetNedToBodyRMat_f(uint16_t id, struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
void stateSetInputFilter(uint8_t type, uint16_t flag)
set the input filter for a specified type of data.
static void stateSetBodyRates_f(uint16_t id, struct FloatRates *body_rate)
Set vehicle body angular rate (float).
#define AHRS_PROPAGATE_FREQUENCY
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
Architecture independent timing functions.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.