diff --git a/sw/airborne/firmwares/fixedwing/guidance/energy_ctrl.c b/sw/airborne/firmwares/fixedwing/guidance/energy_ctrl.c index cf98b16b5f..b3b68b6375 100644 --- a/sw/airborne/firmwares/fixedwing/guidance/energy_ctrl.c +++ b/sw/airborne/firmwares/fixedwing/guidance/energy_ctrl.c @@ -237,9 +237,9 @@ void v_ctl_climb_loop( void ) // Actual Acceleration from IMU: attempt to reconstruct the actual kinematic acceleration #ifndef SITL - struct FloatVect3 accel_float = {0,0,0}; - ACCELS_FLOAT_OF_BFP(accel_float, imu.accel); - float vdot = ( accel_float.x / 9.81f - sinf(stateGetNedToBodyEulers_f()->theta) ); + struct Int32Vect3 accel_meas_body; + INT32_RMAT_TRANSP_VMULT(accel_meas_body, imu.body_to_imu_rmat, imu.accel); + float vdot = ACCEL_FLOAT_OF_BFP(accel_meas_body.x) / 9.81f - sinf(stateGetNedToBodyEulers_f()->theta); #else float vdot = 0; #endif diff --git a/sw/airborne/modules/nav/nav_catapult.c b/sw/airborne/modules/nav/nav_catapult.c index 1819b81c84..6f7ee96c91 100644 --- a/sw/airborne/modules/nav/nav_catapult.c +++ b/sw/airborne/modules/nav/nav_catapult.c @@ -110,7 +110,9 @@ void nav_catapult_highrate_module(void) { // Five consecutive measurements > 1.5 #ifndef SITL - if (ACCEL_FLOAT_OF_BFP(imu.accel.x) < (nav_catapult_acceleration_threshold * 9.81)) + struct Int32Vect3 accel_meas_body; + INT32_RMAT_TRANSP_VMULT(accel_meas_body, imu.body_to_imu_rmat, imu.accel); + if (ACCEL_FLOAT_OF_BFP(accel_meas_body.x) < (nav_catapult_acceleration_threshold * 9.81)) #else if (launch != 1) #endif