diff --git a/src/modules/ekf2/EKF/ekf.cpp b/src/modules/ekf2/EKF/ekf.cpp index 74f4a3b5a886..f113ee8f8f1a 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;