mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
airspeed_selector: fix aspd typos
This commit is contained in:
@@ -226,13 +226,13 @@ AirspeedValidator::check_airspeed_innovation(uint64_t time_now, float estimator_
|
||||
|| _tas_innov_integ_threshold <= 0.f) {
|
||||
_innovations_check_failed = false;
|
||||
_time_last_tas_pass = time_now;
|
||||
_apsd_innov_integ_state = 0.f;
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
|
||||
} else if (!lpos_valid || estimator_status_vel_test_ratio > 1.f || estimator_status_mag_test_ratio > 1.f) {
|
||||
//nav velocity data is likely not good
|
||||
//don't run the test but don't reset the check if it had previously failed when nav velocity data was still likely good
|
||||
_time_last_tas_pass = time_now;
|
||||
_apsd_innov_integ_state = 0.f;
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
|
||||
} else {
|
||||
// nav velocity data is likely good so airspeed innovations are able to be used
|
||||
@@ -242,14 +242,14 @@ AirspeedValidator::check_airspeed_innovation(uint64_t time_now, float estimator_
|
||||
const float tas_innov = fabsf(_TAS - air_vel.norm());
|
||||
|
||||
if (tas_innov > _tas_innov_threshold) {
|
||||
_apsd_innov_integ_state += dt_s * (tas_innov - _tas_innov_threshold); // integrate exceedance
|
||||
_aspd_innov_integ_state += dt_s * (tas_innov - _tas_innov_threshold); // integrate exceedance
|
||||
|
||||
} else {
|
||||
// reset integrator used to trigger and record pass if integrator check is disabled
|
||||
_apsd_innov_integ_state = 0.f;
|
||||
_aspd_innov_integ_state = 0.f;
|
||||
}
|
||||
|
||||
if (_tas_innov_integ_threshold > 0.f && _apsd_innov_integ_state < _tas_innov_integ_threshold) {
|
||||
if (_tas_innov_integ_threshold > 0.f && _aspd_innov_integ_state < _tas_innov_integ_threshold) {
|
||||
_time_last_tas_pass = time_now;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
float _tas_innov_integ_threshold{-1.0}; ///< integrator innovation error threshold for triggering innovation check failure
|
||||
uint64_t _time_last_aspd_innov_check{0}; ///< time airspeed innovation was last checked (uSec)
|
||||
uint64_t _time_last_tas_pass{0}; ///< last time innovation checks passed
|
||||
float _apsd_innov_integ_state{0.0f}; ///< integral of excess normalised airspeed innovation (sec)
|
||||
float _aspd_innov_integ_state{0.0f}; ///< integral of excess normalised airspeed innovation (sec)
|
||||
static constexpr uint64_t TAS_INNOV_FAIL_DELAY{1_s}; ///< time required for innovation levels to pass or fail (usec)
|
||||
uint64_t _time_wind_estimator_initialized{0}; ///< time last time wind estimator was initialized (uSec)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user