From 9bb54ccc0889543960d722e500c6114f32375bd2 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 9 Mar 2017 16:15:01 +1100 Subject: [PATCH] EKF: don't accept GPS data without a 3D lock --- EKF/estimator_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/estimator_interface.cpp b/EKF/estimator_interface.cpp index b0f7ed92dd..9041a10e76 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -178,7 +178,7 @@ void EstimatorInterface::setGpsData(uint64_t time_usec, struct gps_message *gps) // limit data rate to prevent data being lost bool need_gps = (_params.fusion_mode & MASK_USE_GPS) || (_params.vdist_sensor_type == VDIST_SENSOR_GPS); - if (((time_usec - _time_last_gps) > _min_obs_interval_us) && need_gps) { + if (((time_usec - _time_last_gps) > _min_obs_interval_us) && need_gps && gps->fix_type > 2) { gpsSample gps_sample_new = {}; gps_sample_new.time_us = gps->time_usec - _params.gps_delay_ms * 1000;