Airspeed Selector: do not run it within the first 2s after system boot

This is to prevent a wrong (false positive) failure detection of the airspeed
shortly after system boot due to delays in driver and/or estimator startup (seen in SITL).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2020-05-02 17:06:08 +02:00
committed by Daniel Agar
parent 604258ec71
commit 45ebbb895a

View File

@@ -263,6 +263,14 @@ AirspeedModule::check_for_connected_airspeed_sensors()
void
AirspeedModule::Run()
{
_time_now_usec = hrt_absolute_time(); //hrt time of the current cycle
/* do not run the airspeed selector until 2s after system boot, as data from airspeed sensor
and estimator may not be valid yet*/
if (_time_now_usec < 2_s) {
return;
}
perf_begin(_perf_elapsed);
if (!_initialized) {
@@ -276,7 +284,7 @@ AirspeedModule::Run()
update_params();
}
_time_now_usec = hrt_absolute_time(); //hrt time of the current cycle
bool armed = (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED);