Page 1 of 1

How to reproduce the manipulator motion controlled by IK(DLS)?

Posted: 19 Jan 2022, 10:06
by zhangm365
HELLO, admin

I am reproducing the manipulator motion controlled by the haptic device (Touch) through IK.cals(DLS) method in lastest software(V4.2), which is different from the previous version, but the result is not well.

The main problem is whether the script code in the scene is correct?

Can you give me a hand?

There are my scenes and scripts:
https://vrep.oss-cn-shenzhen.aliyuncs.c ... E3NmNlMzJm

Best wishes.

Re: How to reproduce the manipulator motion controlled by IK(DLS)?

Posted: 20 Jan 2022, 14:18
by coppelia
Hello,

not sure how you built up your IK task: there are two ways of doing this: implicitly and explicitly. You are mixing both approaches. We recommend doing it implicitly, which all demo scenes use. e.g.:

Code: Select all

-- in init:
ikEnv=simIK.createEnvironment()
-- Prepare the ik group, using the convenience function 'simIK.addIkElementFromScene':
ikGroup=simIK.createIkGroup(ikEnv)
local ikElement=simIK.addIkElementFromScene(ikEnv,ikGroup,simBase,simTip,simTarget,simIK.constraint_x+simIK.constraint_y)

--in actuation:
simIK.applyIkEnvironmentToScene(ikEnv,ikGroup)
see e.g. demo scene scenes/kinematics/singleIkGroupWithSingleIkElement-damped.ttt for instance.

Cheers