fix error from refactring commit, fix reset on ground (#23370)

This commit is contained in:
Marco Hauswirth
2024-07-08 13:55:05 +02:00
committed by GitHub
parent e04c53241a
commit 4bc0286eb8
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -308,10 +308,10 @@ bool Ekf::resetGlobalPosToExternalObservation(double lat_deg, double lon_deg, fl
pos_corrected += _state.vel.xy() * dt_s;
}
const float obs_var = math::max(accuracy, sq(0.01f));
const float obs_var = math::max(sq(accuracy), sq(0.01f));
const Vector2f innov = Vector2f(_state.pos.xy()) - pos_corrected;
const Vector2f innov_var = Vector2f(getStateVariance<State::vel>()) + obs_var;
const Vector2f innov_var = Vector2f(getStateVariance<State::pos>()) + obs_var;
const float sq_gate = sq(5.f); // magic hardcoded gate
const Vector2f test_ratio{sq(innov(0)) / (sq_gate * innov_var(0)),