AP_NavEKF: Protect against baro data errors in constant position mode

Large baro data errors when flying without GPS could cause total failure of the EKF.
This patch provides protection against this happening in-flight but allows for large innovations during preflight alignment.
This commit is contained in:
Paul Riseborough 2015-10-30 10:03:13 +11:00 committed by Randy Mackay
parent 778b1c3e18
commit 69d4bd2481

View File

@ -2154,8 +2154,10 @@ void NavEKF::FuseVelPosNED()
// fail if the ratio is > 1, but don't fail if bad IMU data
hgtHealth = ((hgtTestRatio < 1.0f) || badIMUdata);
hgtTimeout = (imuSampleTime_ms - lastHgtPassTime_ms) > hgtRetryTime;
// Fuse height data if healthy or timed out or in constant position mode
if (hgtHealth || hgtTimeout || constPosMode) {
// Fuse height data if healthy
// Force a reset if timed out to prevent the possibility of inertial errors causing persistent loss of height reference
// Force fusion in constant position mode on the ground to allow large accelerometer biases to be learned without rejecting barometer
if (hgtHealth || hgtTimeout || (constPosMode && !vehicleArmed)) {
// Calculate a filtered value to be used by pre-flight health checks
// We need to filter because wind gusts can generate significant baro noise and we want to be able to detect bias errors in the inertial solution
if (!vehicleArmed) {