Repository navigation
Snake, manual U-turn, line entry: same to-do pass test - #235
Merged
Merged
Conversation
Three places that decide "is this pass still to do" disagreed after the turn line (#214) and the painted-map rules (#201, #232, #234): - Snake order and its worked test read the turn line, so passes lying only in the headland band (turn line .. headland line) were in the order and, with sections off in the headland, never painted. They stayed "to do" and hid real passes: "End of field reached" with crop left. With the headland on and sections off in it, the order and the worked test now use the crop (WorkHeadlandLine). - A manual U-turn with "Ignore worked tracks" still used the old Track.WorkedPaths mark through ComputeNextTrack and GetNextUnworkedPathSkip. It now uses the same painted-map test as the auto turn. - Joining the nearest open pass when AutoSteer is engaged (#226) only checked the whole pass. It now also skips a pass whose piece on this side of a bay is done (IsPassToJoin). Tests: band pass hidden / painted, only band left = field complete, manual U-turn over map-worked passes, bay piece done on line entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKEBDE58NYzgHvbtTAtxnz
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
A review of the fork's line-entry, U-turn and snake fixes (#189 to #234) found three places that answer "is this pass still to do?" differently. This PR makes them agree.
HeadlandLineis the turn line (fence minus the U-turn distance, 2 m). The snake order and its whole-pass test read that line, so a pass lying only in the band between the turn line and the operator's headland line (12 m) was in the order. With sections off in the headland it is never painted, so it stayed "to do" for ever, and when it came next in the order the passes behind it were not reached: "End of field reached" with crop left. Snake: skip passes with no crop at this end when the headland is on #229 only stopped the turn from landing on such a pass.Now, with the headland on and
IsHeadlandSectionControlon, the order, its stamp, the stale-path check,SnakeLandableandWorkedPassesall use the crop (WorkHeadlandLine) through one helper,SnakeArea. A pass with no crop is not in the order; the headland laps cover it. Headland off, or sections on in the headland: unchanged (turn line).ComputeNextTrack) and the end of a turn with no snake plan (GetNextUnworkedPathSkip) still askedTrack.WorkedPaths, the mark Snake: a pass is worked by the map, not by a section on it #234 dropped for auto turns. A pass with 10 m painted was skipped. Both now take the same painted-map test as the auto turn (WorkedPasses); with no map the mark is still used.YouTurnStateMachine.IsPassToJoin: not worked on the whole (same area as the snake), and, where a bay cuts the pass, its piece from the end the entry path reaches is not done (IsPieceDoneAtThisEnd, Snake: a pass is worked by the map, not by a section on it #234). A pass worked on the whole is still not joined even when its end is open, so AutoSteer only joins clean passes.No change to the snake order rules themselves (#223/#228 far pass, #232 open end, #201 open end on a worked pass). CLAUDE.md and README.md updated.
Fork only, nothing for official.
Related issue
Relates to #214, #226, #229, #234.
Pre-submit checklist
dotnet buildsucceeds with no errorsdotnet testpasses: allYouTurn, snake andNearestOpenPassEntrytests pass locally; the full Services run shows onlyCoverageTileTests.An_old_display_folder_that_cannot_be_removed_does_not_fail_the_save, which fails only when the tests run as root (cloud container), not on CI.New tests (each fails on
pulverizadorbefore this fix):SnakeOpenEndTests.A_pass_in_the_headland_band_does_not_hide_a_pass_still_to_do(band painted and not painted: the turn goes to pass -5, the band passes are not in the order)SnakeOpenEndTests.With_only_the_headland_band_left_the_field_is_completeSnakeOpenEndTests.A_manual_u_turn_steps_over_the_passes_the_map_says_are_worked(lands on pass 2, before on 3)NearestOpenPassEntryTests.A_pass_whose_piece_on_this_side_of_a_bay_is_done_is_passed_overChanged:
SnakeOpenPassTests.A_pass_lying_in_the_headland_band_is_not_turned_onto_with_the_headland_onnow checks the band pass is not in the order at all.Job harness, W1 and W2 (snake order), base vs this PR
Run in a cloud container,
AGOPENWEB_SCENARIO_ONLY=W1,W2,RigJobScenarioTests,pulverizador4da09f0 against this branch, then compared withTools/compare-reports.py: 0 findings new, 0 gone, 1 in both (TURN-ONTO-WORKED-PASSon W1, unchanged).W2, with the YouTurn debug log: on the base the order ran from -8 to 11, passes -8, -7, 10 and 11 lying only in the headland band. From pass -1 the order's next pass was band pass -7, so the turn fell back to the nearest pass, 1. With this PR the order is -6..9 and goes on to 2, as the snake plans. At the end, on the base, pass 8 (its crop already done, its band strip unpainted) still counted as to do: the turn went 2 -> 8 along the headland (84 s), drove 8's band strip and turned onto 7, whose crop is only at that end. With this PR pass 8 counts as done, pass 7 has no crop at the tractor's end, and AgOpenWeb says "End of field reached - no room on the next pass at this end" with pass 7's corner piece (about 120 m²) left for the operator. That is the rule kept since #234: a turn does not cross to the other end to reach a pass's piece there.
W1's 44.5 % left is the Baetas bay (official AgOpenGPS-Official#815) and is the same with and without this PR.
Screenshots
None, no UI change.
https://claude.ai/code/session_01VKEBDE58NYzgHvbtTAtxnz
Generated by Claude Code