IK and single joint control

Typically: "How do I... ", "How can I... " questions
Post Reply
javl0p
Posts: 28
Joined: 05 Apr 2017, 08:53

IK and single joint control

Post by javl0p » 20 Apr 2017, 14:31

Good Evening,

I'm currently working with a KUKA iiwa 14 model and I want it to do the following operation:

1. Go to a specific position by using IK mode by following the target.
2. Do a rotation (180º) of the final (7th) joint, keeping the rest of the joints unmoved.

The problem here is that, since joints are firstly set in IK mode, rotating the target dummy 180º causes the whole robot to move, not just the 7th joint, as I want. Also I tried giving a direct command to the 7th joint through the API function simRMLMoveToJointPositions, but this obviously causes the rest of the joints to start moving, trying to adapt to the target orientation, which has remained fixed the whole time.

As a second option, I tried changing the joints operating mode from the child script, from IK mode to passive/dependent/torque mode but neither of this options was sucesfull. However, I believe that this might be the right path, I just don't know how to do it in a flawless way.

Notice: The physics engine is ON, so I can not use the trick of unparenting my joint to move freely. It falls down to the ground when I do it.

Thank you very much for taking the time to answer this!!

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

Re: IK and single joint control

Post by coppelia » 21 Apr 2017, 07:55

Hello,

you have several possibilities:
  • you can attach the IK tip before the 7th joint, and so the 7th joint won't be affecting any IK calculation.
  • But probably you also want the 7th joint for IK movement, so you could simply temporarily disable IK (using simSetExplicitHandling). Before turning it on again, make sure the target IK dummy matches the position and orientation of the tip IK dummy.
  • You could also change the parent of the IK tip dummy, but that solution would be less elegant
Cheers

javl0p
Posts: 28
Joined: 05 Apr 2017, 08:53

Re: IK and single joint control

Post by javl0p » 21 Apr 2017, 10:28

Hello,

thanks for the answer, sounds very reasonable.

-About setting the tip before the 7th joint: as you said, this is not valid in my case since I need the 7th joint for IK motion.
-Turning IK temporarily off: It should work, but as soon as IK is disabled, since my iiwa is not forced anymore to stick to the tip position and orientation, it starts to slowly fall down, due to what I supossed to be the effect of gravity.
-Changing the parent IK tip dummy: depending on where I place it, the robot either starts to do a vibrating motion (if I attached it to the 6th joint) or it again slowly falls down to the ground (If I place it before the 1st joint).

So the solution appears to lay in setting a gravity compensation mode, which I suposse to be possible. Any suggestions?

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

Re: IK and single joint control

Post by coppelia » 24 Apr 2017, 07:24

Ah ok, then your robot is also dynamically simulated. In that case you will have to also change the joint modes from hybrid IK to force/torque mode, with position control enabled.

Cheers

javl0p
Posts: 28
Joined: 05 Apr 2017, 08:53

Re: IK and single joint control

Post by javl0p » 24 Apr 2017, 15:11

That was it! Thanks!

Afterwards, i want to change back to IK mode. I have two options: sim_jointmode_ik and sim_jointmode_ikdependent.

What is the difference?

Thank you very much! Your posts are a real help!

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

Re: IK and single joint control

Post by coppelia » 25 Apr 2017, 07:35

you will probably want to use the sim_jointmode_ik mode. sim_jointmode_ikdependent is used when a joint is linked t another joint via a linear equation. By the way, sim_jointmode_ikdependent is deprecated and was replaced with sim_jointmode_dependent. You must be using an older V-REP version.

Cheers

Post Reply