From 345246953b5c4d68097501eb0a4145715b4647f3 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 18 Feb 2016 09:32:44 +0100 Subject: [PATCH] Airspeed pre-flight check: do not arm if sensor data is stuck or bus errors are high --- src/modules/commander/PreflightCheck.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/commander/PreflightCheck.cpp b/src/modules/commander/PreflightCheck.cpp index 7ca59d5a2b..57f43959bd 100644 --- a/src/modules/commander/PreflightCheck.cpp +++ b/src/modules/commander/PreflightCheck.cpp @@ -341,6 +341,14 @@ static bool airspeedCheck(int mavlink_fd, bool optional, bool report_fail) goto out; } + if (fabsf(airspeed.confidence) < 0.99f) { + if (report_fail) { + mavlink_and_console_log_critical(mavlink_fd, "PREFLIGHT FAIL: AIRSPEED SENSOR COMM ERROR"); + } + success = false; + goto out; + } + if (fabsf(airspeed.indicated_airspeed_m_s) > 6.0f) { if (report_fail) { mavlink_and_console_log_critical(mavlink_fd, "AIRSPEED WARNING: WIND OR CALIBRATION ISSUE");