mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 22:53:34 +08:00
ekf2-mag: turn around update_all_states condition
Non-functional
This commit is contained in:
@@ -103,7 +103,13 @@ bool Ekf::fuseMag(const Vector3f &mag, const float R_MAG, VectorState &H, estima
|
|||||||
|
|
||||||
VectorState Kfusion = P * H / aid_src.innovation_variance[index];
|
VectorState Kfusion = P * H / aid_src.innovation_variance[index];
|
||||||
|
|
||||||
if (!update_all_states) {
|
if (update_all_states) {
|
||||||
|
if (!update_tilt) {
|
||||||
|
Kfusion(State::quat_nominal.idx + 0) = 0.f;
|
||||||
|
Kfusion(State::quat_nominal.idx + 1) = 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
// zero non-mag Kalman gains if not updating all states
|
// zero non-mag Kalman gains if not updating all states
|
||||||
|
|
||||||
// copy mag_I and mag_B Kalman gains
|
// copy mag_I and mag_B Kalman gains
|
||||||
@@ -116,11 +122,6 @@ bool Ekf::fuseMag(const Vector3f &mag, const float R_MAG, VectorState &H, estima
|
|||||||
Kfusion.slice<State::mag_B.dof, 1>(State::mag_B.idx, 0) = K_mag_B;
|
Kfusion.slice<State::mag_B.dof, 1>(State::mag_B.idx, 0) = K_mag_B;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!update_tilt) {
|
|
||||||
Kfusion(State::quat_nominal.idx + 0) = 0.f;
|
|
||||||
Kfusion(State::quat_nominal.idx + 1) = 0.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (measurementUpdate(Kfusion, H, aid_src.observation_variance[index], aid_src.innovation[index])) {
|
if (measurementUpdate(Kfusion, H, aid_src.observation_variance[index], aid_src.innovation[index])) {
|
||||||
fused[index] = true;
|
fused[index] = true;
|
||||||
limitDeclination();
|
limitDeclination();
|
||||||
|
|||||||
Reference in New Issue
Block a user