Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 286 additions & 27 deletions README.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions config/VehicleConfigurations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ You can define the following custom settings:
<!--Harvester-->

<!--Implements-->
<Vehicle name="proceedV.xml"
implementWheelAlwaysOnGround = "true"
/>

<!--Premium-->
<Vehicle name="p3CLProfi.xml"
Expand Down
2 changes: 1 addition & 1 deletion config/VehicleSettingsSetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<!--Unload on first Headland-->
<Setting classType="AIParameterBooleanSetting" name="unloadOnFirstHeadland" defaultBool="false" isExpertModeOnly="true"/>
<!--UnloadLevel-->
<Setting classType="AIParameterSettingList" name="callUnloaderPercent" min="60" max="90" incremental="5" default ="80" unit="4" isExpertModeOnly="false"/>
<Setting classType="AIParameterSettingList" name="callUnloaderPercent" min="20" max="90" incremental="5" default ="80" unit="4" isExpertModeOnly="false"/>
<!--Strawswath-->
<Setting classType="AIParameterSettingList" name="strawSwath" default="2">
<Values>
Expand Down
7 changes: 7 additions & 0 deletions modDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Changelog 8.1.0.3
<sourceFile filename="scripts/ai/InfoTextsManager.lua"/>
<sourceFile filename="scripts/ai/PurePursuitController.lua"/>
<sourceFile filename="scripts/ai/SelfUnloadHelper.lua"/>
<sourceFile filename="scripts/ai/CpManualCombineProxy.lua"/>
<sourceFile filename="scripts/ai/VehicleScanner.lua"/>
<sourceFile filename="scripts/ai/AIReverseDriver.lua"/>

Expand Down Expand Up @@ -346,6 +347,7 @@ Changelog 8.1.0.3
<sourceFile filename="scripts/events/CpJobStartAtLastWpSyncEvent.lua"/>
<sourceFile filename="scripts/events/CpJobSyncOnLeaveEvent.lua"/>
<sourceFile filename="scripts/events/DriveNowRequestEvent.lua"/>
<sourceFile filename="scripts/events/CpManualUnloaderEvent.lua"/>
<sourceFile filename="scripts/events/PlowCenterTurnEvent.lua"/>
<sourceFile filename="scripts/events/FieldPolygonChangedEvent.lua"/>

Expand Down Expand Up @@ -434,6 +436,10 @@ Changelog 8.1.0.3
<binding device="KB_MOUSE_DEFAULT" input="KEY_lalt KEY_g" />
</actionBinding>

<actionBinding action="CP_CALL_GRAIN_CART">
<binding device="KB_MOUSE_DEFAULT" input="KEY_lctrl KEY_u" />
</actionBinding>

<actionBinding action="CP_TOGGLE_MOUSE">
<binding device="KB_MOUSE_DEFAULT" input="MOUSE_BUTTON_RIGHT" />
</actionBinding>
Expand Down Expand Up @@ -463,6 +469,7 @@ Changelog 8.1.0.3
<action name="CP_OPEN_COURSEMANAGER"/>
<action name="CP_OPEN_INGAME_MENU"/>

<action name="CP_CALL_GRAIN_CART" />
<action name="CP_TOGGLE_MOUSE" />
</actions>
</modDesc>
39 changes: 21 additions & 18 deletions scripts/ai/CollisionAvoidanceController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,28 @@ function CollisionAvoidanceController:findPotentialCollisions()
if AIDriveStrategyCombineCourse.isActiveCpCombine(vehicle) then
local d = calcDistanceFrom(self.vehicle.rootNode, vehicle.rootNode)
if d < self.range then
local myCourse = self.strategy:getCurrentCourse()
local otherCourse = vehicle:getCpDriveStrategy():getCurrentCourse()
local myDistanceToCollision, otherDistanceToCollision = myCourse:intersects(otherCourse, self.lookahead, true)
if myDistanceToCollision then
-- our course intersects with this vehicle's course (lastSpeedReal is in m/ms)
-- for our own ETE, we always use the field speed and not the actual speed. This is to make sure
-- we come to a full stop on a warning and remain stopped while the warning is active
local myEte = myDistanceToCollision / (self.strategy:getFieldSpeed())
local otherEte = CpMathUtil.divide(otherDistanceToCollision, (vehicle.lastSpeedReal * 1000))
-- self:debug('Checking %s at %.1f m, %.1f, ETE %.1f %.1f', CpUtil.getName(vehicle), d, myDistanceToCollision, myEte, otherEte)
if math.abs(myEte - otherEte) < self.eteDiffThreshold then
if not self.warning:get() or (self.warning:get() and vehicle ~= self.warningVehicle) then
-- no warning is active yet, or there is, but this is a different vehicle
self:debug('collision warning: my course intersects with %s in %.1f m, my ETE %.1f, other ETE %.1f',
CpUtil.getName(vehicle), myDistanceToCollision, myEte, otherEte)
local otherStrategy = vehicle:getCpDriveStrategy()
if otherStrategy then
local myCourse = self.strategy:getCurrentCourse()
local otherCourse = otherStrategy:getCurrentCourse()
local myDistanceToCollision, otherDistanceToCollision = myCourse:intersects(otherCourse, self.lookahead, true)
if myDistanceToCollision then
-- our course intersects with this vehicle's course (lastSpeedReal is in m/ms)
-- for our own ETE, we always use the field speed and not the actual speed. This is to make sure
-- we come to a full stop on a warning and remain stopped while the warning is active
local myEte = myDistanceToCollision / (self.strategy:getFieldSpeed())
local otherEte = CpMathUtil.divide(otherDistanceToCollision, (vehicle.lastSpeedReal * 1000))
-- self:debug('Checking %s at %.1f m, %.1f, ETE %.1f %.1f', CpUtil.getName(vehicle), d, myDistanceToCollision, myEte, otherEte)
if math.abs(myEte - otherEte) < self.eteDiffThreshold then
if not self.warning:get() or (self.warning:get() and vehicle ~= self.warningVehicle) then
-- no warning is active yet, or there is, but this is a different vehicle
self:debug('collision warning: my course intersects with %s in %.1f m, my ETE %.1f, other ETE %.1f',
CpUtil.getName(vehicle), myDistanceToCollision, myEte, otherEte)
end
self.warningVehicle = vehicle
self.warning:set(true, self.clearWarningDelayMs)
return
end
self.warningVehicle = vehicle
self.warning:set(true, self.clearWarningDelayMs)
return
end
end
end
Expand Down
Loading