Skip to content

U-turn: start the turn wherever the tractor joins the path (#306); Field Tools need an open field (#305) - #308

Merged
chriskinal merged 1 commit into
developfrom
fix/uturn-trigger-on-leg
Oct 10, 2026
Merged

chriskinal merged 1 commit into
developfrom
fix/uturn-trigger-on-leg

Conversation

@chriskinal

Copy link
Copy Markdown
Collaborator

Fixes #306, fixes #305.

#306 U-turn in headland ignored

From the dump: the turn was armed 27 m from the headland. The planned path's entry leg (16 m, the current pass itself) put the path's first point 6 m behind the tractor. The trigger fired only within 2 m of that first point, so it never fired; and the "entered headland without triggering" reset was an else if behind the trigger branch, so it could never run. The path stayed on screen while the tractor drove 9 m into the headland.

  • Trigger on being on the path. The tractor is on the path when it is within 1.5 m of the nearest segment and heading along it (within the existing 20° alignment tolerance). The turn starts there, wherever it joined. The heading test keeps the exit leg and an omega's crossing legs from counting.
  • The planner records where the path leaves the pass (ArcStart, through YouTurnCreationOutput → TurnPathResult → YouTurnWorkingState, mirrored in YouTurnState/YouTurnSnapshot). The 20 m approach alarm measures to it rather than to the leg's first point.
  • Arc already behind the tractor: the turn is replanned from the tractor's position (the manual turn's arc, to the same next track) and started; with no room for that, the path is dropped with the too-close sound and "U-turn missed: too close to the headland to turn. Take over manually."
  • Entered the headland off the path: dropped with the sound and "U-turn missed: entered the headland off the turn path. Take over manually."

Tests (YouTurnTriggerOnPathTests): on the leg → starts; beside the path, or heading the other way → not; short of the path → countdown published; alarm measures to the arc; in the headland off the path → dropped with sound and message; arc behind → replanned and executing; and through the real planner, a turn armed 15 m before the turn line (path start 7 m behind the tractor, as in the report) starts on the same tick. YouTurnDistanceToTriggerTests paths now run along the AB line so the on-path rule applies.

#305 Delete applied area with no field

Delete Applied Area, Boundary and Field Builder show "Open a field first" instead of acting on nothing; DeleteAppliedAreaConfirmed refuses on the host too.

Checks

  • Models 167, ViewModels 308, Services 1512 tests pass; i18n-extract.py --check clean; Desktop builds.
  • Not replayed on the bench against the reporter's field; the planner test reproduces the geometry of the report.

🤖 Generated with Claude Code

…d Tools on an open field

#306: an automatic turn fired only within 2 m of the planned path's first
point. The path begins with an entry leg that is the current pass itself,
so a turn armed late (its first point already behind the tractor) never
fired, and the branch that discards a path on entering the headland was
unreachable behind the trigger branch: the path stayed on screen while the
tractor drove into the headland with no warning.

Now the tractor is on the path when it is within 1.5 m of its nearest
segment and heading along it, and the turn starts there. The planner
records where the path leaves the pass (ArcStart); the approach alarm
measures to it, and when it is already behind the tractor the turn is
replanned from the tractor's position like a manual turn, or dropped with
the too-close sound when there is no room. A path never joined is dropped
with a sound and a message on entering the headland.

#305: Delete Applied Area, Boundary and Field Builder tell the operator to
open a field first instead of acting on none; the host refuses too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chriskinal
chriskinal merged commit 684417d into develop Oct 10, 2026
4 checks passed
@chriskinal
chriskinal deleted the fix/uturn-trigger-on-leg branch October 10, 2026 17:59
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.

U-turn in headland ignored Delete applied area

1 participant