Skip to content

Commit

Permalink
Plane: tailsitter: add enable = 2 for force q assit and assisted flig…
Browse files Browse the repository at this point in the history
…ht airmode
  • Loading branch information
IamPete1 authored and tridge committed Aug 31, 2021
1 parent f1477a6 commit 7f8b7b6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ArduPlane/tailsitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ const AP_Param::GroupInfo Tailsitter::var_info[] = {

// @Param: ENABLE
// @DisplayName: Enable Tailsitter
// @Description: This enables Tailsitter functionality
// @Values: 0:Disable,1:Enable
// @Description: This enables Tailsitter functionality, 2: forces Qassist active and always stabilize in forward flight with airmode for stabalisation at 0 throttle, for use on vehicles with no control surfaces, vehicle will not arm in forward flight modes, see also Q_OPTIONS "Mtrs_Only_Qassist"
// @User: Standard
// @RebootRequired: True
AP_GROUPINFO_FLAGS("ENABLE", 1, Tailsitter, enable, 0, AP_PARAM_FLAG_ENABLE),
Expand Down Expand Up @@ -185,6 +184,16 @@ void Tailsitter::setup()
AP_Param::set_defaults_from_table(defaults_table_tailsitter, ARRAY_SIZE(defaults_table_tailsitter));
}

// Setup for control surface less operation
if (enable == 2) {
quadplane.q_assist_state = QuadPlane::Q_ASSIST_STATE_ENUM::Q_ASSIST_FORCE;
quadplane.air_mode = AirMode::ASSISTED_FLIGHT_ONLY;

// Do not allow arming in forward flight modes
// motors will become active due to assisted flight airmode, the vehicle will try very hard to get level
quadplane.options.set(quadplane.options.get() | QuadPlane::OPTION_ONLY_ARM_IN_QMODE_OR_AUTO);
}

}

/*
Expand Down

0 comments on commit 7f8b7b6

Please sign in to comment.