mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
check variances for validity and reinitialize if invalid
This commit is contained in:
parent
f22a0d299e
commit
bab95e7ca8
@ -422,6 +422,13 @@ static int32_t filter(stateFilter *self, stateEstimation *state)
|
|||||||
EKFStateVarianceGet(&vardata);
|
EKFStateVarianceGet(&vardata);
|
||||||
INSGetP(vardata.P);
|
INSGetP(vardata.P);
|
||||||
EKFStateVarianceSet(&vardata);
|
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!
|
// all sensor data has been used, reset!
|
||||||
this->work.updated = 0;
|
this->work.updated = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user