Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
imu.h File Reference

Inertial Measurement Unit interface. More...

#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "generated/airframe.h"
+ Include dependency graph for imu.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Imu
 abstract IMU interface providing fixed point interface More...
 
struct  ImuFloat
 abstract IMU interface providing floating 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 ImuScaleGyro(_imu)
 
#define ImuScaleAccel(_imu)
 
#define ImuScaleMag(_imu)
 

Functions

void imu_impl_init (void)
 
void imu_periodic (void)
 
void imu_float_init (struct ImuFloat *imuf)
 
void imu_init (void)
 

Variables

struct Imu imu
 global IMU state More...
 

Detailed Description

Inertial Measurement Unit interface.

Definition in file imu.h.

Macro Definition Documentation

#define IMU_ACCEL_X_NEUTRAL   0

Definition at line 93 of file imu.h.

#define IMU_ACCEL_Y_NEUTRAL   0

Definition at line 94 of file imu.h.

#define IMU_ACCEL_Z_NEUTRAL   0

Definition at line 95 of file imu.h.

#define IMU_BODY_TO_IMU_PHI   0

Definition at line 81 of file imu.h.

Referenced by ahrs_init(), imu_float_init(), and imu_init().

#define IMU_BODY_TO_IMU_PSI   0

Definition at line 83 of file imu.h.

Referenced by ahrs_init(), imu_float_init(), and imu_init().

#define IMU_BODY_TO_IMU_THETA   0

Definition at line 82 of file imu.h.

Referenced by ahrs_init(), imu_float_init(), and imu_init().

#define IMU_GYRO_P_NEUTRAL   0

Definition at line 87 of file imu.h.

#define IMU_GYRO_Q_NEUTRAL   0

Definition at line 88 of file imu.h.

#define IMU_GYRO_R_NEUTRAL   0

Definition at line 89 of file imu.h.

#define ImuScaleAccel (   _imu)
Value:
{ \
VECT3_COPY(_imu.accel_prev, _imu.accel); \
_imu.accel.x = ((_imu.accel_unscaled.x - _imu.accel_neutral.x)*IMU_ACCEL_X_SIGN*IMU_ACCEL_X_SENS_NUM)/IMU_ACCEL_X_SENS_DEN; \
_imu.accel.y = ((_imu.accel_unscaled.y - _imu.accel_neutral.y)*IMU_ACCEL_Y_SIGN*IMU_ACCEL_Y_SENS_NUM)/IMU_ACCEL_Y_SENS_DEN; \
_imu.accel.z = ((_imu.accel_unscaled.z - _imu.accel_neutral.z)*IMU_ACCEL_Z_SIGN*IMU_ACCEL_Z_SENS_NUM)/IMU_ACCEL_Z_SENS_DEN; \
}
#define IMU_ACCEL_X_SIGN
Definition: imu_navgo.h:38
#define IMU_ACCEL_X_SENS_DEN
Definition: imu_umarim.h:80
#define IMU_ACCEL_X_SENS_NUM
Definition: imu_umarim.h:79
#define IMU_ACCEL_Z_SENS_NUM
Definition: imu_umarim.h:85
#define IMU_ACCEL_Y_SENS_NUM
Definition: imu_umarim.h:82
#define IMU_ACCEL_Z_SENS_DEN
Definition: imu_umarim.h:86
#define IMU_ACCEL_Z_SIGN
Definition: imu_navgo.h:40
#define VECT3_COPY(_a, _b)
Definition: pprz_algebra.h:113
#define IMU_ACCEL_Y_SIGN
Definition: imu_navgo.h:39
#define IMU_ACCEL_Y_SENS_DEN
Definition: imu_umarim.h:83

Definition at line 110 of file imu.h.

