Page 1 of 1

sim.computeJacobian() is returning -1

Posted: 13 Feb 2019, 16:24
by johnrowlay
I am having trouble retrieving the Jacobian using the regular API.

So, I have created a new scene, and then imported the Sawyer robot. Then, I created an IK group using the calculation modules, with a tip and a target, and explicit handling not checked. Then, I added a child script for the Sawyer robot, and edited the actuation code as follows:

Code: Select all

function sysCall_actuation()
    print('Actuation ...')
    ik_group_handle = sim.getIkGroupHandle('Sawyer_IK_group')
    print('handle:')
    print(ik_group_handle)
    result = sim.computeJacobian(ik_group_handle, 0)
    print('result:')
    print(result)
    jacobian = sim.getIkGroupMatrix(ik_group_handle, 0)
    print('jacobian:')
    print(jacobian)
    print('... Done')
end
This prints out the following:

Code: Select all

Actuation ...
handle:
2030003
result:
-1
jacobian:

... Done
So what I am finding, is that "sim.computeJacobian()" is returning -1, which is an error. And subsequently, the Jacobian is empty.

What do I need to change?

Re: sim.computeJacobian() is returning -1

Posted: 20 Feb 2019, 10:17
by coppelia
Hello,

something must be wrong with your IK group.
Try using the IRB140 model: replace the code in the child script with your code, and you will see that the Jacobian is computed.
Are you sure your joints are in IK mode?

Cheers