moveit inverse_kinematics C++ API
I have been trying to use the inverse kinematic from the moveit package on my URDF hand model. I have used the setup "moveit setup assistance" to generate all the configuration files necessary and I have tried out the demo.launch which is generated by the config assistant and tried out some planning. All works fine.
What I am trying to do is to move the fingers of my model via the moveit C++ API. Before going into the specifics of my problem, here is the setup for the index finger:
The index has 4 Revolute joints and one fixed joint at the tip of the finger. I have created two groups, one is index and the other is index_tip as suggested in this tutorial. The last fixed joint is the which I want to use as the tip for the target of the inverse kinematics.
Eigen::Affine3d target = kinematic_state->getGlobalLinkTransform("index_dof3_joint");
target(0,3) = target(0,3) + dx;
target(1,3) = target(1,3) + dx;
target(2,3) = target(2,3) + dx;
if(kinematic_state->setFromIK(joint_model_group[INDEX],target,5,0.1))
When I run this the value returned from setFromIK is false and fails to find a solution. Now the distance between the current position and target is very small, so I don't think the solution is unfeasible. I have also set in my kinematics.yaml file "position_only_ik: True", since I only want to do position IK on the finger tip.
It does return true when the target is equal to the current and no motion is required.
There are a few things that I have not quite understood yet. In the moveit setup assistant I am told to create two groups, one for the chain an one for the end-effector. However I do not see how this relation is used in the Moveit C++ API.
Also if someone knows how to to set a parameter similar to "position_only_ik" for KDL I would be grateful.