Browse Source

Airspeed selector: fix condition for messaging (#19173)

Change warning message after airspeed failure on the ground, 
recommend RTL only if flying.
master
Yannick Fuhrer 3 years ago committed by GitHub
parent
commit
26ea70e729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/modules/airspeed_selector/airspeed_selector_main.cpp

10
src/modules/airspeed_selector/airspeed_selector_main.cpp

@ -593,9 +593,13 @@ void AirspeedModule::select_airspeed_and_publish()
// print warning or info, depending of whether airspeed got declared invalid or healthy // print warning or info, depending of whether airspeed got declared invalid or healthy
if (_valid_airspeed_index != _prev_airspeed_index && if (_valid_airspeed_index != _prev_airspeed_index &&
(_number_of_airspeed_sensors > 0 || !_vehicle_land_detected.landed) && _number_of_airspeed_sensors > 0) {
_valid_airspeed_index != _prev_airspeed_index) { if (_vehicle_status.arming_state == !vehicle_status_s::ARMING_STATE_ARMED && _prev_airspeed_index > 0) {
if (_prev_airspeed_index > 0) { mavlink_log_critical(&_mavlink_log_pub, "Airspeed sensor failure detected. Check connection and reboot.\t");
events::send(events::ID("airspeed_selector_sensor_failure_disarmed"), events::Log::Critical,
"Airspeed sensor failure detected. Check connection and reboot");
} else if (_prev_airspeed_index > 0) {
mavlink_log_critical(&_mavlink_log_pub, "Airspeed sensor failure detected. Return to launch (RTL) is advised.\t"); mavlink_log_critical(&_mavlink_log_pub, "Airspeed sensor failure detected. Return to launch (RTL) is advised.\t");
events::send(events::ID("airspeed_selector_sensor_failure"), events::Log::Critical, events::send(events::ID("airspeed_selector_sensor_failure"), events::Log::Critical,
"Airspeed sensor failure detected. Return to launch (RTL) is advised"); "Airspeed sensor failure detected. Return to launch (RTL) is advised");

Loading…
Cancel
Save