Skip to content

Commit febf885

Browse files
author
Peter Vaiko
committed
fix: no pocket headland turn for root veggie harvesters
#786
1 parent 900adcd commit febf885

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

scripts/ai/controllers/CombineController.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ function CombineController:isDroppingStrawSwath()
128128
return self.combineSpec.strawPSenabled
129129
end
130130

131+
function CombineController:isRootVegetableHarvester()
132+
for _, fruitTypeIndex in pairs(CpUtil.getAllRootVegetables()) do
133+
local fillUnitIndex = g_fruitTypeManager:getFillTypeIndexByFruitTypeIndex(fruitTypeIndex)
134+
self:debug("check if fruitType %s is supported", g_fillTypeManager:getFillTypeNameByIndex(fillUnitIndex))
135+
for i, _ in ipairs(self.implement:getFillUnits()) do
136+
if self.implement:getFillUnitSupportsFillType(i, fillUnitIndex) then
137+
self:debug('This is a root vegetable harvester.')
138+
return true
139+
end
140+
end
141+
end
142+
return false
143+
end
144+
131145
--- Is this a towed harvester? We don't want these to make combine headland turns (or make pockets?)
132146
function CombineController:isTowed()
133147
return self.isWheeledImplement

scripts/ai/strategies/AIDriveStrategyCombineCourse.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,8 @@ function AIDriveStrategyCombineCourse:startTurn(ix)
14151415
elseif self.course:isOnConnectingPath(ix) then
14161416
self:debug('Headland turn but this a connecting track, use normal turn maneuvers.')
14171417
AIDriveStrategyFieldWorkCourse.startTurn(self, ix)
1418-
elseif self.course:isOnOutermostHeadland(ix) and self:isTurnOnFieldActive() then
1418+
elseif self.course:isOnOutermostHeadland(ix) and self:isTurnOnFieldActive() and
1419+
not self.combineController:isRootVegetableHarvester()then
14191420
self:debug('Creating a pocket in the corner so the combine stays on the field during the turn')
14201421
self.aiTurn = CombinePocketHeadlandTurn(self.vehicle, self, self.ppc, self.proximityController, self.turnContext,
14211422
self.course, self:getWorkWidth())

0 commit comments

Comments
 (0)