forked from Archive/PX4-Autopilot
Do not fuse height after innovation consistency check fail
This commit is contained in:
parent
95fc701376
commit
13b9cd0cec
|
@ -1070,10 +1070,18 @@ void AttPosEKF::FuseVelposNED()
|
||||||
// apply a 10-sigma threshold
|
// apply a 10-sigma threshold
|
||||||
current_ekf_state.hgtHealth = sq(hgtInnov) < 100.0f*varInnovVelPos[5];
|
current_ekf_state.hgtHealth = sq(hgtInnov) < 100.0f*varInnovVelPos[5];
|
||||||
current_ekf_state.hgtTimeout = (millis() - current_ekf_state.hgtFailTime) > hgtRetryTime;
|
current_ekf_state.hgtTimeout = (millis() - current_ekf_state.hgtFailTime) > hgtRetryTime;
|
||||||
if (current_ekf_state.hgtHealth || current_ekf_state.hgtTimeout)
|
if (current_ekf_state.hgtHealth || current_ekf_state.hgtTimeout || staticMode)
|
||||||
{
|
{
|
||||||
current_ekf_state.hgtHealth = true;
|
current_ekf_state.hgtHealth = true;
|
||||||
current_ekf_state.hgtFailTime = millis();
|
current_ekf_state.hgtFailTime = millis();
|
||||||
|
|
||||||
|
// if we just reset from a timeout, do not fuse
|
||||||
|
// the height data, but reset height and stored states
|
||||||
|
if (current_ekf_state.hgtTimeout) {
|
||||||
|
ResetHeight();
|
||||||
|
ResetStoredStates();
|
||||||
|
fuseHgtData = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue