Browse Source

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>
sbg
Silvan Fuhrer 5 years ago committed by Daniel Agar
parent
commit
45ebbb895a
  1. 10
      src/modules/airspeed_selector/airspeed_selector_main.cpp

10
src/modules/airspeed_selector/airspeed_selector_main.cpp

@ -263,6 +263,14 @@ AirspeedModule::check_for_connected_airspeed_sensors() @@ -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() @@ -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);

Loading…
Cancel
Save