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
70 pprz_msg_send_FILTER_ALIGNER(trans,
dev, AC_ID,
91 #if PERIODIC_TELEMETRY
107 #ifndef LOW_NOISE_THRESHOLD
108 #define LOW_NOISE_THRESHOLD 90000
111 #ifndef LOW_NOISE_TIME
112 #define LOW_NOISE_TIME 5
122 if(gyro == NULL || accel == NULL)
133 #ifdef AHRS_ALIGNER_LED
134 RunOnceEvery(50, {
LED_TOGGLE(AHRS_ALIGNER_LED);});
139 if (avg_ref_sensor >= 0) {
170 #ifdef AHRS_ALIGNER_LED
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
static int32_t ref_sensor_samples[AHRS_ALIGNER_SAMPLES_NB]
#define AHRS_ALIGNER_SAMPLES_NB
static struct Int32Vect3 mag_sum
void ahrs_aligner_init(void)
static void gyro_cb(uint8_t sender_id, uint32_t stamp, struct Int32Rates *gyro)
static uint32_t samples_idx
struct AhrsAligner ahrs_aligner
static struct Int32Vect3 accel_sum
void ahrs_aligner_restart(void)
void ahrs_aligner_run(void)
static void send_aligner(struct transport_tx *trans, struct link_device *dev)
#define LOW_NOISE_THRESHOLD
#define AHRS_ALIGNER_IMU_ID
static struct Int32Rates gyro_sum
#define LOW_NOISE_TIME
Number of cycles (100 samples each) with low noise.
Interface to align the AHRS via low-passed measurements at startup.
#define AHRS_ALIGNER_LOCKED
#define AHRS_ALIGNER_RUNNING
struct Int32Rates lp_gyro
struct Int32Vect3 lp_accel
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define VECT3_SDIV(_vo, _vi, _s)
#define RATES_ADD(_a, _b)
#define VECT3_ADD(_a, _b)
#define RATES_SDIV(_ro, _ri, _s)
int32_t p
in rad/s with INT32_RATE_FRAC
int32_t r
in rad/s with INT32_RATE_FRAC
int32_t q
in rad/s with INT32_RATE_FRAC
#define INT_RATES_ZERO(_e)
#define INT_VECT3_ZERO(_v)
struct imu_accel_t * imu_get_accel(uint8_t sender_id, bool create)
Find or create the accel in the imu structure.
struct imu_gyro_t * imu_get_gyro(uint8_t sender_id, bool create)
Find or create the gyro in the imu structure.
struct imu_mag_t * imu_get_mag(uint8_t sender_id, bool create)
Find or create the mag in the imu structure.
Inertial Measurement Unit interface.
struct Int32Rates scaled
Last scaled values in body frame.
struct Int32Vect3 scaled
Last scaled values in body frame.
struct Int32Vect3 scaled
Last scaled values in body frame.
arch independent LED (Light Emitting Diodes) API
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.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.