mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
AP_NavEKF3: fixed loss of GPS fusion
we must not do a storedGPS.recall unless we will be using the data, otherwise we will lose GPS samples and risk stopping GPS fusion
This commit is contained in:
parent
c83e2d7c0e
commit
216935c1f2
@ -664,10 +664,6 @@ void NavEKF3_core::readGpsData()
|
|||||||
hal.util->snprintf(prearm_fail_string, sizeof(prearm_fail_string), "Waiting for 3D fix");
|
hal.util->snprintf(prearm_fail_string, sizeof(prearm_fail_string), "Waiting for 3D fix");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get data that has now fallen behind the fusion time horizon
|
|
||||||
gpsDataToFuse = storedGPS.recall(gpsDataDelayed,imuDataDelayed.time_ms);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the delta angle and corresponding time interval from the IMU
|
// read the delta angle and corresponding time interval from the IMU
|
||||||
|
@ -284,6 +284,12 @@ void NavEKF3_core::SelectVelPosFusion()
|
|||||||
posVelFusionDelayed = false;
|
posVelFusionDelayed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read GPS data from the sensor
|
||||||
|
readGpsData();
|
||||||
|
|
||||||
|
// get data that has now fallen behind the fusion time horizon
|
||||||
|
gpsDataToFuse = storedGPS.recall(gpsDataDelayed,imuDataDelayed.time_ms);
|
||||||
|
|
||||||
// Determine if we need to fuse position and velocity data on this time step
|
// Determine if we need to fuse position and velocity data on this time step
|
||||||
if (gpsDataToFuse && PV_AidingMode == AID_ABSOLUTE) {
|
if (gpsDataToFuse && PV_AidingMode == AID_ABSOLUTE) {
|
||||||
|
|
||||||
|
@ -631,20 +631,21 @@ void NavEKF3_core::UpdateFilter(bool predict)
|
|||||||
// Predict the covariance growth
|
// Predict the covariance growth
|
||||||
CovariancePrediction();
|
CovariancePrediction();
|
||||||
|
|
||||||
// Read GPS data from the sensor
|
|
||||||
// This is required by multiple processes so needs to be done before other fusion steps
|
|
||||||
readGpsData();
|
|
||||||
|
|
||||||
// Generate an alternative yaw estimate used for inflight recovery from bad compass data
|
|
||||||
// requires horizontal GPS velocity
|
|
||||||
runYawEstimator();
|
|
||||||
|
|
||||||
// Update states using magnetometer or external yaw sensor data
|
// Update states using magnetometer or external yaw sensor data
|
||||||
SelectMagFusion();
|
SelectMagFusion();
|
||||||
|
|
||||||
// Update states using GPS and altimeter data
|
// Update states using GPS and altimeter data
|
||||||
SelectVelPosFusion();
|
SelectVelPosFusion();
|
||||||
|
|
||||||
|
// Generate an alternative yaw estimate used for inflight
|
||||||
|
// recovery from bad compass data requires horizontal GPS
|
||||||
|
// velocity. We only do this when posVelFusionDelayed is false
|
||||||
|
// as otherwise there will be no new GPS data, as the
|
||||||
|
// sttoredGPS recall will have been skipped
|
||||||
|
if (!posVelFusionDelayed) {
|
||||||
|
runYawEstimator();
|
||||||
|
}
|
||||||
|
|
||||||
// Update states using range beacon data
|
// Update states using range beacon data
|
||||||
SelectRngBcnFusion();
|
SelectRngBcnFusion();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user