Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Inertial Measurement Unit interface. More...
Go to the source code of this file.
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 WEAK | imu_periodic (void) |
optional. More... | |
void WEAK | imu_scale_gyro (struct Imu *_imu) |
void WEAK | imu_scale_accel (struct Imu *_imu) |
void WEAK | imu_scale_mag (struct Imu *_imu) |
Variables | |
struct Imu | imu |
global IMU state More... | |
Inertial Measurement Unit interface.
Definition in file imu.c.
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_impl_init(), IMU_POWER_GPIO, INT_VECT3_ZERO, Imu::mag_neutral, orientationSetEulers_f(), RATES_ASSIGN, register_periodic_telemetry(), and VECT3_ASSIGN.
Referenced by init_ap(), and main_init().
void WEAK imu_periodic | ( | void | ) |
optional.
If not provided by implementation, empty function is used
optional.
Read the MPU60x0 every periodic call and the HMC58XX every 10th call.
Definition at line 209 of file imu.c.
References imu_apogee, ImuApogee::mpu, and mpu60x0_i2c_periodic().
void WEAK imu_scale_accel | ( | struct Imu * | _imu | ) |
Definition at line 224 of file imu.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.
void WEAK imu_scale_gyro | ( | struct Imu * | _imu | ) |
Definition at line 213 of file imu.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.
void WEAK imu_scale_mag | ( | struct Imu * | _imu | ) |
Definition at line 251 of file imu.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.
void imu_SetBodyToImuCurrent | ( | float | set | ) |
Definition at line 179 of file imu.c.
References Imu::b2i_set_current, Imu::body_to_imu, FALSE, 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 152 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 170 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 161 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 imu_init(), imu_SetBodyToImuCurrent(), imu_SetBodyToImuPhi(), imu_SetBodyToImuPsi(), and imu_SetBodyToImuTheta().