mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 00:10:35 +08:00
Remove obsolete vision sample counter during initialization
This commit is contained in:
committed by
Mathieu Bresciani
parent
181303488c
commit
6941777e17
-20
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user