Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_orientation_conversion.h"
#include "generated/airframe.h"
Go to the source code of this file.
Data Structures | |
struct | Imu |
abstract IMU interface providing fixed point interface More... | |
Macros | |
#define | IMU_BODY_TO_IMU_PHI 0 |
#define | IMU_BODY_TO_IMU_THETA 0 |
#define | IMU_BODY_TO_IMU_PSI 0 |
#define | IMU_GYRO_P_NEUTRAL 0 |
#define | IMU_GYRO_Q_NEUTRAL 0 |
#define | IMU_GYRO_R_NEUTRAL 0 |
#define | IMU_ACCEL_X_NEUTRAL 0 |
#define | IMU_ACCEL_Y_NEUTRAL 0 |
#define | IMU_ACCEL_Z_NEUTRAL 0 |
#define | IMU_MAG_X_NEUTRAL 0 |
#define | IMU_MAG_Y_NEUTRAL 0 |
#define | IMU_MAG_Z_NEUTRAL 0 |
#define | IMU_GYRO_P_SIGN 1 |
#define | IMU_GYRO_Q_SIGN 1 |
#define | IMU_GYRO_R_SIGN 1 |
#define | IMU_ACCEL_X_SIGN 1 |
#define | IMU_ACCEL_Y_SIGN 1 |
#define | IMU_ACCEL_Z_SIGN 1 |
#define | IMU_MAG_X_SIGN 1 |
#define | IMU_MAG_Y_SIGN 1 |
#define | IMU_MAG_Z_SIGN 1 |
Functions | |
void | imu_init (void) |
void | imu_SetBodyToImuPhi (float phi) |
void | imu_SetBodyToImuTheta (float theta) |
void | imu_SetBodyToImuPsi (float psi) |
void | imu_SetBodyToImuCurrent (float set) |
void | imu_ResetBodyToImu (float reset) |
void | imu_scale_gyro (struct Imu *_imu) |
void | imu_scale_accel (struct Imu *_imu) |
void | imu_scale_mag (struct Imu *_imu) |
Variables | |
struct Imu | imu |
global IMU state More... | |
Inertial Measurement Unit interface.
Definition in file imu.h.
struct Imu |
Data Fields | ||
---|---|---|
struct Int32Vect3 | accel | accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC |
struct Int32Vect3 | accel_neutral | static accelerometer bias from calibration in raw/unscaled units |
struct Int32Vect3 | accel_prev | previous accelerometer measurements |
struct Int32Vect3 | accel_unscaled | unscaled accelerometer measurements |
bool | b2i_set_current |
flag for adjusting body_to_imu via settings. if FALSE, reset to airframe values, if TRUE set current roll/pitch |
struct OrientationReps | body_to_imu | rotation from body to imu frame |
struct Int32Rates | gyro | gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC |
struct Int32Rates | gyro_neutral | static gyroscope bias from calibration in raw/unscaled units |
struct Int32Rates | gyro_prev | previous gyroscope measurements |
struct Int32Rates | gyro_unscaled | unscaled gyroscope measurements |
struct Int32Vect3 | mag | magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC |
struct Int32Vect3 | mag_neutral | magnetometer neutral readings (bias) in raw/unscaled units |
struct Int32Vect3 | mag_unscaled | unscaled magnetometer measurements |
void imu_init | ( | void | ) |
Definition at line 110 of file imu.c.
References Imu::accel_neutral, Imu::body_to_imu, DefaultPeriodic, gpio_setup_output(), Imu::gyro_neutral, imu, IMU_ACCEL_X_NEUTRAL, IMU_ACCEL_Y_NEUTRAL, IMU_ACCEL_Z_NEUTRAL, IMU_BODY_TO_IMU_PHI, IMU_BODY_TO_IMU_PSI, IMU_BODY_TO_IMU_THETA, IMU_GYRO_P_NEUTRAL, IMU_GYRO_Q_NEUTRAL, IMU_GYRO_R_NEUTRAL, IMU_MAG_X_NEUTRAL, IMU_MAG_Y_NEUTRAL, IMU_MAG_Z_NEUTRAL, IMU_POWER_GPIO, INT_VECT3_ZERO, Imu::mag_neutral, orientationSetEulers_f(), RATES_ASSIGN, register_periodic_telemetry(), send_accel(), send_accel_raw(), send_accel_scaled(), send_gyro(), send_gyro_raw(), send_gyro_scaled(), send_mag(), send_mag_raw(), send_mag_scaled(), and VECT3_ASSIGN.
void imu_ResetBodyToImu | ( | float | reset | ) |
void imu_scale_accel | ( | struct Imu * | _imu | ) |
Definition at line 44 of file imu_vectornav.c.
References Imu::accel, Imu::accel_neutral, Imu::accel_prev, Imu::accel_unscaled, IMU_ACCEL_X_SENS_DEN, IMU_ACCEL_X_SENS_NUM, IMU_ACCEL_X_SIGN, IMU_ACCEL_Y_SENS_DEN, IMU_ACCEL_Y_SENS_NUM, IMU_ACCEL_Y_SIGN, IMU_ACCEL_Z_SENS_DEN, IMU_ACCEL_Z_SENS_NUM, IMU_ACCEL_Z_SIGN, VECT3_COPY, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.
Referenced by handle_ins_msg(), imu_analog_periodic(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_bmi088_event(), imu_disco_event(), imu_drotek2_event(), imu_gl1_event(), imu_hbmini_event(), imu_krooz_periodic(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4_event(), imu_px4fmu_event(), imu_swing_event(), imu_umarim_event(), and navdata_publish_imu().
void imu_scale_gyro | ( | struct Imu * | _imu | ) |
Definition at line 43 of file imu_vectornav.c.
References Imu::gyro, Imu::gyro_neutral, Imu::gyro_prev, Imu::gyro_unscaled, IMU_GYRO_P_SENS_DEN, IMU_GYRO_P_SENS_NUM, IMU_GYRO_P_SIGN, IMU_GYRO_Q_SENS_DEN, IMU_GYRO_Q_SENS_NUM, IMU_GYRO_Q_SIGN, IMU_GYRO_R_SENS_DEN, IMU_GYRO_R_SENS_NUM, IMU_GYRO_R_SIGN, Int32Rates::p, Int32Rates::q, Int32Rates::r, and RATES_COPY.
Referenced by handle_ins_msg(), imu_analog_periodic(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_bmi088_event(), imu_disco_event(), imu_drotek2_event(), imu_gl1_event(), imu_hbmini_event(), imu_krooz_periodic(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4_event(), imu_px4fmu_event(), imu_swing_event(), imu_umarim_event(), and navdata_publish_imu().
void imu_scale_mag | ( | struct Imu * | _imu | ) |
Definition at line 352 of file ahrs_gx3.c.
References IMU_MAG_X_SENS_DEN, IMU_MAG_X_SENS_NUM, IMU_MAG_X_SIGN, IMU_MAG_Y_SENS_DEN, IMU_MAG_Y_SENS_NUM, IMU_MAG_Y_SIGN, IMU_MAG_Z_SENS_DEN, IMU_MAG_Z_SENS_NUM, IMU_MAG_Z_SIGN, Imu::mag, Imu::mag_neutral, Imu::mag_unscaled, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.
Referenced by handle_ins_msg(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_bebop_event(), imu_disco_event(), imu_drotek2_event(), imu_gl1_event(), imu_hbmini_event(), imu_krooz_event(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4_event(), imu_px4fmu_event(), mag_hmc58xx_module_event(), mag_ist8310_module_event(), mag_lis3mdl_module_event(), mag_pitot_parse_msg(), and navdata_publish_imu().
void imu_SetBodyToImuCurrent | ( | float | set | ) |
Definition at line 178 of file imu.c.
References Imu::b2i_set_current, Imu::body_to_imu, imu, IMU_BODY_TO_IMU_PHI, IMU_BODY_TO_IMU_PSI, IMU_BODY_TO_IMU_THETA, orientationGetEulers_f(), orientationGetQuat_f(), orientationSetEulers_f(), FloatEulers::phi, stateGetNedToBodyEulers_f(), stateIsAttitudeValid(), and FloatEulers::theta.
void imu_SetBodyToImuPhi | ( | float | phi | ) |
Definition at line 151 of file imu.c.
References Imu::body_to_imu, imu, orientationGetEulers_f(), orientationGetQuat_f(), orientationSetEulers_f(), and FloatEulers::phi.
void imu_SetBodyToImuPsi | ( | float | psi | ) |
Definition at line 169 of file imu.c.
References Imu::body_to_imu, imu, orientationGetEulers_f(), orientationGetQuat_f(), orientationSetEulers_f(), and FloatEulers::psi.
void imu_SetBodyToImuTheta | ( | float | theta | ) |
Definition at line 160 of file imu.c.
References Imu::body_to_imu, imu, orientationGetEulers_f(), orientationGetQuat_f(), orientationSetEulers_f(), and FloatEulers::theta.
struct Imu imu |
global IMU state
Definition at line 108 of file imu.c.
Referenced by ahrs_aligner_run(), ahrs_gx3_init(), ahrs_gx3_publish_imu(), direct_memory_logger_periodic(), gx3_packet_read_message(), handle_ins_msg(), high_speed_logger_spi_link_periodic(), imu_analog_periodic(), imu_apogee_downlink_raw(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_bmi088_event(), imu_disco_event(), imu_drotek2_event(), imu_feed_gyro_accel(), imu_feed_mag(), imu_gl1_event(), imu_hbmini_downlink_raw(), imu_hbmini_event(), imu_init(), imu_krooz_downlink_raw(), imu_krooz_event(), imu_krooz_periodic(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_downlink_raw(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4_event(), imu_px4fmu_event(), imu_quality_assessment_periodic(), imu_SetBodyToImuCurrent(), imu_SetBodyToImuPhi(), imu_SetBodyToImuPsi(), imu_SetBodyToImuTheta(), imu_swing_event(), imu_um6_publish(), imu_umarim_downlink_raw(), imu_umarim_event(), imu_vectornav_propagate(), init_ap(), ins_int_propagate(), jevois_mavlink_filter_init(), jevois_mavlink_filter_periodic(), logger_uart_periodic(), mag_calib_ukf_run(), mag_hmc58xx_module_event(), mag_ist8310_module_event(), mag_lis3mdl_module_event(), mag_pitot_parse_msg(), mag_pitot_raw_downlink(), main_init(), navdata_publish_imu(), send_accel(), send_accel_raw(), send_accel_scaled(), send_aligner(), send_gyro(), send_gyro_raw(), send_gyro_scaled(), send_imu_mag_current(), send_mag(), send_mag_raw(), send_mag_scaled(), UM6_packet_read_message(), and wind_estimator_periodic().