Browse Source

Plane: added Q_ENABLE=2 for starting AUTO in VTOL

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
38a7bfd81f
  1. 4
      ArduPlane/quadplane.cpp
  2. 6
      ArduPlane/system.cpp

4
ArduPlane/quadplane.cpp

@ -6,8 +6,8 @@ const AP_Param::GroupInfo QuadPlane::var_info[] = { @@ -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),

6
ArduPlane/system.cpp

@ -426,7 +426,11 @@ void Plane::set_mode(enum FlightMode mode) @@ -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();

Loading…
Cancel
Save