Remove dangerous _primary_hgt_source variable

This commit is contained in:
kamilritz
2019-12-11 16:05:51 +01:00
committed by Mathieu Bresciani
parent 66f707ede0
commit 042d9b6615
3 changed files with 1 additions and 7 deletions
-5
View File
@@ -177,11 +177,6 @@ bool Ekf::initialiseFilter()
}
}
// set the default height source from the adjustable parameter
if (_hgt_counter == 0) {
_primary_hgt_source = _params.vdist_sensor_type;
}
// accumulate enough height measurements to be confident in the quality of the data
// we use baro height initially and switch to GPS/range/EV finder later when it passes checks.
if (_baro_buffer.pop_first_older_than(_imu_sample_delayed.time_us, &_baro_sample_delayed)) {
-1
View File
@@ -505,7 +505,6 @@ private:
bool _baro_hgt_faulty{false}; ///< true if valid baro data is unavailable for use
bool _gps_hgt_intermittent{false}; ///< true if gps height into the buffer is intermittent
bool _rng_hgt_valid{false}; ///< true if range finder sample retrieved from buffer is valid
int _primary_hgt_source{VDIST_SENSOR_BARO}; ///< specifies primary source of height data
uint64_t _time_bad_rng_signal_quality{0}; ///< timestamp at which range finder signal quality was 0 (used for hysteresis)
// imu fault status
+1 -1
View File
@@ -90,7 +90,7 @@ bool Ekf::collect_gps(const gps_message &gps)
_gps_origin_epv = gps.epv;
// if the user has selected GPS as the primary height source, switch across to using it
if (_primary_hgt_source == VDIST_SENSOR_GPS) {
if (_params.vdist_sensor_type == VDIST_SENSOR_GPS) {
ECL_INFO_TIMESTAMPED("EKF GPS checks passed (WGS-84 origin set, using GPS height)");
_control_status.flags.baro_hgt = false;
_control_status.flags.gps_hgt = true;