Hello,
I need to calculate the inverse kinematics and generate the trajectory for a parallel mechanism which has two motors and three joints.
I saw the "fkAndIkResolutionForParallelMechanism" and "ikPathGeneration" but I can't move my robot.
Here I uploaded an image of my scene hierarchy and my scene file https://www.dropbox.com/scl/fo/axz93s6w ... tcx7dm48cu
Has anyone a suggestion for me please?
Many thanks!!
IK on parallel robot with two motors
Re: IK on parallel robot with two motors
Are you sure you set the dummy-dummy link (i.e. ClosureTip to ClosureTarget)? In the dummy properties you should select a linked dummy, and a constraint type (dynamic overlaps in this case).
A coloured line would then show up in the objects hierarchy.
A coloured line would then show up in the objects hierarchy.
Re: IK on parallel robot with two motors
Hi,
here you can see the dummy-dummy link https://www.dropbox.com/s/nnmktfvkyikcvrf/img.png?dl=0 : the blue line is visible.
I uploaded also the adjusted scene here https://www.dropbox.com/s/9fuktmozjabs9 ... K.ttt?dl=0.
If I set a joint position, the chain works properly. I have problem by setting the IK elements and I can't understand why..My scene is quite similar to the one shown in "fkAndIkResolutionForParallelMechanism" except that I have two motors and three joints.
Any help is really appreciated!
Thanks!!
here you can see the dummy-dummy link https://www.dropbox.com/s/nnmktfvkyikcvrf/img.png?dl=0 : the blue line is visible.
I uploaded also the adjusted scene here https://www.dropbox.com/s/9fuktmozjabs9 ... K.ttt?dl=0.
If I set a joint position, the chain works properly. I have problem by setting the IK elements and I can't understand why..My scene is quite similar to the one shown in "fkAndIkResolutionForParallelMechanism" except that I have two motors and three joints.
Any help is really appreciated!
Thanks!!
Re: IK on parallel robot with two motors
I read again the tutorial https://www.coppeliarobotics.com/helpFi ... torial.htm and fixed some properties of the link and of the joints. Unfortunately I have always the same problem: the Ik can't be solved.
I checked if the target dummy position is actually reachable, and it is.
Many thanks again for any suggestions!
I checked if the target dummy position is actually reachable, and it is.
Many thanks again for any suggestions!
Re: IK on parallel robot with two motors
Hello,
you have several problems with your scene: first you should decide if you want/need a dynamically enabled scene, or if a kinematic scene is enough. Currently you have most elements that are dynamically enabled.
For a kinematic scene, make sure all shapes are non-respondable and static. Your joints are already all in kinematic mode (correct in that situation).
Then start with a single loop-closing constraint, and make the motor rotate:
then add the second constraint:
notice that now we have as option for simIK.handleGroup allowError=true, because the system is now overconstrained and often the tip can't reach the target.
Cheers
you have several problems with your scene: first you should decide if you want/need a dynamically enabled scene, or if a kinematic scene is enough. Currently you have most elements that are dynamically enabled.
For a kinematic scene, make sure all shapes are non-respondable and static. Your joints are already all in kinematic mode (correct in that situation).
Then start with a single loop-closing constraint, and make the motor rotate:
Code: Select all
function sysCall_init()
-- Take a few handles from the scene:
local simBase=sim.getObject('.')
local simClosureTip=sim.getObject('./ClosureTip')
local simClosureTarget=sim.getObject('./ClosureTarget')
local simTip=sim.getObject('./Tip')
local simTarget=sim.getObject('./Target')
simMotorJoint=sim.getObject('./Motor1')
ikEnv = simIK.createEnvironment()
ikGroup=simIK.createGroup(ikEnv)
simIK.setGroupCalculation(ikEnv,ikGroup,simIK.method_damped_least_squares,0.1,100)
local ikElement,simToIkObjectMap=simIK.addElementFromScene(ikEnv,ikGroup,simBase,simClosureTip,simClosureTarget,simIK.constraint_x|simIK.constraint_y|simIK.constraint_orientation)
simIK.setJointMode(ikEnv,simToIkObjectMap[simMotorJoint],simIK.jointmode_passive) -- make sure that joint will act as 'rigid' during IK calculations
end
function sysCall_actuation()
sim.setJointPosition(simMotorJoint,sim.getJointPosition(simMotorJoint)+0.01)
simIK.handleGroup(ikEnv,ikGroup,{syncWorlds=true})
end
Code: Select all
function sysCall_init()
-- Take a few handles from the scene:
local simBase=sim.getObject('.')
local simClosureTip=sim.getObject('./ClosureTip')
local simClosureTarget=sim.getObject('./ClosureTarget')
local simTip=sim.getObject('./Tip')
local simTarget=sim.getObject('./Target')
simMotorJoint=sim.getObject('./Motor1')
ikEnv = simIK.createEnvironment()
ikGroup=simIK.createGroup(ikEnv)
simIK.setGroupCalculation(ikEnv,ikGroup,simIK.method_damped_least_squares,0.1,100)
local ikElement,simToIkObjectMap=simIK.addElementFromScene(ikEnv,ikGroup,simBase,simClosureTip,simClosureTarget,simIK.constraint_x|simIK.constraint_y|simIK.constraint_orientation)
simIK.setJointMode(ikEnv,simToIkObjectMap[simMotorJoint],simIK.jointmode_passive) -- make sure that joint will act as 'rigid' during IK calculations
local ikElement,simToIkObjectMap=simIK.addElementFromScene(ikEnv,ikGroup,simBase,simTip,simTarget,simIK.constraint_x|simIK.constraint_y)
end
function sysCall_actuation()
sim.setJointPosition(simMotorJoint,sim.getJointPosition(simMotorJoint)+0.01)
simIK.handleGroup(ikEnv,ikGroup,{syncWorlds=true,allowError=true})
end
Cheers
Re: IK on parallel robot with two motors
Many thanks for the reply! Thanks a lot!