Skip to content

Commit

Permalink
Plane:reset in landing seq on mode change while disarmed
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg authored and tridge committed Oct 18, 2023
1 parent a98def0 commit 410fbb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ArduPlane/mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ bool Mode::enter()
// but it should be harmless to disable the fence temporarily in these situations as well
plane.fence.manual_recovery_start();
#endif
//reset mission if in landing sequence, disarmed, not flying, and have changed to a non-autothrottle mode to clear prearm
if (plane.mission.get_in_landing_sequence_flag() &&
!plane.is_flying() && !plane.arming.is_armed_and_safety_off() &&
!plane.control_mode->does_auto_navigation()) {
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "In landing sequence: mission reset");
plane.mission.reset();
}
}

return enter_result;
Expand Down

0 comments on commit 410fbb9

Please sign in to comment.