This commit is contained in:
acki
2026-03-16 19:52:24 +01:00
parent 8df8c64b0d
commit fdcd541ae8

View File

@@ -99,7 +99,7 @@ void DiffBot::notifyWaypointReached(int reachedIndex)
resetPID();
int nextIndex = (reachedIndex + 1) % MAX_WAYPOINTS;
if (targets[nextIndex].active && targets[nextIndex].state != FINAL) {
if (targets[nextIndex].active && targets[reachedIndex].state != FINAL) {
index = nextIndex;
} else {
motor.stop(true);