From 2347cb9e5047d0c6bc58cdaa3a7b06fee262b24a Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 25 Sep 2025 11:07:50 -0400 Subject: [PATCH] ekf2: SensorRangeFinder delete unused faulty flag --- .../ekf2/EKF/aid_sources/range_finder/sensor_range_finder.cpp | 2 +- .../ekf2/EKF/aid_sources/range_finder/sensor_range_finder.hpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.cpp b/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.cpp index ab1c747e01..3d7f462801 100644 --- a/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.cpp +++ b/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.cpp @@ -64,7 +64,7 @@ void SensorRangeFinder::updateValidity(uint64_t current_time_us) { updateDtDataLpf(current_time_us); - if (_is_faulty || isSampleOutOfDate(current_time_us) || !isDataContinuous()) { + if (isSampleOutOfDate(current_time_us) || !isDataContinuous()) { _is_sample_valid = false; _is_regularly_sending_data = false; return; diff --git a/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.hpp b/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.hpp index e3e4f6e6cd..358b721fd2 100644 --- a/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.hpp +++ b/src/modules/ekf2/EKF/aid_sources/range_finder/sensor_range_finder.hpp @@ -120,8 +120,6 @@ public: float getValidMinVal() const { return _rng_valid_min_val; } float getValidMaxVal() const { return _rng_valid_max_val; } - void setFaulty(bool faulty = true) { _is_faulty = faulty; } - private: void updateSensorToEarthRotation(const matrix::Dcmf &R_to_earth); @@ -141,7 +139,6 @@ private: bool _is_sample_valid{}; ///< true if range finder sample retrieved from buffer is valid bool _is_regularly_sending_data{false}; ///< true if the interval between two samples is less than the maximum expected interval uint64_t _time_last_valid_us{}; ///< time the last range finder measurement was ready (uSec) - bool _is_faulty{false}; ///< the sensor should not be used anymore /* * Stuck check