Skip to content

Commit a7f1cc7

Browse files
author
Peter Vaiko
committed
fix: connecting path transition
Fix a rare race condition where the PPC still had the finish row course while the pathfinder was working on the connecting path. The PPC called the strategy's listeners with the finish row course waypoint index, which was interpreted by the listener as a main fieldwork course waypoint, leading to start a headland turn already passed. #735
1 parent 3a6cb60 commit a7f1cc7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

scripts/ai/strategies/AIDriveStrategyFieldWorkCourse.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ function AIDriveStrategyFieldWorkCourse:startConnectingPath(ix)
613613
self:debug('Connecting path has %d waypoints, start pathfinding to target waypoint %d, zOffset %.1f',
614614
#connectingPath, targetWaypointIx, zOffset)
615615
self.state = self.states.WAITING_FOR_PATHFINDER
616+
-- to have a course set while waiting for the pathfinder and make sure that the course known to the PPC
617+
-- is the same as the one we are using
618+
self:startCourse(self.rawConnectingPath, 1)
616619
self.pathfinderController:findPathToNode(context, targetNode, 0, zOffset, 1)
617620
end
618621
end

0 commit comments

Comments
 (0)