Skip to content

Commit 0493588

Browse files
author
Peter Vaiko
committed
feat: loop turns are now a setting
Loop (270 degree) turns on headlands can now be set on for any vehicle in the CP settings. When activated, the vehicle will do a 270 turn instead of the normal headland turn maneuver.
1 parent 72e291d commit 0493588

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

config/VehicleSettingsSetup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
<!--Pathfinder Reverse-->
3737
<Setting classType="AIParameterBooleanSetting" name="allowReversePathfinding" defaultBool="true" isExpertModeOnly="true" isVisible="areCourseSettingsVisible"/>
3838
<Setting classType="AIParameterBooleanSetting" name="allowPathfinderTurns" defaultBool="false" isExpertModeOnly="true" isVisible="areCourseSettingsVisible"/>
39+
<!--Loop turns on headland-->
40+
<Setting classType="AIParameterBooleanSetting" name="loopTurnsOnHeadland" defaultBool="true" isExpertModeOnly="true" isVisible="areCourseSettingsVisible"/>
3941
</SettingSubTitle>
4042

4143
<SettingSubTitle title="implement">

scripts/ai/turns/AITurn.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ function CourseTurn:generateCalculatedTurn()
743743
local turnManeuver
744744
if self.turnContext:isHeadlandCorner() then
745745
self:debug('This is a headland turn')
746-
if self.hasChainedAttachments then
746+
if self.settings.loopTurnsOnHeadland:getValue() then
747747
-- do a 270° turn forward only
748748
turnManeuver = LoopTurnManeuver(self.vehicle, self.turnContext, self.vehicle:getAIDirectionNode(),
749749
self.turningRadius, self.workWidth, self.steeringLength)

0 commit comments

Comments
 (0)