From 6941777e17d5e4914c2fed637e15044ba3d1ea42 Mon Sep 17 00:00:00 2001 From: kamilritz Date: Wed, 11 Dec 2019 14:48:24 +0100 Subject: [PATCH] Remove obsolete vision sample counter during initialization --- EKF/ekf.cpp | 20 -------------------- EKF/ekf.h | 1 - 2 files changed, 21 deletions(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 2f5352ed70..96173f5705 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -177,26 +177,6 @@ bool Ekf::initialiseFilter() } } - // Count the number of external vision measurements received - if (_ext_vision_buffer.pop_first_older_than(_imu_sample_delayed.time_us, &_ev_sample_delayed)) { - if ((_ev_counter == 0) && (_ev_sample_delayed.time_us != 0)) { - // initialise the counter - _ev_counter = 1; - - // set the height fusion mode to use external vision data when we start getting valid data from the buffer - if (_primary_hgt_source == VDIST_SENSOR_EV) { - _control_status.flags.baro_hgt = false; - _control_status.flags.gps_hgt = false; - _control_status.flags.rng_hgt = false; - _control_status.flags.ev_hgt = true; - } - - } else if ((_ev_counter != 0) && (_ev_sample_delayed.time_us != 0)) { - // increment the sample count - _ev_counter ++; - } - } - // set the default height source from the adjustable parameter if (_hgt_counter == 0) { _primary_hgt_source = _params.vdist_sensor_type; diff --git a/EKF/ekf.h b/EKF/ekf.h index 37183e5c77..11563d0fd8 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -466,7 +466,6 @@ private: uint32_t _hgt_counter{0}; ///< number of height samples read during initialisation float _rng_filt_state{0.0f}; ///< filtered height measurement (m) uint32_t _mag_counter{0}; ///< number of magnetometer samples read during initialisation - uint32_t _ev_counter{0}; ///< number of external vision samples read during initialisation uint64_t _time_last_mag{0}; ///< measurement time of last magnetomter sample (uSec) AlphaFilterVector3f _mag_lpf; ///< filtered magnetometer measurement (Gauss) Vector3f _delVel_sum; ///< summed delta velocity (m/sec)