From a25330762a0b70f5adef6ca5d0672b950f7f82fc Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 10 Jun 2017 14:02:14 +0200 Subject: [PATCH] Commander: Adjust airspeed checks on prearm condition The previous approach would work with old low-end sensors, but with new high-end sensors we get a lot of false alarms on the bench. Relaxing the check to only apply pre-arm will ensure its now only run when the user intents to take off, at which point the airframe should be with pitot covers off in the field. --- src/modules/commander/PreflightCheck.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/PreflightCheck.cpp b/src/modules/commander/PreflightCheck.cpp index d7126cbee7..c955f9cef2 100644 --- a/src/modules/commander/PreflightCheck.cpp +++ b/src/modules/commander/PreflightCheck.cpp @@ -383,9 +383,15 @@ static bool airspeedCheck(orb_advert_t *mavlink_log_pub, bool optional, bool rep goto out; } - if (fabsf(airspeed.confidence) < 0.95f) { + /* + * Check if voter thinks the confidence is low. High-end sensors might have virtually zero noise + * on the bench and trigger false positives of the voter. Therefore only fail this + * for a pre-arm check, as then the cover is off and the natural airflow in the field + * will ensure there is not zero noise. + */ + if (prearm && fabsf(airspeed.confidence) < 0.95f) { if (report_fail) { - mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR COMM ERROR"); + mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR STUCK"); } success = false; goto out;