diff --git a/config/VehicleConfigurations.xml b/config/VehicleConfigurations.xml index e1d5673bc..113f589e3 100644 --- a/config/VehicleConfigurations.xml +++ b/config/VehicleConfigurations.xml @@ -128,7 +128,7 @@ You can define the following custom settings: Disables the pipe height adjustment for trailers of a few pipe implements/vehicles. - ignorePipeMovingToolIndex: int - Ignores the given pipe moving tool by it's index. + Ignores the given pipe moving tool by its index. This can be used to ignore a pipe moving part and only use one part. An example is the premium expansion Dewulf P3K Profi. @@ -141,6 +141,14 @@ You can define the following custom settings: Moving tool index for the pipe controller to control the pipe height. This index is for the pipe part that is directly connected to the discharge node. +- tightTurnOffsetDistanceInTurns: float + "Tight turn offset" is extending the radius of turns with a towed implement, in + order to keep the implement on the path, while the tractor is driving outside the + generated turn course. This is usually applied to the last curvy 10-20 meters of the + turn course. With this value you can override the default to make this section + shorter for some implements, especially big plows turn on the spot and align + better with the next row without tight turn offset. + --> @@ -169,6 +177,7 @@ You can define the following custom settings: basePipeMovingToolIndex childPipeMovingToolIndex unloadOffsetX + tightTurnOffsetDistanceInTurns @@ -468,7 +477,9 @@ You can define the following custom settings: diff --git a/scripts/ai/AIUtil.lua b/scripts/ai/AIUtil.lua index 034f3019a..204250082 100644 --- a/scripts/ai/AIUtil.lua +++ b/scripts/ai/AIUtil.lua @@ -321,9 +321,10 @@ end ---@param vehicle table ---@param object table ---@return boolean -function AIUtil.isObjectAttachedOnTheBack(vehicle,object) - local _, _, dz = localToLocal(object.rootNode, AIUtil.getDirectionNode(vehicle), 0, 0, 0) - if dz < 0 then +function AIUtil.isObjectAttachedOnTheBack(vehicle, object) + -- TODO: now in the implement's coordinate system, this is still not 100% reliable in turns + local _, _, dz = localToLocal(AIUtil.getDirectionNode(vehicle), object.rootNode, 0, 0, 0) + if dz > 0 then return true end return false diff --git a/scripts/ai/turns/AITurn.lua b/scripts/ai/turns/AITurn.lua index ffeafcd60..4b0935fa7 100644 --- a/scripts/ai/turns/AITurn.lua +++ b/scripts/ai/turns/AITurn.lua @@ -732,7 +732,7 @@ function CourseTurn:onPathfindingDone(path) self.turnCourse:setUseTightTurnOffsetForLastWaypoints(15) local endingTurnLength = self.turnContext:appendEndingTurnCourse(self.turnCourse, nil, true) local x = AIUtil.getDirectionNodeToReverserNodeOffset(self.vehicle) - self:debug('Extending course at direction switch for reversing to %.1f m (or at least 1m)', -x ) + self:debug('Extending course at direction switch for reversing to %.1f m (or at least 1m)', -x) self.turnCourse:adjustForReversing(math.max(1, -x)) TurnManeuver.setLowerImplements(self.turnCourse, endingTurnLength, true) else @@ -987,7 +987,7 @@ function StartRowOnly:init(vehicle, driveStrategy, ppc, turnContext, startRowCou local _, steeringLength = AIUtil.getSteeringParameters(self.vehicle) self.enableTightTurnOffset = steeringLength > 0 and not AIUtil.hasArticulatedAxis(self.vehicle) - -- TODO: do we need tight turn offset here? + -- TODO: do we need tight turn offset here? self.turnCourse:setUseTightTurnOffsetForLastWaypoints(15) -- add a turn ending section into the row to make sure the implements are lowered correctly local endingTurnLength = self.turnContext:appendEndingTurnCourse(self.turnCourse, 3, true) diff --git a/scripts/ai/turns/TurnManeuver.lua b/scripts/ai/turns/TurnManeuver.lua index fa1510c70..235afb30b 100644 --- a/scripts/ai/turns/TurnManeuver.lua +++ b/scripts/ai/turns/TurnManeuver.lua @@ -313,7 +313,9 @@ function AnalyticTurnManeuver:init(vehicle, turnContext, vehicleDirectionNode, t self.course = self:findAnalyticPath(vehicleDirectionNode, 0, turnEndNode, 0, goalOffset, self.turningRadius) -- make sure we use tight turn offset towards the end of the course so a towed implement is aligned with the new row - self.course:setUseTightTurnOffsetForLastWaypoints(10) + + self.course:setUseTightTurnOffsetForLastWaypoints( + g_vehicleConfigurations:getRecursively(vehicle, 'tightTurnOffsetDistanceInTurns') or 10) local ixBeforeEndingTurnSection = self.course:getNumberOfWaypoints() -- and once again, if there is an ending course, keep adjusting the tight turn offset local endingTurnLength = self.turnContext:appendEndingTurnCourse(self.course, steeringLength, true) @@ -428,7 +430,8 @@ function TurnEndingManeuver:init(vehicle, turnContext, vehicleDirectionNode, tur self:generateStraightSection(endArc, endStraight) myCorner:delete() self.course = Course(vehicle, self.waypoints, true) - self.course:setUseTightTurnOffsetForLastWaypoints(20) + self.course:setUseTightTurnOffsetForLastWaypoints( + g_vehicleConfigurations:getRecursively(vehicle, 'tightTurnOffsetDistanceInTurns') or 20) TurnManeuver.setLowerImplements(self.course, math.max(math.abs(turnContext.frontMarkerDistance), steeringLength)) end