39 #ifndef AHRS_ALIGNER_SAMPLES_NB
40 #define AHRS_ALIGNER_SAMPLES_NB 100
49 #ifndef AHRS_ALIGNER_IMU_ID
50 #define AHRS_ALIGNER_IMU_ID ABI_BROADCAST
55 uint32_t stamp __attribute__((unused)),
56 struct Int32Rates *gyro __attribute__((unused)))
63 #if PERIODIC_TELEMETRY
68 pprz_msg_send_FILTER_ALIGNER(trans, dev, AC_ID,
95 #if PERIODIC_TELEMETRY
100 #ifndef LOW_NOISE_THRESHOLD
101 #define LOW_NOISE_THRESHOLD 90000
104 #ifndef LOW_NOISE_TIME
105 #define LOW_NOISE_TIME 5
118 #ifdef AHRS_ALIGNER_LED
119 RunOnceEvery(50, {
LED_TOGGLE(AHRS_ALIGNER_LED);});
124 if (avg_ref_sensor >= 0) {
155 #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
#define RATES_ADD(_a, _b)
static struct Int32Vect3 mag_sum
Periodic telemetry system header (includes downlink utility and generated code).
static void send_aligner(struct transport_tx *trans, struct link_device *dev)
#define INT_RATES_ZERO(_e)
Main include for ABI (AirBorneInterface).
struct Imu imu
global IMU state
#define AHRS_ALIGNER_RUNNING
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.
#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[AHRS_ALIGNER_SAMPLES_NB]
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void ahrs_aligner_init(void)
int32_t q
in rad/s with INT32_RATE_FRAC
#define AHRS_ALIGNER_SAMPLES_NB
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