From d440c883b55c0ab74831dd184d7118dd9b858c53 Mon Sep 17 00:00:00 2001 From: CarlOlsson Date: Fri, 11 Mar 2016 12:55:33 +0100 Subject: [PATCH] adopted ekf_interface.cpp --- EKF/estimator_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EKF/estimator_interface.cpp b/EKF/estimator_interface.cpp index 373a703f80..2185a2c9be 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -206,11 +206,11 @@ void EstimatorInterface::setAirspeedData(uint64_t time_usec, float *data) return; } - if (time_usec > _time_last_airspeed) { + if (time_usec - _time_last_airspeed > 1000000) { //Limit the airspeed update rate to 1 Hz for now airspeedSample airspeed_sample_new; airspeed_sample_new.airspeed = *data; airspeed_sample_new.time_us = time_usec - _params.airspeed_delay_ms * 1000; - airspeed_sample_new.time_us -= FILTER_UPDATE_PERRIOD_MS * 1000 / 2; + airspeed_sample_new.time_us -= FILTER_UPDATE_PERRIOD_MS * 1000 / 2; //typo PeRRiod _time_last_airspeed = time_usec; _airspeed_buffer.push(airspeed_sample_new);