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:
Thomas Watson
2026-04-14 21:03:14 +10:00
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;