Skip to content
Draft
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
3 changes: 3 additions & 0 deletions config/VehicleConfigurations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ You can define the following custom settings:
shovelMovingToolIx = "1"
/>

<Vehicle name="highDumpBucket.xml"
shovelMovingToolIx="1"/>

<!--[DLC]-->

<!--Harvester-->
Expand Down
8 changes: 8 additions & 0 deletions scripts/specializations/CpShovelPositions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,16 @@ function CpShovelPositions:setShovelPosition(dt, shovelLimits, armLimits, height
--- Controls the arm height
setTranslation(armProjectionNode, 0, i1y, i1z)
setTranslation(armToolRefNode, ax, ay, az)

local _, shy, shz = localToLocal(shovelTool.node, armVehicle.rootNode, 0, 0, 0)
local _, _, rz = localRotationToLocal(getParent(shovelTool.node), getParent(getParent(shovelTool.node)), 0, 0, 0)
local dirZ, dirY = MathUtil.vector2Normalize(shz - az, shy - ay)
if math.abs(rz) > math.rad(160) then
--- We assume the shovel node is rotated by 180 degrees,
--- so we have to flip the calculation
dirZ, dirY = MathUtil.vector2Normalize(az - shz, ay - shy)
end

oldRotRelativeArmRot = MathUtil.getYRotationFromDirection(-dirZ, dirY) + math.pi/2

alpha = math.atan2(i1y - ay, i1z - az)
Expand Down
Loading