Skip to content

Commit

Permalink
fix: headland turn
Browse files Browse the repository at this point in the history
Do not try doing a headland turn if the next
waypoint is on a connecting path.
  • Loading branch information
Peter Vaiko committed Jan 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b837ad9 commit c11ec4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/Course.lua
Original file line number Diff line number Diff line change
@@ -352,11 +352,12 @@ function Course:isTurnStartAtIx(ix)
-- Don't start turns at the last waypoint
-- TODO: do a row finish maneuver instead
return ix < #self.waypoints and
-- if there is a turn start just before a connecting path
-- don't start any turns just before a connecting path as there the pathfinder should take over
(self.waypoints[ix]:isRowEnd() and
not self:isOnConnectingPath(ix + 1) and
not self:shouldUsePathfinderToNextWaypoint(ix)) or
(self.waypoints[ix + 1] and self.waypoints[ix + 1]:isHeadlandTurn())
(self.waypoints[ix + 1] and self.waypoints[ix + 1]:isHeadlandTurn() and
self.waypoints[ix + 2] and not self:isOnConnectingPath(ix + 2))
end

function Course:isHeadlandTurnAtIx(ix)

0 comments on commit c11ec4b

Please sign in to comment.