39 #define SAMPLES_NB 100
47 #ifndef AHRS_ALIGNER_IMU_ID
48 #define AHRS_ALIGNER_IMU_ID ABI_BROADCAST
53 uint32_t stamp __attribute__((unused)),
54 struct Int32Rates *gyro __attribute__((unused)))
61 #if PERIODIC_TELEMETRY
66 pprz_msg_send_FILTER_ALIGNER(trans, dev, AC_ID,
93 #if PERIODIC_TELEMETRY
98 #ifndef LOW_NOISE_THRESHOLD
99 #define LOW_NOISE_THRESHOLD 90000
102 #ifndef LOW_NOISE_TIME
103 #define LOW_NOISE_TIME 5
116 #ifdef AHRS_ALIGNER_LED
117 RunOnceEvery(50, {
LED_TOGGLE(AHRS_ALIGNER_LED);});
122 if (avg_ref_sensor >= 0) {
153 #ifdef AHRS_ALIGNER_LED
Event structure to store callbacks in a linked list.
#define RATES_SDIV(_ro, _ri, _s)
Interface to align the AHRS via low-passed measurements at startup.
#define VECT3_ADD(_a, _b)
#define LOW_NOISE_THRESHOLD
Generic transmission transport header.
#define RATES_ADD(_a, _b)
static struct Int32Vect3 mag_sum
Periodic telemetry system header (includes downlink utility and generated code).
#define INT_RATES_ZERO(_e)
Main include for ABI (AirBorneInterface).
#define AHRS_ALIGNER_RUNNING
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
struct Int32Rates lp_gyro
int32_t r
in rad/s with INT32_RATE_FRAC
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
static struct Int32Rates gyro_sum
struct AhrsAligner ahrs_aligner
Architecture independent timing functions.
struct Imu imu
global IMU state
#define AHRS_ALIGNER_LOCKED
#define VECT3_SDIV(_vo, _vi, _s)
#define DefaultPeriodic
Set default periodic telemetry.
#define AHRS_ALIGNER_IMU_ID
struct Int32Vect3 lp_accel
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
Inertial Measurement Unit interface.
#define LOW_NOISE_TIME
Number of cycles (100 samples each) with low noise.
static const struct usb_device_descriptor dev
#define INT_VECT3_ZERO(_v)
int32_t p
in rad/s with INT32_RATE_FRAC
arch independent LED (Light Emitting Diodes) API
#define ABI_BROADCAST
Broadcast address.
static int32_t ref_sensor_samples[SAMPLES_NB]
void ahrs_aligner_init(void)
int32_t q
in rad/s with INT32_RATE_FRAC
void ahrs_aligner_run(void)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
static uint32_t samples_idx
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
static struct Int32Vect3 accel_sum