Skip to content

Commit fef7447

Browse files
committed
Reset the manual waypoint controller on entry into autonomous mode
This removes all manual wayoints when you enter autonomous mode to prevent the rover from immediately driving to whatever waypoints it had before entering manual mode. (#130)
1 parent d27e2f1 commit fef7447

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/behaviours/src/LogicController.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ void LogicController::SetModeAuto() {
374374
if(processState == PROCESS_STATE_MANUAL) {
375375
// only do something if we are in manual mode
376376
this->Reset();
377+
manualWaypointController.Reset();
377378
}
378379
}
379380
void LogicController::SetModeManual()

src/behaviours/src/ManualWaypointController.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ManualWaypointController::~ManualWaypointController() {}
99

1010
void ManualWaypointController::Reset() {
1111
waypoints.clear();
12+
num_waypoints = 0;
13+
cleared_waypoints.clear();
1214
}
1315

1416
bool ManualWaypointController::HasWork() {

0 commit comments

Comments
 (0)