Control the gripper orientation while the robot follow a path with IK method

Typically: "How do I... ", "How can I... " questions
Post Reply
mari
Posts: 3
Joined: 02 Oct 2018, 13:27

Control the gripper orientation while the robot follow a path with IK method

Post by mari » 06 Nov 2018, 14:15

Hi,
I have a Efort robot model that with IK method follow a path. The gripper orientation have to be always parallel with, for example, the z axis, but I don't know how to do this when the robot si controlled with the IK method.
Any suggestions?
P.S.: I thought to do this with a child script, but I'm not sure if is easier control the gripper orientation by controling the joint or directly the gripper, and also which are some appropriate LUA commands for this.
Thank you.

coppelia
Site Admin
Posts: 6800
Joined: 14 Dec 2012, 00:25

Re: Control the gripper orientation while the robot follow a path with IK method

Post by coppelia » 07 Nov 2018, 08:11

Hello,

for what you want to do, make sure that the gripper joint is not part of the IK group. Set that joint to passive mode. Then, from within a child script for instance, control its orientation via sim.setJointPosition.

Cheers

mari
Posts: 3
Joined: 02 Oct 2018, 13:27

Re: Control the gripper orientation while the robot follow a path with IK method

Post by mari » 07 Nov 2018, 09:18

Thank you.
I have a doubt; I have forgotten to say that the gripper have to be parallel to the z axis of the scene. With sim.setJointPosition I control only the internal position of a joint and, knowing the others joints positions, with some calculations I can found it in such a way that the final orientation of the gripper is the one that I need.
Maybe there is a better way to do this?
Thank you so much

coppelia
Site Admin
Posts: 6800
Joined: 14 Dec 2012, 00:25

Re: Control the gripper orientation while the robot follow a path with IK method

Post by coppelia » 09 Nov 2018, 16:07

I think this is the cleanest way of doing it (via calculations). You can easily obtain the transformation matrix of the camera via sim.getObjectMatrix and then use it for your calculations.

Cheers

Post Reply