Skip to content

Account for articulated harvester components when moving out of the way#1288

Open
helgehelge123 wants to merge 1 commit into
Courseplay:mainfrom
helgehelge123:fix/articulated-move-away-offset
Open

Account for articulated harvester components when moving out of the way#1288
helgehelge123 wants to merge 1 commit into
Courseplay:mainfrom
helgehelge123:fix/articulated-move-away-offset

Conversation

@helgehelge123

Copy link
Copy Markdown

Problem

When the unloader moves away from a blocking CP combine (AIDriveStrategyUnloadCombine:onBlockingVehicle), the parallel course offset is computed as own width/2 + work width/2 + 2 around the combine's AI direction node. Articulated harvesters (e.g. the spinach harvester) can stand bent, with the rear component sticking out sideways well beyond that offset - the unloader then keeps touching the rear part and never gets past it.

Solution

Include the lateral extent of all components of the blocking vehicle (max |dx| relative to the direction node + half vehicle width) in the offset calculation, and use it when it exceeds the work-width-based value. For rigid vehicles the computed value stays at (or below) the previous one, so behavior there is unchanged.

Testing

Reproduced with a tractor + trailer blocked by a bent articulated spinach harvester; with the wider offset the unloader clears the rear component. Feedback welcome.

🤖 Generated with Claude Code

When the unloader moves away from a blocking CP combine, the parallel
course offset was computed from the work width around the AI direction
node only. Articulated harvesters (e.g. the spinach harvester) can
stand bent, with the rear component sticking out sideways well beyond
that, so the unloader kept touching the rear part and never got past.

Include the lateral extent of all components of the blocking vehicle
in the offset calculation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tensuko Tensuko requested a review from pvaiko July 4, 2026 22:29
-- the direction node - make sure the offset also clears the widest component, not just
-- the work width around the front part
local maxComponentOffset = 0
for _, component in pairs(blockingVehicle.components) do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the existing VehicleSizeScanner here?

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