AP_NavEKF3: check GPS used before resetting pos due to GPS receiver change

This commit is contained in:
Randy Mackay 2020-04-30 08:46:55 +09:00
parent f79d5d2d2c
commit 183ce50138

View File

@ -431,7 +431,7 @@ void NavEKF3_core::SelectVelPosFusion()
selectHeightForFusion(); selectHeightForFusion();
// if we are using GPS, check for a change in receiver and reset position and height // 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 // record the ID of the GPS that we are using for the reset
last_gps_idx = gpsDataDelayed.sensor_idx; last_gps_idx = gpsDataDelayed.sensor_idx;