Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "subsystems/ahrs.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_orientation_conversion.h"
Go to the source code of this file.
Data Structures | |
struct | AhrsMadgwick |
Madgwick filter structure. More... | |
Functions | |
void | ahrs_madgwick_init (void) |
void | ahrs_madgwick_set_body_to_imu_quat (struct FloatQuat *q_b2i) |
void | ahrs_madgwick_align (struct FloatRates *lp_gyro, struct FloatVect3 *lp_accel) |
void | ahrs_madgwick_propagate (struct FloatRates *gyro, float dt) |
void | ahrs_madgwick_update_accel (struct FloatVect3 *accel) |
Variables | |
struct AhrsMadgwick | ahrs_madgwick |
AHRS using Madgwick implementation
See: https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/
Definition in file ahrs_madgwick.h.
struct AhrsMadgwick |
Madgwick filter structure.
Definition at line 38 of file ahrs_madgwick.h.
Data Fields | ||
---|---|---|
struct FloatVect3 | accel | Measured accelerometers. |
struct FloatRates | bias | Gyro bias (from alignment) |
struct OrientationReps | body_to_imu | body_to_imu rotation |
bool | is_aligned | aligned flag |
struct FloatQuat | quat | Estimated attitude (quaternion) |
struct FloatRates | rates | Measured gyro rates. |
bool | reset | flag to request reset/reinit the filter |
void ahrs_madgwick_align | ( | struct FloatRates * | lp_gyro, |
struct FloatVect3 * | lp_accel | ||
) |
Definition at line 59 of file ahrs_madgwick.c.
References ahrs_float_get_quat_from_accel(), ahrs_madgwick, AhrsMadgwick::bias, AhrsMadgwick::is_aligned, and AhrsMadgwick::quat.
Referenced by aligner_cb().
void ahrs_madgwick_init | ( | void | ) |
Definition at line 50 of file ahrs_madgwick.c.
References ahrs_madgwick, init_state(), AhrsMadgwick::is_aligned, and AhrsMadgwick::reset.
Referenced by ahrs_madgwick_register().
void ahrs_madgwick_propagate | ( | struct FloatRates * | gyro, |
float | dt | ||
) |
Definition at line 69 of file ahrs_madgwick.c.
References AhrsMadgwick::accel, ahrs_madgwick, AHRS_MADGWICK_BETA, AhrsMadgwick::bias, AhrsMadgwick::body_to_imu, f, float_quat_derivative(), float_quat_normalize(), float_rmat_transp_ratemult(), float_vect3_norm(), init_state(), AhrsMadgwick::is_aligned, orientationGetRMat_f(), FloatQuat::qi, AhrsMadgwick::quat, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, AhrsMadgwick::rates, RATES_DIFF, AhrsMadgwick::reset, logger_uart_parse::s1, logger_uart_parse::s2, logger_uart_parse::s3, VECT3_SDIV, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by gyro_cb().
void ahrs_madgwick_set_body_to_imu_quat | ( | struct FloatQuat * | q_b2i | ) |
Definition at line 147 of file ahrs_madgwick.c.
References ahrs_madgwick, AhrsMadgwick::body_to_imu, AhrsMadgwick::is_aligned, orientationSetQuat_f(), and AhrsMadgwick::quat.
Referenced by body_to_imu_cb().
void ahrs_madgwick_update_accel | ( | struct FloatVect3 * | accel | ) |
Definition at line 142 of file ahrs_madgwick.c.
References AhrsMadgwick::accel, and ahrs_madgwick.
Referenced by accel_cb().
struct AhrsMadgwick ahrs_madgwick |
Definition at line 39 of file ahrs_madgwick.c.
Referenced by accel_cb(), ahrs_madgwick_align(), ahrs_madgwick_init(), ahrs_madgwick_propagate(), ahrs_madgwick_set_body_to_imu_quat(), ahrs_madgwick_update_accel(), aligner_cb(), compute_body_orientation_and_rates(), gyro_cb(), init_state(), send_att(), and send_filter_status().