Skip to content

Commit

Permalink
Remove obsolete vision sample counter during initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilritz authored and bresch committed Dec 11, 2019
1 parent 1813034 commit 6941777
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
20 changes: 0 additions & 20 deletions EKF/ekf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion EKF/ekf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6941777

Please sign in to comment.