Account for articulated harvester components when moving out of the way#1288
Open
helgehelge123 wants to merge 1 commit into
Open
Account for articulated harvester components when moving out of the way#1288helgehelge123 wants to merge 1 commit into
helgehelge123 wants to merge 1 commit into
Conversation
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>
pvaiko
reviewed
Jul 5, 2026
| -- 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 |
Contributor
There was a problem hiding this comment.
Can we use the existing VehicleSizeScanner here?
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.
Problem
When the unloader moves away from a blocking CP combine (
AIDriveStrategyUnloadCombine:onBlockingVehicle), the parallel course offset is computed asown width/2 + work width/2 + 2around 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
componentsof 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