diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index bfaa356e8f90d..04f80777fcf7f 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -957,11 +957,14 @@ void AP_Vehicle::accel_cal_update() return; } ins.acal_update(); + +#if AP_AHRS_ENABLED // check if new trim values, and set them Vector3f trim_rad; if (ins.get_new_trim(trim_rad)) { ahrs.set_trim(trim_rad); } +#endif #if HAL_CAL_ALWAYS_REBOOT if (ins.accel_cal_requires_reboot() &&