mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
Sign convention fix: stationary accelerometer measures [0 0 -9.81]
This commit is contained in:
@@ -81,9 +81,9 @@
|
|||||||
<define name="ACCEL_Y_SENS" value="0.9346" integer="16"/>
|
<define name="ACCEL_Y_SENS" value="0.9346" integer="16"/>
|
||||||
<define name="ACCEL_Z_SENS" value="0.9178" integer="16"/>
|
<define name="ACCEL_Z_SENS" value="0.9178" integer="16"/>
|
||||||
|
|
||||||
<define name="ACCEL_X_SIGN" value="-1"/>
|
<define name="ACCEL_X_SIGN" value="1"/>
|
||||||
<define name="ACCEL_Y_SIGN" value="1"/>
|
<define name="ACCEL_Y_SIGN" value="-1"/>
|
||||||
<define name="ACCEL_Z_SIGN" value="1"/>
|
<define name="ACCEL_Z_SIGN" value="-1"/>
|
||||||
|
|
||||||
<define name="MAG_X_NEUTRAL" value="0"/>
|
<define name="MAG_X_NEUTRAL" value="0"/>
|
||||||
<define name="MAG_Y_NEUTRAL" value="0"/>
|
<define name="MAG_Y_NEUTRAL" value="0"/>
|
||||||
|
|||||||
@@ -195,9 +195,9 @@ void ppzuavimu_module_event( void )
|
|||||||
z = (int16_t) ((ppzuavimu_adxl345.buf[5] << 8) | ppzuavimu_adxl345.buf[4]);
|
z = (int16_t) ((ppzuavimu_adxl345.buf[5] << 8) | ppzuavimu_adxl345.buf[4]);
|
||||||
|
|
||||||
#ifdef ASPIRIN_IMU
|
#ifdef ASPIRIN_IMU
|
||||||
VECT3_ASSIGN(imu.accel_unscaled, -x, y, z);
|
VECT3_ASSIGN(imu.accel_unscaled, x, -y, -z);
|
||||||
#else // PPZIMU
|
#else // PPZIMU
|
||||||
VECT3_ASSIGN(imu.accel_unscaled, x, -y, z);
|
VECT3_ASSIGN(imu.accel_unscaled, -x, y, -z);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
acc_valid = TRUE;
|
acc_valid = TRUE;
|
||||||
|
|||||||
@@ -213,6 +213,13 @@ void ahrs_update_accel(void)
|
|||||||
|
|
||||||
ACCELS_FLOAT_OF_BFP(accel_float, imu.accel);
|
ACCELS_FLOAT_OF_BFP(accel_float, imu.accel);
|
||||||
|
|
||||||
|
// DCM filter uses g-force as positive
|
||||||
|
// accelerometer measures [0 0 -g] in a static case
|
||||||
|
|
||||||
|
accel_float.x = -accel_float.x;
|
||||||
|
accel_float.y = -accel_float.y;
|
||||||
|
accel_float.z = -accel_float.z;
|
||||||
|
|
||||||
#ifdef USE_GPS
|
#ifdef USE_GPS
|
||||||
if (gps.fix == GPS_FIX_3D) { //Remove centrifugal acceleration.
|
if (gps.fix == GPS_FIX_3D) { //Remove centrifugal acceleration.
|
||||||
accel_float.y += gps.speed_3d/100. * Omega[2]; // Centrifugal force on Acc_y = GPS_speed*GyroZ
|
accel_float.y += gps.speed_3d/100. * Omega[2]; // Centrifugal force on Acc_y = GPS_speed*GyroZ
|
||||||
|
|||||||
Reference in New Issue
Block a user