From 3fa5f501ae7edc4a793f0973e156706afcc8b419 Mon Sep 17 00:00:00 2001 From: Carl Olsson Date: Thu, 27 Feb 2020 11:59:38 +0100 Subject: [PATCH] EKF: dont check gps_check_fail_status in velocity reset (#761) In a velocity reset we only used the GPS measurement if _gps_check_fail_status.value was equal to zero. The value of this flag is independent of EKF2_GPS_CHECK so checks can fail even if they are not configured to have any effect. --- EKF/ekf_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 34ab910cb1..9f86387094 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -53,7 +53,7 @@ bool Ekf::resetVelocity() Vector3f vel_before_reset = _state.vel; // reset EKF states - if (_control_status.flags.gps && _gps_check_fail_status.value==0) { + if (_control_status.flags.gps && isTimedOut(_last_gps_fail_us, (uint64_t)_min_gps_health_time_us)) { ECL_INFO_TIMESTAMPED("reset velocity to GPS"); // this reset is only called if we have new gps data at the fusion time horizon _state.vel = _gps_sample_delayed.vel;