From 710b2bcb9f91c52863e53ed55abe24841bf2aeb6 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Fri, 31 Mar 2017 12:54:53 +1100 Subject: [PATCH] EKF: Do not move EKF origin when performing GPS checks Doing so can casue large jumps in GPS position and innovation check errors after landing and also reduces the effectiveness of pre-flight innovation consistency checks. --- EKF/gps_checks.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/EKF/gps_checks.cpp b/EKF/gps_checks.cpp index 94478c379c..ff1e801f0e 100644 --- a/EKF/gps_checks.cpp +++ b/EKF/gps_checks.cpp @@ -167,10 +167,6 @@ bool Ekf::gps_is_good(struct gps_message *gps) _gps_check_fail_status.flags.hdrift = false; } - // Save current position as the reference for next time - map_projection_init_timestamped(&_pos_ref, lat, lon, _time_last_imu); - _last_gps_origin_time_us = _time_last_imu; - // Calculate the vertical drift velocity and limit to 10x the threshold vel_limit = 10.0f * _params.req_vdrift; float velD = fminf(fmaxf((_gps_alt_ref - 1e-3f * (float)gps->alt) / dt, -vel_limit), vel_limit);