mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
filterekf: Remember critical divergence and set error flag to prevent (re)arming so the user will notice
This commit is contained in:
parent
b0db191703
commit
fcc3f519d8
@ -427,6 +427,7 @@ static int32_t filter(stateFilter *self, stateEstimation *state)
|
||||
for (t = 0; t < EKFSTATEVARIANCE_P_NUMELEM; t++) {
|
||||
if (invalid_var(vardata.P[t])) {
|
||||
INSResetP(this->ekfConfiguration.P);
|
||||
this->init_stage = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -434,7 +435,11 @@ static int32_t filter(stateFilter *self, stateEstimation *state)
|
||||
// all sensor data has been used, reset!
|
||||
this->work.updated = 0;
|
||||
|
||||
return 0;
|
||||
if (this->init_stage < 0) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check for invalid variance values
|
||||
|
Loading…
x
Reference in New Issue
Block a user