From 38a7bfd81f885e210fa0a1d05b1f07f15d261176 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 22 Apr 2016 20:20:45 +1000 Subject: [PATCH] Plane: added Q_ENABLE=2 for starting AUTO in VTOL --- ArduPlane/quadplane.cpp | 4 ++-- ArduPlane/system.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index c767e700b5..6dff088498 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -6,8 +6,8 @@ const AP_Param::GroupInfo QuadPlane::var_info[] = { // @Param: ENABLE // @DisplayName: Enable QuadPlane - // @Description: This enables QuadPlane functionality, assuming quad motors on outputs 5 to 8 - // @Values: 0:Disable,1:Enable + // @Description: This enables QuadPlane functionality, assuming multicopter motors start on output 5. If this is set to 2 then when starting AUTO mode it will initially be in VTOL AUTO mode. + // @Values: 0:Disable,1:Enable,2:Enable VTOL AUTO // @User: Standard AP_GROUPINFO_FLAGS("ENABLE", 1, QuadPlane, enable, 0, AP_PARAM_FLAG_ENABLE), diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index 6afe0f6266..78396b875e 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -426,7 +426,11 @@ void Plane::set_mode(enum FlightMode mode) case AUTO: auto_throttle_mode = true; - auto_state.vtol_mode = false; + if (quadplane.available() && quadplane.enable == 2) { + auto_state.vtol_mode = true; + } else { + auto_state.vtol_mode = false; + } next_WP_loc = prev_WP_loc = current_loc; // start or resume the mission, based on MIS_AUTORESET mission.start_or_resume();