mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 03:03:34 +08:00
Make the equal value threshold configurable
This commit is contained in:
committed by
Lorenz Meier
parent
00dbffe11d
commit
75520641a5
@@ -138,6 +138,13 @@ public:
|
||||
*/
|
||||
void set_timeout(uint32_t timeout_interval_us) { _timeout_interval = timeout_interval_us; }
|
||||
|
||||
/**
|
||||
* Set the equal count threshold
|
||||
*
|
||||
* @param threshold The number of equal values before considering the sensor stale
|
||||
*/
|
||||
void set_equal_value_threshold(uint32_t threshold) { _value_equal_count_threshold = threshold; }
|
||||
|
||||
/**
|
||||
* Get the timeout value
|
||||
*
|
||||
@@ -170,10 +177,11 @@ private:
|
||||
float _value[dimensions]; /**< last value */
|
||||
float _vibe[dimensions]; /**< vibration level, in sensor unit */
|
||||
float _value_equal_count; /**< equal values in a row */
|
||||
float _value_equal_count_threshold; /**< when to consider an equal count as a problem */
|
||||
DataValidator *_sibling; /**< sibling in the group */
|
||||
static const constexpr unsigned NORETURN_ERRCOUNT = 10000; /**< if the error count reaches this value, return sensor as invalid */
|
||||
static const constexpr float ERROR_DENSITY_WINDOW = 100.0f; /**< window in measurement counts for errors */
|
||||
static const constexpr unsigned VALUE_EQUAL_COUNT_MAX = 100; /**< if the sensor value is the same (accumulated also between axes) this many times, flag it */
|
||||
static const constexpr unsigned VALUE_EQUAL_COUNT_DEFAULT = 100; /**< if the sensor value is the same (accumulated also between axes) this many times, flag it */
|
||||
|
||||
/* we don't want this class to be copied */
|
||||
DataValidator(const DataValidator&) = delete;
|
||||
|
||||
Reference in New Issue
Block a user