diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 2f5352ed7095..96173f5705a8 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 37183e5c778c..11563d0fd81a 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -466,7 +466,6 @@ class Ekf : public EstimatorInterface 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)