From 037c248dcedb9ce6253aa4c5d74d85e25c0de699 Mon Sep 17 00:00:00 2001 From: Marco Hauswirth <58551738+haumarco@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:36:15 +0200 Subject: [PATCH] fix(ekf2): hard reset external position estimate while position aiding active (#27856) (cherry picked from commit 1d0283279825a4c3cf0b00ea1ce36a3b5c779a02) --- src/modules/ekf2/EKF/ekf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/ekf2/EKF/ekf.cpp b/src/modules/ekf2/EKF/ekf.cpp index 74f4a3b5a88..f113ee8f8f1 100644 --- a/src/modules/ekf2/EKF/ekf.cpp +++ b/src/modules/ekf2/EKF/ekf.cpp @@ -336,11 +336,11 @@ bool Ekf::resetGlobalPosToExternalObservation(const double latitude, const doubl const bool innov_rejected = (test_ratio > 1.f); - if (!_control_status.flags.in_air || (eph > 0.f && eph < 1.f) || innov_rejected) { + if (!_control_status.flags.in_air || (eph > 0.f && eph < 1.f) || innov_rejected + || isHorizontalPositionAidingActive()) { // When on ground or accuracy chosen to be very low, we hard reset position // this allows the user to still send hard resets at any time - // Also reset when another position source is active as it it would otherwise have almost no - // visible effect to the position estimate. + // Also hard reset when a position aiding source is active ECL_INFO("reset position to external observation"); _information_events.flags.reset_pos_to_ext_obs = true;