diff --git a/libraries/AP_AHRS/AP_AHRS.cpp b/libraries/AP_AHRS/AP_AHRS.cpp index ab414a545e..4bfb122993 100644 --- a/libraries/AP_AHRS/AP_AHRS.cpp +++ b/libraries/AP_AHRS/AP_AHRS.cpp @@ -580,7 +580,7 @@ void AP_AHRS::update_EKF3(void) // update _accel_ef_ekf for (uint8_t i=0; i<_ins.get_accel_count(); i++) { Vector3f accel = _ins.get_accel(i); - if (i==_ins.get_primary_accel()) { + if (i == primary_imu) { accel -= abias; } if (_ins.get_accel_health(i)) {