Skip to content

Commit

Permalink
Copter: auto RTL: don't switch modes if already in auto
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 authored and rmackay9 committed Aug 30, 2021
1 parent d31f3eb commit 09f1a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ArduCopter/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ bool ModeAuto::jump_to_landing_sequence_auto_RTL(ModeReason reason)
{
if (mission.jump_to_landing_sequence()) {
mission.set_force_resume(true);
if (set_mode(Mode::Number::AUTO, reason)) {
// if not already in auto switch to auto
if ((copter.flightmode == &copter.mode_auto) || set_mode(Mode::Number::AUTO, reason)) {
auto_RTL = true;
return true;
}
Expand Down

0 comments on commit 09f1a3d

Please sign in to comment.