From 17a45b2c44cc53b6d8db4ff04ecc44b8065fdde3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 May 2020 19:38:53 +1000 Subject: [PATCH] AP_NavEKF2: fixes for new compass API --- libraries/AP_NavEKF2/AP_NavEKF2_core.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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;