mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 13:07:35 +08:00
Revert "EKF: Release flow speed limit with altitude gained" (#382)
* Revert "EKF: Release flow speed limit with altitude gained" This reverts commite70206f74b. * Revert "fix code style" This reverts commit76bf70121c. * Revert "Reverse the linked list of data_validator_group and maintain a first node" This reverts commit32482e7644.
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#include "data_validator.h"
|
||||
#include <ecl/ecl.h>
|
||||
|
||||
DataValidator::DataValidator() :
|
||||
DataValidator::DataValidator(DataValidator *prev_sibling) :
|
||||
_error_mask(ERROR_FLAG_NO_ERROR),
|
||||
_timeout_interval(20000),
|
||||
_time_last(0),
|
||||
@@ -58,7 +58,7 @@ DataValidator::DataValidator() :
|
||||
_vibe{0.0f},
|
||||
_value_equal_count(0),
|
||||
_value_equal_count_threshold(VALUE_EQUAL_COUNT_DEFAULT),
|
||||
_sibling(nullptr)
|
||||
_sibling(prev_sibling)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class __EXPORT DataValidator {
|
||||
public:
|
||||
static const unsigned dimensions = 3;
|
||||
|
||||
DataValidator();
|
||||
DataValidator(DataValidator *prev_sibling = nullptr);
|
||||
virtual ~DataValidator() = default;
|
||||
|
||||
/**
|
||||
@@ -72,12 +72,6 @@ public:
|
||||
*/
|
||||
DataValidator* sibling() { return _sibling; }
|
||||
|
||||
/**
|
||||
* Set the sibling to the next node in the group
|
||||
*
|
||||
*/
|
||||
void setSibling(DataValidator* sibling) { _sibling = sibling; }
|
||||
|
||||
/**
|
||||
* Get the confidence of this validator
|
||||
* @return the confidence between 0 and 1
|
||||
|
||||
@@ -45,30 +45,19 @@
|
||||
|
||||
DataValidatorGroup::DataValidatorGroup(unsigned siblings) :
|
||||
_first(nullptr),
|
||||
_last(nullptr),
|
||||
_curr_best(-1),
|
||||
_prev_best(-1),
|
||||
_first_failover_time(0),
|
||||
_toggle_count(0)
|
||||
{
|
||||
DataValidator *next = nullptr;
|
||||
DataValidator *prev = nullptr;
|
||||
DataValidator *next = _first;
|
||||
|
||||
for (unsigned i = 0; i < siblings; i++) {
|
||||
next = new DataValidator();
|
||||
if(i == 0) {
|
||||
_first = next;
|
||||
} else {
|
||||
prev->setSibling(next);
|
||||
}
|
||||
prev = next;
|
||||
next = new DataValidator(next);
|
||||
}
|
||||
|
||||
_last = next;
|
||||
|
||||
if(_first) {
|
||||
_timeout_interval_us = _first->get_timeout();
|
||||
}
|
||||
_first = next;
|
||||
_timeout_interval_us = _first->get_timeout();
|
||||
}
|
||||
|
||||
DataValidatorGroup::~DataValidatorGroup()
|
||||
@@ -82,14 +71,13 @@ DataValidatorGroup::~DataValidatorGroup()
|
||||
|
||||
DataValidator *DataValidatorGroup::add_new_validator()
|
||||
{
|
||||
DataValidator *validator = new DataValidator();
|
||||
DataValidator *validator = new DataValidator(_first);
|
||||
if (!validator) {
|
||||
return nullptr;
|
||||
}
|
||||
_last->setSibling(validator);
|
||||
_last = validator;
|
||||
_last->set_timeout(_timeout_interval_us);
|
||||
return _last;
|
||||
_first = validator;
|
||||
_first->set_timeout(_timeout_interval_us);
|
||||
return _first;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -133,8 +133,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
DataValidator *_first; /**< first node in the group */
|
||||
DataValidator *_last; /**< last node in the group */
|
||||
DataValidator *_first; /**< sibling in the group */
|
||||
uint32_t _timeout_interval_us; /**< currently set timeout */
|
||||
int _curr_best; /**< currently best index */
|
||||
int _prev_best; /**< the previous best index */
|
||||
|
||||
Reference in New Issue
Block a user