FindIKSolution with TranslationDirection5D: please help

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

FindIKSolution with TranslationDirection5D: please help


I am trying to use OpenRAVE to compute IK solutions for a Nao arm with an attached link (see figure).

I created the collada file from a URDF and created a robot.xml which looks like this:

  <robot file="ra.dae"> 
        <Manipulator name="left_arm">

It seems to work as --database inversekinematics --robot=ra.robot.xml --iktype=translationdirection5d --iktests=1000

results in:
openravepy.databases.inversekinematics: testik, success rate: 0.997000, wrong solutions: 0.000000, no solutions: 0.003000, missing solution: 0.063000

However, if I try to use OpenRAVE from my c++ code, with robot->GetActiveManipulator()->FindIKSolution(..) I never get a solution.
To make sure a solution exists, I set the joints of the robot manually, within the joint limits, using RobotBase->GetJoint(...).push_back(..).
Then I call
IkParameterization param_target = robot->GetActiveManipulator()->GetIkParameterization(IKP_TranslationDirection5D);
and then use the current configuration as target by calling
robot->GetActiveManipulator()->FindIKSolution(param_target, vsolution, IKFO_IgnoreEndEffectorCollisions);
However, the call returns false.
In the figure, the red line indicates the ray direction as obtained from param_target.GetTranslationDirection5D().dir and the target position obtained similarly.

Any hints what I am doing wrong? I assume it might be related to the orientation of the end effector frame or the manipulator direction or something.
Thank you!