Plane: not in vtol mode when quadplane not enabled

prevents logging error in auto if quadplane not enabled and running a
VTOL mission command
This commit is contained in:
Andrew Tridgell 2016-04-09 18:48:22 +10:00
parent d03a232659
commit 4a5c4a5189

View File

@ -950,7 +950,7 @@ bool QuadPlane::handle_do_vtol_transition(const mavlink_command_long_t &packet)
*/
bool QuadPlane::in_vtol_auto(void)
{
if (plane.control_mode != AUTO) {
if (!enable || plane.control_mode != AUTO) {
return false;
}
if (plane.auto_state.vtol_mode) {
@ -970,6 +970,9 @@ bool QuadPlane::in_vtol_auto(void)
*/
bool QuadPlane::in_vtol_mode(void)
{
if (!enable) {
return false;
}
return (plane.control_mode == QSTABILIZE ||
plane.control_mode == QHOVER ||
plane.control_mode == QLOITER ||