Skip to content

Commit

Permalink
Rover: resetting reversed flag more generally
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-to-society committed Jun 17, 2024
1 parent e83afcf commit 45fef25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rover/mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ bool Mode::enter()

// initialisation common to all modes
if (ret) {
set_reversed(false);
// reset reversed for autopilot mode except auto
if (is_autopilot_mode() && mode_number() != Mode::Number::AUTO) {
set_reversed(false);
}

// clear sailboat tacking flags
g2.sailboat.clear_tack();
Expand Down
5 changes: 5 additions & 0 deletions Rover/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ bool ModeAuto::_enter()
// initialise waypoint navigation library
g2.wp_nav.init();

// reset reversed
if (!mission.is_resume()) {
g2.wp_nav.set_reversed(false);
}

// other initialisation
auto_triggered = false;

Expand Down

0 comments on commit 45fef25

Please sign in to comment.