Page 1 of 1

Activation of IK Element

Posted: 13 Apr 2013, 01:02
by kodachi
Hi,
I would like to activate an IK Element by using "RegularAPI".
I could change some joint mode properties from force/torque mode to IK
mode, but I couldn't activate "Element is active" boxes in execution of
vrep simulation.

e.g.
REP_DLLEXPORT simInt simSetIkElementActive(simInt ikGroupHandle,simInt
tipDummyHandle,bool isActive)
{
...
CikGroup* it=ct::ikGroups->getIkGroup(ikGroupHandle);
...
CikEl* el=it->getIkElementWithTooltipID(tipDummyHandle);
...
el->setActive(isActive);
...
}

Is there any other way?

Thanks.

Re: Activation of IK Element

Posted: 13 Apr 2013, 10:57
by coppelia
Hello,

have you tried using the function simSetIkElementProperties, and setting the constraints argument to zero to deactivate the IK element? That should work fine, though not extremely elegant ;)

Cheers

Re: Activation of IK Element

Posted: 16 Apr 2013, 04:53
by kodachi
Thank you for your response.

I have tried to use "simSetKiElementProperties", but I couldn't solve the problem.

Please watch the following URL.
http://youtu.be/O-w38yB3Zbo

The "Element is active" checkbox in IK elemnent properties is unmarked when I change joint modes by Regular API.
I want to change joint modes from the IK mode to force/torque mode vice versa during simulation running.

I guess it must be possible to control IK joint mode if I can mark that checkbox by some API function.

Can I ask you to develop such API funcs?

Re: Activation of IK Element

Posted: 16 Apr 2013, 09:26
by coppelia
Hello,

Ah, I think I see what happens:

When you run IK for an element that is not valid, then it is automatically disabled. This happens when you temporarily switch the joint mode.

One way of avoiding this would be to also temporarily avoid executing the IK group that handles the IK element. This could be done by calling:
and this only if your IK group is implicitely handled by default.

Above method only works if temporarily disabling the whole IK group works for you. Let me know, otherwise we will try to add a flag to enable/disable individual IK elements.

Cheers