Skip to content

Commit

Permalink
quadplane: mode_rtl: don't RTL on the ground
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong13 committed Dec 4, 2023
1 parent 60ceaec commit 8555a4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ArduPlane/mode_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ bool ModeRTL::_enter()
return true;
}

// treat RTL as QLAND if we are armed but not flying
// (when disarmed, allow RTL mode, so pilots can test switches)
if (plane.arming.is_armed() && !plane.is_flying()) {
plane.set_mode(plane.mode_qland, ModeReason::QLAND_INSTEAD_OF_RTL);
return true;
}

// if Q_RTL_MODE is QRTL always, immediately switch to QRTL mode
if (plane.quadplane.rtl_mode == QuadPlane::RTL_MODE::QRTL_ALWAYS) {
plane.set_mode(plane.mode_qrtl, ModeReason::QRTL_INSTEAD_OF_RTL);
Expand Down

0 comments on commit 8555a4b

Please sign in to comment.