Hi,I am trying to build a pick and toss robot,I want the UR5 to release its claws when throwing an object forward, so that the object has a forward acceleration.
But I don't know how to lift the mechanical arm and release the claws at the same time.Is there any relevant demo or function to solve my problem? I would really appreciate it if anyone could answer my question.
pick and toss robot
Re: pick and toss robot
There are no particular provisions to achieve that. You only need a good grasping (or fake it with sim.setObjectParent), a sufficient joint maximum velocity, and a good timing.
For a good timing, you can wait e.g. the robot tip to reach a particular position:
where
For a good timing, you can wait e.g. the robot tip to reach a particular position:
Code: Select all
function sysCall_init()
...
corout=coroutine.create(function()
local function waitTipZ(v,k)
while true do
local tipPos=sim.getObjectPosition(tip,-1)
if k*tipPos[3]>k*v then break end
sim.switchThread()
end
end
setConfig(robotInPickPosition)
waitTipZ(0.05,-1)
grip(true)
setConfig(robotInUpPosition)
waitTipZ(0.8,1)
grip(false)
end)
end
function sysCall_actuation()
if coroutine.status(corout)~='dead' then
local ok,errorMsg=coroutine.resume(corout)
if errorMsg then
error(debug.traceback(corout,errorMsg),2)
end
end
end
setConfig
and grip
are two simple functions to set the robot's joints' target positions and to control the gripper respectively.