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_nps.h File Reference
#include "subsystems/imu.h"
#include "generated/airframe.h"
+ Include dependency graph for imu_nps.h:

Go to the source code of this file.

Data Structures

struct  ImuNps
 

Macros

#define IMU_GYRO_P_SENS   4.359
 we just define some defaults for aspirin v1.5 for now More...
 
#define IMU_GYRO_P_SENS_NUM   4359
 
#define IMU_GYRO_P_SENS_DEN   1000
 
#define IMU_GYRO_Q_SENS   4.359
 
#define IMU_GYRO_Q_SENS_NUM   4359
 
#define IMU_GYRO_Q_SENS_DEN   1000
 
#define IMU_GYRO_R_SENS   4.359
 
#define IMU_GYRO_R_SENS_NUM   4359
 
#define IMU_GYRO_R_SENS_DEN   1000
 
#define IMU_ACCEL_X_SENS   37.91
 we just define some defaults for aspirin v1.5 for now More...
 
#define IMU_ACCEL_X_SENS_NUM   3791
 
#define IMU_ACCEL_X_SENS_DEN   100
 
#define IMU_ACCEL_Y_SENS   37.91
 
#define IMU_ACCEL_Y_SENS_NUM   3791
 
#define IMU_ACCEL_Y_SENS_DEN   100
 
#define IMU_ACCEL_Z_SENS   39.24
 
#define IMU_ACCEL_Z_SENS_NUM   3924
 
#define IMU_ACCEL_Z_SENS_DEN   100
 
#define ImuMagEvent(_mag_handler)
 
#define ImuEvent(_gyro_handler, _accel_handler, _mag_handler)
 
#define ImuScaleGyro(_imu)
 
#define ImuScaleAccel(_imu)
 
#define ImuScaleMag(_imu)
 

Functions

void imu_feed_gyro_accel (void)
 
void imu_feed_mag (void)
 

Variables

struct ImuNps imu_nps
 

Macro Definition Documentation

#define IMU_ACCEL_X_SENS   37.91

we just define some defaults for aspirin v1.5 for now

Definition at line 47 of file imu_nps.h.

#define IMU_ACCEL_X_SENS_DEN   100

Definition at line 49 of file imu_nps.h.

#define IMU_ACCEL_X_SENS_NUM   3791

Definition at line 48 of file imu_nps.h.

#define IMU_ACCEL_Y_SENS   37.91

Definition at line 50 of file imu_nps.h.

#define IMU_ACCEL_Y_SENS_DEN   100

Definition at line 52 of file imu_nps.h.

#define IMU_ACCEL_Y_SENS_NUM   3791

Definition at line 51 of file imu_nps.h.

#define IMU_ACCEL_Z_SENS   39.24

Definition at line 53 of file imu_nps.h.

#define IMU_ACCEL_Z_SENS_DEN   100

Definition at line 55 of file imu_nps.h.

#define IMU_ACCEL_Z_SENS_NUM   3924

Definition at line 54 of file imu_nps.h.

#define IMU_GYRO_P_SENS   4.359

we just define some defaults for aspirin v1.5 for now

Definition at line 32 of file imu_nps.h.

#define IMU_GYRO_P_SENS_DEN   1000

Definition at line 34 of file imu_nps.h.

#define IMU_GYRO_P_SENS_NUM   4359

Definition at line 33 of file imu_nps.h.

#define IMU_GYRO_Q_SENS   4.359

Definition at line 35 of file imu_nps.h.

#define IMU_GYRO_Q_SENS_DEN   1000

Definition at line 37 of file imu_nps.h.

#define IMU_GYRO_Q_SENS_NUM   4359

Definition at line 36 of file imu_nps.h.

#define IMU_GYRO_R_SENS   4.359

Definition at line 38 of file imu_nps.h.

#define IMU_GYRO_R_SENS_DEN   1000

Definition at line 40 of file imu_nps.h.

#define IMU_GYRO_R_SENS_NUM   4359

Definition at line 39 of file imu_nps.h.

#define ImuEvent (   _gyro_handler,
  _accel_handler,
  _mag_handler 
)
Value:
{ \
_accel_handler(); \
} \
_gyro_handler(); \
} \
ImuMagEvent(_mag_handler); \
}
#define ImuMagEvent(_mag_handler)
Definition: imu_nps.h:70
#define FALSE
Definition: imu_chimu.h:141
uint8_t accel_available
Definition: imu_nps.h:61
uint8_t gyro_available
Definition: imu_nps.h:62
struct ImuNps imu_nps
Definition: imu_nps.c:28

