1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

check variances for validity and reinitialize if invalid

This commit is contained in:
Corvus Corax 2013-06-06 00:07:11 +02:00
parent f22a0d299e
commit bab95e7ca8

View File

@ -422,6 +422,13 @@ static int32_t filter(stateFilter *self, stateEstimation *state)
EKFStateVarianceGet(&vardata);
INSGetP(vardata.P);
EKFStateVarianceSet(&vardata);
int t;
for (t = 0; t < EKFSTATEVARIANCE_P_NUMELEM; t++) {
if (invalid_var(vardata.P[t])) {
INSResetP(this->ekfConfiguration.P);
break;
}
}
// all sensor data has been used, reset!
this->work.updated = 0;