Skip to content

Commit a8e6b4c

Browse files
authored
Merge pull request #807 from Courseplay/unloader-alignment
feat: unloader alignment to moving combine
2 parents 31e18f0 + e16582d commit a8e6b4c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,12 @@ end
12121212
function AIDriveStrategyUnloadCombine:isLinedUpWithPipe(dx, dz, pipeOffset, debugEnabled)
12131213
-- allow more offset when further away from the pipe, this is +- 50 cm at the pipe and grows
12141214
-- 25 cm with every meter, which is about 30 degrees (15 left and 15 right)
1215-
local tolerance = 0.25 + 0.5 * math.abs(dz)
1215+
local tolerance = 0.55 + 0.5 * math.abs(dz)
1216+
local combineSpeed = self.combineToUnload.lastSpeedReal * 3600
1217+
if combineSpeed > 6 then
1218+
-- when the combine is moving, we can be more tolerant as we'll have a lot more space to align
1219+
tolerance = 2 * tolerance
1220+
end
12161221
self:debugIf(debugEnabled, 'isLinedUpWithPipe: dx > pipe offset +- tolerance (%.1f > %.1f +- %.1f) at dz: %.1f',
12171222
dx, pipeOffset, tolerance, dz)
12181223
return dx > pipeOffset - tolerance and dx < pipeOffset + tolerance

0 commit comments

Comments
 (0)