Skip to content

Snake: skip passes with no crop at this end when the headland is on - #229

Merged
renatorgr merged 2 commits into
pulverizadorfrom
fix/snake-skip-headland-passes
Nov 14, 2026
Merged

renatorgr merged 2 commits into
pulverizadorfrom
fix/snake-skip-headland-passes

Conversation

@renatorgr

Copy link
Copy Markdown
Owner

Requested by Renato · project thread

Stacked on #228: merge #228 first. This branch has #228's commit under its own, so until #228 is merged the diff shows both.

What changed

Since official AgOpenGPS-Official#816 the U-turn reads the turn line (the fence moved in by the U-turn distance), and so does the snake's landing check (IsPathLandable: 20 m of the next pass inside the area at this end). With the operator's headland on and the sections off in it, a pass lying in the headland band has that room on the turn line and nothing to work: unpainted, it is still to do, so the snake turned onto it.

On a tester's field (simulator, beta 2be8132, 14 Nov 10:12) the snake drove 13L, with 12 m of crop at its far end, and 15L, with none, in a corner of the headland, and only then went back to 12L.

Now a pass the snake turns onto (the order's next pass, or a nearest open one from TurnOntoNearestOpenPass) must also have the landing room inside the headland line when the headland is on and Tool.IsHeadlandSectionControl is set (SnakeLandable). Without a headland, or with the sections on in it, nothing changes: the turn line alone decides, as before.

Tests (SnakeOpenPassTests):

  • new: with the headland on, the order's next pass lying in the headland band is passed over and the next one in the crop is turned onto;
  • new: without the headland, or with the sections on in it, the same pass in the band is turned onto.

CLAUDE.md's snake bullet says so. Fork only.

Related issue

Follows #228 (nearest open pass before a far order pass), from the same day's simulator reports.

Pre-submit checklist

  • dotnet build succeeds with no errors
  • dotnet test passes: the U-turn, snake and headland tests (1758 passed); the full suite runs in CI
  • Tested on: Linux (cloud), plus a replay of the tester's field

Screenshots

Not a UI change.


Generated by Claude Code

With skip mode "Ignore worked tracks", when the snake order's next pass
was more than twice the skip's step away, the nearest pass still to do
was looked for only within twice the skip's step, and then the order's
own pass, further over, was tried. On a tester's field (simulator) the
tractor on 21R had the order's 8R 13 passes over and 15R six over: 15R
was never looked at, the turn onto 8R did not build, and there was no
U-turn (AutoSteer went off at the end of the pass).

Asked before a far order pass, the search now reaches every pass nearer
than the order's, either side. The fallback after the order's pass has
no room or no turn keeps its limit of twice the skip's step. On the
tester's field the turn from 21R onto 15R builds, inside the fence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKEBDFmQpFVsahedjtN2AZ
Since the U-turn reads the turn line (the fence moved in by the U-turn
distance), the snake's landing check found room on a pass lying in the
headland band, where the sections are off: on a tester's field (simulator)
it drove 13L, with 12 m of crop at its far end, and 15L, with none, in a
corner of the headland, and only then went back to 12L.

With the operator's headland on and the sections off in it, a pass the
snake turns onto (the order's or a nearest open one) must also have the
landing room inside the headland line (SnakeLandable). Without a headland,
or with the sections on in it, nothing changes. Fork only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VKEBDFmQpFVsahedjtN2AZ
@renatorgr renatorgr self-assigned this Nov 14, 2026
@renatorgr
renatorgr marked this pull request as ready for review November 14, 2026 11:24
@renatorgr
renatorgr merged commit 4df4c7b into pulverizador Nov 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants