Plane: added Q_ENABLE=2 for starting AUTO in VTOL

This commit is contained in:
Andrew Tridgell 2016-04-22 20:20:45 +10:00
parent 0aa1ae048d
commit 38a7bfd81f
2 changed files with 7 additions and 3 deletions

View File

@ -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),

View File

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