mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_NavEKF3: FuseRngBcn: make fusion update more consistent
Update `stateStruct` before calling `ConstrainVariances` as the latter can change `stateStruct` in rare cases.
This commit is contained in:
committed by
Peter Barker
parent
76c003cf27
commit
b38ab873ae
@@ -278,16 +278,16 @@ void NavEKF3_core::FuseRngBcn()
|
||||
}
|
||||
}
|
||||
|
||||
// force the covariance matrix to be symmetrical and limit the variances to prevent ill-conditioning.
|
||||
ForceSymmetry();
|
||||
ConstrainVariances();
|
||||
|
||||
// correct the state vector
|
||||
for (uint8_t j= 0; j<=stateIndexLim; j++) {
|
||||
statesArray[j] = statesArray[j] - Kfusion[j] * rngBcn.innov;
|
||||
}
|
||||
stateStruct.quat.normalize();
|
||||
|
||||
// force the covariance matrix to be symmetrical and limit the variances to prevent ill-conditioning.
|
||||
ForceSymmetry();
|
||||
ConstrainVariances();
|
||||
|
||||
// record healthy fusion
|
||||
faultStatus.bad_rngbcn = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user