From 183ce50138087b8702ecc62fbf8ab94aa0c1db72 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 30 Apr 2020 08:46:55 +0900 Subject: [PATCH] AP_NavEKF3: check GPS used before resetting pos due to GPS receiver change --- libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp index 152f250e18b65..94b3946d720c5 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp @@ -431,7 +431,7 @@ void NavEKF3_core::SelectVelPosFusion() selectHeightForFusion(); // if we are using GPS, check for a change in receiver and reset position and height - if (gpsDataToFuse && PV_AidingMode == AID_ABSOLUTE && gpsDataDelayed.sensor_idx != last_gps_idx) { + if (gpsDataToFuse && (PV_AidingMode == AID_ABSOLUTE) && (frontend->_fusionModeGPS != 3) && (gpsDataDelayed.sensor_idx != last_gps_idx)) { // record the ID of the GPS that we are using for the reset last_gps_idx = gpsDataDelayed.sensor_idx;