From cbb0bfb809cc451ef561d9a6867167d2279aeef8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 19 Feb 2019 20:59:19 +1100 Subject: [PATCH] Plane: is_flying_vtol: if spool mode is shut down we are not flying The subsequent check for get_throttle passes if you switch from QHOVER to MANUAL on the ground while armed. get_throttle returns > 0.01 - but the motors are shut down so no output occurs. --- ArduPlane/quadplane.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index 82de93d1de..450f9b85aa 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -1053,6 +1053,10 @@ bool QuadPlane::is_flying_vtol(void) const if (!available()) { return false; } + if (motors->get_spool_mode() == AP_Motors::SHUT_DOWN) { + // assume that with no motor outputs we're not flying in VTOL mode + return false; + } if (motors->get_throttle() > 0.01f) { // if we are demanding more than 1% throttle then don't consider aircraft landed return true;