Repository navigation
Snake: a pass left at its end only if the turn gets there - #232
Merged
Merged
Conversation
A pass worked on the whole but left at the end ahead counts as still to do there (IsPassOpenAtThisEnd), so the snake turns onto it. The turn lands abreast of where it leaves the tractor's pass, and that pass's own end can lie beyond it: a slanting headland, a turn seated back from a hard fence or a tree. Then the turn drives over the worked part only, the end stays as it was, and the whole pass is driven a second time for nothing. On a tester's field (simulator) the turn from 1L onto 2R at the north end, seated back 12.5 m from the fence and a tree, drove all of 2R again. Such a pass is now turned onto only when the turn built gets to what is left: at least 5 m of unworked crop along the turn's last 20 m and 20 m on past it (YouTurnPathingService.TurnReachesUnworkedGround). Otherwise the turn is dropped and the pass counts worked at this end (TurnMissesOpenEnd), for the order's pass and for the nearest open pass alike, and the next one is looked for. On the tester's field no other turn fits at that end, so AutoSteer stops at the end of 1L (as for any end with no turn) instead of driving 2R again. Tests (SnakeOpenEndTests): a pass left to do past where the turn lands on it is worked at this end; the reach test itself. The existing open-end tests still turn onto a pass whose end the turn reaches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKEBDFmQpFVsahedjtN2AZ
renatorgr
marked this pull request as ready for review
November 14, 2026 11:51
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Renato · project thread
What changed
With Ignore worked tracks, a pass worked on the whole but left at the end ahead counts as still to do there (
IsPassOpenAtThisEnd, the Tapada 27R rule), so the snake turns onto it. A turn lands abreast of where it leaves the tractor's pass, and that pass's own end can lie beyond it: a slanting headland line, or a turn seated back from a hard fence or a tree. The turn then drives over the worked part only, the end stays as it was, and the whole pass is driven a second time for nothing.On a tester's field (simulator, beta 2be8132, 14 Nov 10:41) the turn from 1L onto 2R at the north end was seated back 12.5 m (hard fence and a tree), 2R's last ~18 m of crop stayed unpainted, and from 1L the next time the turns onto 3L/4L did not build, so the nearest-open fallback took 2R again: all of 2R driven twice.
Now such a pass is turned onto only when the turn built gets to what is left: at least 5 m of unworked crop along the turn's last 20 m and 20 m on past its end (
YouTurnPathingService.TurnReachesUnworkedGround). Otherwise the turn is dropped, the pass counts worked at this end (YouTurnStateMachine.TurnMissesOpenEnd), and the next pass is looked for: on the next cycle for the order's pass, at once for a nearest open pass. On the tester's field no other turn fits at that end, so AutoSteer now stops at the end of 1L (as at any end with no turn, #197) instead of driving 2R again. A pass left to do at an end the turn reaches is turned onto as before.CLAUDE.md's snake bullet says so. Fork only.
Tests (
SnakeOpenEndTests):TurnReachesUnworkedGroundon a straight exit leg, left past the leg / left on it / no map;Related issue
Follows #228 and #229, from the same day's simulator reports.
Pre-submit checklist
dotnet buildsucceeds with no errorsdotnet testpasses: the U-turn, snake and pipeline tests (2024 passed, before rebasing on Snake: skip passes with no crop at this end when the headland is on #229), the snake tests again after it (67 passed); the full suite runs in CIScreenshots
Not a UI change.
Generated by Claude Code