mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 19:17:28 +08:00
Imu scale float (#3477)
* [imu] Use floats for scaling * [imu] default scales float * [imu] update comments * Fix print function * [imu] fix calibration * [imu] calibration in float * [imu] remove old calibration generation. compilation error if IMU_IMU_ACCEL_CALIB is defined. * remove static operations Co-authored-by: Gautier Hattenberger <gautier.hattenberger@enac.fr> * clarify scales --------- Co-authored-by: Fabien-B <Fabien-B@github.com> Co-authored-by: Gautier Hattenberger <gautier.hattenberger@enac.fr>
This commit is contained in:
@@ -60,30 +60,18 @@
|
||||
|
||||
#ifdef IMU_ACCEL_X_SENS
|
||||
#define NPS_ACCEL_SENSITIVITY_XX ACCEL_BFP_OF_REAL(1./IMU_ACCEL_X_SENS)
|
||||
#define NPS_ACCEL_SENSITIVITY_XX_NUM ACCEL_BFP_OF_REAL(1./IMU_ACCEL_X_SENS_NUM)
|
||||
#define NPS_ACCEL_SENSITIVITY_XX_DEN ACCEL_BFP_OF_REAL(1./IMU_ACCEL_X_SENS_DEN)
|
||||
#else
|
||||
#define NPS_ACCEL_SENSITIVITY_XX ACCEL_BFP_OF_REAL(1.)
|
||||
#define NPS_ACCEL_SENSITIVITY_XX_NUM 1
|
||||
#define NPS_ACCEL_SENSITIVITY_XX_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_ACCEL_Y_SENS
|
||||
#define NPS_ACCEL_SENSITIVITY_YY ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Y_SENS)
|
||||
#define NPS_ACCEL_SENSITIVITY_YY_NUM ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Y_SENS_NUM)
|
||||
#define NPS_ACCEL_SENSITIVITY_YY_DEN ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Y_SENS_DEN)
|
||||
#else
|
||||
#define NPS_ACCEL_SENSITIVITY_YY ACCEL_BFP_OF_REAL(1.)
|
||||
#define NPS_ACCEL_SENSITIVITY_YY_NUM 1
|
||||
#define NPS_ACCEL_SENSITIVITY_YY_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_ACCEL_Z_SENS
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Z_SENS)
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ_NUM ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Z_SENS_NUM)
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ_DEN ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Z_SENS_DEN)
|
||||
#else
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ ACCEL_BFP_OF_REAL(1.)
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ_NUM 1
|
||||
#define NPS_ACCEL_SENSITIVITY_ZZ_DEN 1
|
||||
#endif
|
||||
|
||||
#ifdef IMU_ACCEL_X_NEUTRAL
|
||||
@@ -142,30 +130,18 @@
|
||||
|
||||
#ifdef IMU_GYRO_P_SENS
|
||||
#define NPS_GYRO_SENSITIVITY_PP RATE_BFP_OF_REAL(1./IMU_GYRO_P_SENS)
|
||||
#define NPS_GYRO_SENSITIVITY_PP_NUM RATE_BFP_OF_REAL(1./IMU_GYRO_P_SENS_NUM)
|
||||
#define NPS_GYRO_SENSITIVITY_PP_DEN RATE_BFP_OF_REAL(1./IMU_GYRO_P_SENS_DEN)
|
||||
#else
|
||||
#define NPS_GYRO_SENSITIVITY_PP RATE_BFP_OF_REAL(1.)
|
||||
#define NPS_GYRO_SENSITIVITY_PP_NUM 1
|
||||
#define NPS_GYRO_SENSITIVITY_PP_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_GYRO_Q_SENS
|
||||
#define NPS_GYRO_SENSITIVITY_QQ RATE_BFP_OF_REAL(1./IMU_GYRO_Q_SENS)
|
||||
#define NPS_GYRO_SENSITIVITY_QQ_NUM RATE_BFP_OF_REAL(1./IMU_GYRO_Q_SENS_NUM)
|
||||
#define NPS_GYRO_SENSITIVITY_QQ_DEN RATE_BFP_OF_REAL(1./IMU_GYRO_Q_SENS_DEN)
|
||||
#else
|
||||
#define NPS_GYRO_SENSITIVITY_QQ RATE_BFP_OF_REAL(1.)
|
||||
#define NPS_GYRO_SENSITIVITY_QQ_NUM 1
|
||||
#define NPS_GYRO_SENSITIVITY_QQ_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_GYRO_R_SENS
|
||||
#define NPS_GYRO_SENSITIVITY_RR RATE_BFP_OF_REAL(1./IMU_GYRO_R_SENS)
|
||||
#define NPS_GYRO_SENSITIVITY_RR_NUM RATE_BFP_OF_REAL(1./IMU_GYRO_R_SENS_NUM)
|
||||
#define NPS_GYRO_SENSITIVITY_RR_DEN RATE_BFP_OF_REAL(1./IMU_GYRO_R_SENS_DEN)
|
||||
#else
|
||||
#define NPS_GYRO_SENSITIVITY_RR RATE_BFP_OF_REAL(1.)
|
||||
#define NPS_GYRO_SENSITIVITY_RR_NUM 1
|
||||
#define NPS_GYRO_SENSITIVITY_RR_DEN 1
|
||||
#endif
|
||||
|
||||
#ifdef IMU_GYRO_P_NEUTRAL
|
||||
@@ -232,30 +208,18 @@
|
||||
|
||||
#ifdef IMU_MAG_X_SENS
|
||||
#define NPS_MAG_SENSITIVITY_XX MAG_BFP_OF_REAL(1./IMU_MAG_X_SENS)
|
||||
#define NPS_MAG_SENSITIVITY_XX_NUM MAG_BFP_OF_REAL(1./IMU_MAG_X_SENS_NUM)
|
||||
#define NPS_MAG_SENSITIVITY_XX_DEN MAG_BFP_OF_REAL(1./IMU_MAG_X_SENS_DEN)
|
||||
#else
|
||||
#define NPS_MAG_SENSITIVITY_XX MAG_BFP_OF_REAL(1.)
|
||||
#define NPS_MAG_SENSITIVITY_XX_NUM 1
|
||||
#define NPS_MAG_SENSITIVITY_XX_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_MAG_Y_SENS
|
||||
#define NPS_MAG_SENSITIVITY_YY MAG_BFP_OF_REAL(1./IMU_MAG_Y_SENS)
|
||||
#define NPS_MAG_SENSITIVITY_YY_NUM MAG_BFP_OF_REAL(1./IMU_MAG_Y_SENS_NUM)
|
||||
#define NPS_MAG_SENSITIVITY_YY_DEN MAG_BFP_OF_REAL(1./IMU_MAG_Y_SENS_DEN)
|
||||
#else
|
||||
#define NPS_MAG_SENSITIVITY_YY MAG_BFP_OF_REAL(1.)
|
||||
#define NPS_MAG_SENSITIVITY_YY_NUM 1
|
||||
#define NPS_MAG_SENSITIVITY_YY_DEN 1
|
||||
#endif
|
||||
#ifdef IMU_MAG_Z_SENS
|
||||
#define NPS_MAG_SENSITIVITY_ZZ MAG_BFP_OF_REAL(1./IMU_MAG_Z_SENS)
|
||||
#define NPS_MAG_SENSITIVITY_ZZ_NUM MAG_BFP_OF_REAL(1./IMU_MAG_Z_SENS_NUM)
|
||||
#define NPS_MAG_SENSITIVITY_ZZ_DEN MAG_BFP_OF_REAL(1./IMU_MAG_Z_SENS_DEN)
|
||||
#else
|
||||
#define NPS_MAG_SENSITIVITY_ZZ MAG_BFP_OF_REAL(1.)
|
||||
#define NPS_MAG_SENSITIVITY_ZZ_NUM 1
|
||||
#define NPS_MAG_SENSITIVITY_ZZ_DEN 1
|
||||
#endif
|
||||
|
||||
#ifdef IMU_MAG_X_NEUTRAL
|
||||
|
||||
Reference in New Issue
Block a user