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 May 3, 2024
1 parent e5ea8f1 commit c612faf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ArduPlane/mode_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ bool ModeRTL::_enter()
return true;
}

// treat RTL as QLAND if we are armed and idling in a q-mode on the ground
// (when disarmed, allow RTL mode, so pilots can test switches)
if (plane.arming.is_armed() &&
plane.control_mode->is_vtol_mode() &&
plane.quadplane.motors->get_desired_spool_state() == AP_Motors::DesiredSpoolState::GROUND_IDLE) {
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 c612faf

Please sign in to comment.