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.
This commit is contained in:
Peter Barker 2019-02-19 20:59:19 +11:00 committed by Andrew Tridgell
parent b47b97a981
commit cbb0bfb809
1 changed files with 4 additions and 0 deletions

View File

@ -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;