Definition at line 77 of file imu_nps.h.

#define ImuMagEvent (   _mag_handler)
Value:
{ \
_mag_handler(); \
} \
}
#define FALSE
Definition: imu_chimu.h:141
uint8_t mag_available
Definition: imu_nps.h:60
struct ImuNps imu_nps
Definition: imu_nps.c:28

Definition at line 70 of file imu_nps.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_SENS_NUM) / IMU_ACCEL_X_SENS_DEN; \
_imu.accel.y = ((_imu.accel_unscaled.y - _imu.accel_neutral.y) * IMU_ACCEL_Y_SENS_NUM) / IMU_ACCEL_Y_SENS_DEN; \
_imu.accel.z = ((_imu.accel_unscaled.z - _imu.accel_neutral.z) * IMU_ACCEL_Z_SENS_NUM) / IMU_ACCEL_Z_SENS_DEN; \
}
#define IMU_ACCEL_Z_SENS_NUM
Definition: imu_nps.h:54
#define IMU_ACCEL_Y_SENS_DEN
Definition: imu_nps.h:52
#define IMU_ACCEL_Z_SENS_DEN
Definition: imu_nps.h:55
#define IMU_ACCEL_X_SENS_NUM
Definition: imu_nps.h:48
#define VECT3_COPY(_a, _b)
Definition: pprz_algebra.h:113
#define IMU_ACCEL_X_SENS_DEN
Definition: imu_nps.h:49
#define IMU_ACCEL_Y_SENS_NUM
Definition: imu_nps.h:51

Definition at line 96 of file imu_nps.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_SENS_NUM) / IMU_GYRO_P_SENS_DEN; \
_imu.gyro.q = ((_imu.gyro_unscaled.q - _imu.gyro_neutral.q) * IMU_GYRO_Q_SENS_NUM) / IMU_GYRO_Q_SENS_DEN; \
_imu.gyro.r = ((_imu.gyro_unscaled.r - _imu.gyro_neutral.r) * IMU_GYRO_R_SENS_NUM) / IMU_GYRO_R_SENS_DEN; \
}
#define IMU_GYRO_Q_SENS_DEN
Definition: imu_nps.h:37
#define IMU_GYRO_P_SENS_NUM
Definition: imu_nps.h:33
#define RATES_COPY(_a, _b)
Definition: pprz_algebra.h:303
#define IMU_GYRO_R_SENS_NUM
Definition: imu_nps.h:39
#define IMU_GYRO_P_SENS_DEN
Definition: imu_nps.h:34
#define IMU_GYRO_Q_SENS_NUM
Definition: imu_nps.h:36
#define IMU_GYRO_R_SENS_DEN
Definition: imu_nps.h:40

Definition at line 89 of file imu_nps.h.

Referenced by on_gyro_accel_event(), and on_gyro_event().

#define ImuScaleMag (   _imu)
Value:
{ \
_imu.mag.x = ((_imu.mag_unscaled.x - _imu.mag_neutral.x) * IMU_MAG_X_SENS_NUM) / IMU_MAG_X_SENS_DEN; \
_imu.mag.y = ((_imu.mag_unscaled.y - _imu.mag_neutral.y) * IMU_MAG_Y_SENS_NUM) / IMU_MAG_Y_SENS_DEN; \
_imu.mag.z = ((_imu.mag_unscaled.z - _imu.mag_neutral.z) * IMU_MAG_Z_SENS_NUM) / IMU_MAG_Z_SENS_DEN; \
}

Definition at line 103 of file imu_nps.h.

Function Documentation

void imu_feed_gyro_accel ( void  )
void imu_feed_mag ( void  )

Definition at line 54 of file imu_nps.c.

References imu, imu_nps, ImuNps::mag_available, Imu::mag_unscaled, TRUE, VECT3_ASSIGN, and Int32Vect3::x.

Variable Documentation

struct ImuNps imu_nps

Definition at line 28 of file imu_nps.c.

Referenced by imu_feed_gyro_accel(), imu_feed_mag(), and imu_impl_init().