#define ImuScaleGyro (   _imu)
Value:
{ \
RATES_COPY(_imu.gyro_prev, _imu.gyro); \
_imu.gyro.p = ((_imu.gyro_unscaled.p - _imu.gyro_neutral.p)*IMU_GYRO_P_SIGN*IMU_GYRO_P_SENS_NUM)/IMU_GYRO_P_SENS_DEN; \
_imu.gyro.q = ((_imu.gyro_unscaled.q - _imu.gyro_neutral.q)*IMU_GYRO_Q_SIGN*IMU_GYRO_Q_SENS_NUM)/IMU_GYRO_Q_SENS_DEN; \
_imu.gyro.r = ((_imu.gyro_unscaled.r - _imu.gyro_neutral.r)*IMU_GYRO_R_SIGN*IMU_GYRO_R_SENS_NUM)/IMU_GYRO_R_SENS_DEN; \
}
#define IMU_GYRO_Q_SIGN
Definition: imu_navgo.h:34
#define RATES_COPY(_a, _b)
Definition: pprz_algebra.h:303
#define IMU_GYRO_R_SIGN
Definition: imu_navgo.h:35
#define IMU_GYRO_R_SENS_DEN
Definition: imu_umarim.h:57
#define IMU_GYRO_P_SENS_NUM
Definition: imu_umarim.h:50
#define IMU_GYRO_Q_SENS_DEN
Definition: imu_umarim.h:54
#define IMU_GYRO_P_SENS_DEN
Definition: imu_umarim.h:51
#define IMU_GYRO_R_SENS_NUM
Definition: imu_umarim.h:56
#define IMU_GYRO_P_SIGN
Definition: imu_navgo.h:33
#define IMU_GYRO_Q_SENS_NUM
Definition: imu_umarim.h:53

Definition at line 100 of file imu.h.

#define ImuScaleMag (   _imu)
Value:
{ \
_imu.mag.x = ((_imu.mag_unscaled.x - _imu.mag_neutral.x) * IMU_MAG_X_SIGN * IMU_MAG_X_SENS_NUM) / IMU_MAG_X_SENS_DEN; \
_imu.mag.y = ((_imu.mag_unscaled.y - _imu.mag_neutral.y) * IMU_MAG_Y_SIGN * IMU_MAG_Y_SENS_NUM) / IMU_MAG_Y_SENS_DEN; \
_imu.mag.z = ((_imu.mag_unscaled.z - _imu.mag_neutral.z) * IMU_MAG_Z_SIGN * IMU_MAG_Z_SENS_NUM) / IMU_MAG_Z_SENS_DEN; \
}
#define IMU_MAG_X_SIGN
Definition: imu_navgo.h:43
#define IMU_MAG_Z_SIGN
Definition: imu_navgo.h:45
#define IMU_MAG_Y_SIGN
Definition: imu_navgo.h:44

Definition at line 128 of file imu.h.

Function Documentation

void imu_impl_init ( void  )

Definition at line 59 of file imu_navgo.c.

References ImuNps::accel_available, ImuAspirin::accel_available, adc_buf_channel(), ADS8344_available, ADXL345_ADDR, ADXL345_FULL_RES, adxl345_init(), ADXL345_RANGE_16G, ADXL345_RATE_100, ADXL345_RATE_50, ADXL345_REG_BW_RATE, ADXL345_REG_DATA_FORMAT, ADXL345_REG_POWER_CTL, ami601_init(), analog_imu_adc_buf, analog_imu_available, aspirin2_mpu60x0, Aspirin2StatusUninit, AspirinStatusUninit, i2c_transaction::buf, FALSE, GPIO_ARCH_SET_SPI_CS_HIGH, ImuNps::gyro_available, ImuAspirin::gyro_available_blaaa, HMC5843_ADDR, hmc5843_init(), HMC5843_REG_CFGA, HMC5843_REG_CFGB, HMC5843_REG_MODE, hmc58xx_init(), i2c_submit(), ImuAspirin::i2c_trans_gyro, I2CTransFailed, I2CTransPending, I2CTransTx, I2CTransTxRx, imu_aspirin, imu_aspirin2, imu_aspirin_arch_init(), imu_b2_arch_init(), imu_crista_arch_init(), imu_nps, imu_overrun, ImuAspirin2::imu_rx_buf, ImuAspirin2::imu_spi_data_received, ImuAspirin2::imu_tx_buf, ITG3200_ADDR, itg3200_init(), ITG3200_REG_DLPF_FS, ITG3200_REG_GYRO_XOUT_H, ITG3200_REG_INT_CFG, ITG3200_REG_PWR_MGM, ITG3200_REG_SMPLRT_DIV, i2c_transaction::len_r, i2c_transaction::len_w, ImuNps::mag_available, ImuAspirin::mag_available, max1168_init(), MPU60X0_ADDR, MPU60X0_REG_ACCEL_CONFIG, MPU60X0_REG_CONFIG, MPU60X0_REG_GYRO_CONFIG, MPU60X0_REG_PWR_MGMT_1, MPU60X0_REG_SMPLRT_DIV, ms2100_init(), ppzuavimu_adxl345, ppzuavimu_hmc5843, ppzuavimu_itg3200, i2c_transaction::slave_addr, i2c_transaction::status, ImuAspirin2::status, ImuAspirin::status, and i2c_transaction::type.

Referenced by imu_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation