Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
imu.h File Reference
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_orientation_conversion.h"
#include "generated/airframe.h"
+ Include dependency graph for imu.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...
 

Detailed Description

Inertial Measurement Unit interface.

Definition in file imu.h.


Data Structure Documentation

◆ Imu

struct Imu

abstract IMU interface providing fixed point interface

Definition at line 37 of file imu.h.

+ Collaboration diagram for 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

Macro Definition Documentation

◆ IMU_ACCEL_X_NEUTRAL

#define IMU_ACCEL_X_NEUTRAL   0

Definition at line 90 of file imu.h.

◆ IMU_ACCEL_X_SIGN

#define IMU_ACCEL_X_SIGN   1

Definition at line 107 of file imu.h.

◆ IMU_ACCEL_Y_NEUTRAL

#define IMU_ACCEL_Y_NEUTRAL   0

Definition at line 91 of file imu.h.

◆ IMU_ACCEL_Y_SIGN

#define IMU_ACCEL_Y_SIGN   1

Definition at line 108 of file imu.h.

◆ IMU_ACCEL_Z_NEUTRAL

#define IMU_ACCEL_Z_NEUTRAL   0

Definition at line 92 of file imu.h.

◆ IMU_ACCEL_Z_SIGN

#define IMU_ACCEL_Z_SIGN   1

Definition at line 109 of file imu.h.

◆ IMU_BODY_TO_IMU_PHI

#define IMU_BODY_TO_IMU_PHI   0

Definition at line 78 of file imu.h.

◆ IMU_BODY_TO_IMU_PSI

#define IMU_BODY_TO_IMU_PSI   0

Definition at line 80 of file imu.h.

◆ IMU_BODY_TO_IMU_THETA

#define IMU_BODY_TO_IMU_THETA   0

Definition at line 79 of file imu.h.

◆ IMU_GYRO_P_NEUTRAL

#define IMU_GYRO_P_NEUTRAL   0

Definition at line 84 of file imu.h.

◆ IMU_GYRO_P_SIGN

#define IMU_GYRO_P_SIGN   1

Definition at line 102 of file imu.h.

◆ IMU_GYRO_Q_NEUTRAL

#define IMU_GYRO_Q_NEUTRAL   0

Definition at line 85 of file imu.h.

◆ IMU_GYRO_Q_SIGN

#define IMU_GYRO_Q_SIGN   1

Definition at line 103 of file imu.h.

◆ IMU_GYRO_R_NEUTRAL

#define IMU_GYRO_R_NEUTRAL   0

Definition at line 86 of file imu.h.

◆ IMU_GYRO_R_SIGN

#define IMU_GYRO_R_SIGN   1

Definition at line 104 of file imu.h.

◆ IMU_MAG_X_NEUTRAL

#define IMU_MAG_X_NEUTRAL   0

Definition at line 96 of file imu.h.

◆ IMU_MAG_X_SIGN

#define IMU_MAG_X_SIGN   1

Definition at line 112 of file imu.h.

◆ IMU_MAG_Y_NEUTRAL

#define IMU_MAG_Y_NEUTRAL   0

Definition at line 97 of file imu.h.

◆ IMU_MAG_Y_SIGN

#define IMU_MAG_Y_SIGN   1

Definition at line 113 of file imu.h.

◆ IMU_MAG_Z_NEUTRAL

#define IMU_MAG_Z_NEUTRAL   0

Definition at line 98 of file imu.h.

◆ IMU_MAG_Z_SIGN

#define IMU_MAG_Z_SIGN   1

Definition at line 114 of file imu.h.

Function Documentation

◆ imu_init()

◆ imu_ResetBodyToImu()

void imu_ResetBodyToImu ( float  reset)

◆ imu_scale_accel()

◆ imu_scale_gyro()

◆ imu_scale_mag()

◆ imu_SetBodyToImuCurrent()

◆ imu_SetBodyToImuPhi()

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.

+ Here is the call graph for this function:

◆ imu_SetBodyToImuPsi()

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.

+ Here is the call graph for this function:

◆ imu_SetBodyToImuTheta()

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.

+ Here is the call graph for this function:

Variable Documentation

◆ imu