Skip to content

Commit

Permalink
AirspeedValidator: suppress log message of sensor switching if on the…
Browse files Browse the repository at this point in the history
… ground and no airspeed sensor connected

Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer committed Sep 16, 2019
1 parent b85a5a5 commit 9ba7418
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/airspeed_selector/airspeed_selector_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ void AirspeedModule::select_airspeed_and_publish()
}

/* publish critical message (and log) in index has changed */
if (_valid_airspeed_index != _prev_airspeed_index) {
/* Suppress log message if still on the ground and no airspeed sensor connected */
if (_valid_airspeed_index != _prev_airspeed_index && (_number_of_airspeed_sensors > 0
|| !_vehicle_land_detected.landed)) {
mavlink_log_critical(&_mavlink_log_pub, "Airspeed: switched from sensor %i to %i", _prev_airspeed_index,
_valid_airspeed_index);
}
Expand Down

0 comments on commit 9ba7418

Please sign in to comment.