diff --git a/libraries/AP_NavEKF2/AP_NavEKF2_core.cpp b/libraries/AP_NavEKF2/AP_NavEKF2_core.cpp index 361ff83362..06f1a88f47 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2_core.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2_core.cpp @@ -359,9 +359,7 @@ void NavEKF2_core::InitialiseVariablesMag() inhibitMagStates = true; - if (_ahrs->get_compass()) { - magSelectIndex = _ahrs->get_compass()->get_primary(); - } + magSelectIndex = 0; lastMagOffsetsValid = false; magStateResetRequest = false; magStateInitComplete = false;