Skip to content

Commit

Permalink
AP_NavEKF3: increase innovation variance instead of clipping innovations
Browse files Browse the repository at this point in the history
  • Loading branch information
priseborough committed Jun 25, 2023
1 parent 219fd3e commit 8e120d8
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,13 +771,13 @@ void NavEKF3_core::FuseVelPosNED()
posCheckPassed = true;
lastPosPassTime_ms = imuSampleTime_ms;
} else if ((frontend->_gpsGlitchRadiusMax <= 0) && (PV_AidingMode != AID_NONE)) {
// handle special case where the glitch radius parameter has been set to a non-positive number
// to indicate that large velocity and position innovations should be clipped instead of rejected.
// Handle the special case where the glitch radius parameter has been set to a non-positive number.
// The innovation variance is increased to limit the state update to an amount corresponding
// to a test ratio of 1.
posCheckPassed = true;
lastPosPassTime_ms = imuSampleTime_ms;
const ftype scaleFactor = 1.0F / sqrtF(posTestRatio);
innovVelPos[3] *= scaleFactor;
innovVelPos[4] *= scaleFactor;
varInnovVelPos[3] *= posTestRatio;
varInnovVelPos[4] *= posTestRatio;
posCheckPassed = true;
lastPosPassTime_ms = imuSampleTime_ms;
}
Expand Down Expand Up @@ -846,15 +846,14 @@ void NavEKF3_core::FuseVelPosNED()
velCheckPassed = true;
lastVelPassTime_ms = imuSampleTime_ms;
} else if (frontend->_gpsGlitchRadiusMax <= 0) {
// handle special case where the glitch radius parameter has been set to a non-positive number
// to indicate that large velocity and position innovations should be clipped instead of rejected.
// Handle the special case where the glitch radius parameter has been set to a non-positive number.
// The innovation variance is increased to limit the state update to an amount corresponding
// to a test ratio of 1.
posCheckPassed = true;
lastPosPassTime_ms = imuSampleTime_ms;
const ftype scaleFactor = 1.0F / sqrtF(velTestRatio);
for (uint8_t i = 0; i<=imax; i++) {
innovVelPos[i] *= scaleFactor;
varInnovVelPos[i] *= velTestRatio;
}
innovVelPos[4] *= scaleFactor;
velCheckPassed = true;
lastVelPassTime_ms = imuSampleTime_ms;
}
Expand Down

0 comments on commit 8e120d8

Please sign in to comment.