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.
This commit is contained in:
Carl Olsson
2020-02-27 11:59:38 +01:00
committed by GitHub
parent 71d4d22ae4
commit 3fa5f501ae
+1 -1
View File
@@ -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;