Ask Your Question
1

Using arm_kinematics, Inverse Kinematics Calculations fail

asked 2011-07-11 07:20:56 -0500

John Hoare gravatar image

I've been going through the PR2 Kinematics tutorials, but using our own arm ( http://www.ros.org/wiki/pr2_kinematic... ) and I've encountered a problem.

Using arm_kinematics ( http://www.ros.org/wiki/arm_kinematics ) in ROS C-Turtle, we're getting an Inverse Kinematics failed message.

I've also tried doing the forward-kinematics for an arbitrary robot pose, and then putting the result into the inverse kinematics request message. For some 'more complicated' poses (i.e. not very close to straight up) the inverse kinematics fails. For simple poses (close to straight up, all 0's) I can get a single inverse kinematic solution. The forward kinematics calculations look like they're all working correctly, however.

Any ideas of what I should look into?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-07-11 08:02:29 -0500

David Lu gravatar image

Are you filling in anything for the ik_seed_state?

FWIW, arm_kinematics was written because no generic IK solver existed for anything but the PR2. I acknowledge that it doesn't work in all situations, and welcome patches for my naive implementation of IK.

edit flag offensive delete link more

Comments

I am, and it was all Zeros, like in the tutorial. I'm able to find solutions to close to this, so I believe its probably a case of the solver timing out. However, I have a timeout of 10 seconds set, and its telling me no solution exists well before then.
John Hoare gravatar imageJohn Hoare ( 2011-07-11 08:26:30 -0500 )edit
Changing the number of iterations didn't help either?
arebgun gravatar imagearebgun ( 2011-07-11 08:29:47 -0500 )edit
After changing the maxIterations, the search goes on for longer, but it still does not seem to find a solution.
John Hoare gravatar imageJohn Hoare ( 2011-07-11 08:37:31 -0500 )edit
Try changing the seed state to not be all zeros. Use a random state (within joint limits). arm_kinematics uses a numerical solver unlike the pr2_arm_kinematics which uses a custom analytical solution. Numerical solvers can be very dependent on the initial seed choice.
Sachin Chitta gravatar imageSachin Chitta ( 2011-07-11 08:54:46 -0500 )edit
Is the general approach to generate random configurations and try multiple times?
John Hoare gravatar imageJohn Hoare ( 2011-07-11 09:25:17 -0500 )edit
For the kdl solver (which is the base of arm_kinematics), yes, you may need to start with different seed state positions, as local minima may prevent the solver from converging for certain seed states. Adding iterations should potentially help as well.
egiljones gravatar imageegiljones ( 2011-07-11 10:45:43 -0500 )edit
I find that seeding with the current joint_state rather than all zeros can also help find a solution more often.
Pi Robot gravatar imagePi Robot ( 2011-07-11 11:15:50 -0500 )edit
Depending on the arm configuration all zeros is actually quite likely a very bad seed state as it is likely causing singularities.
dornhege gravatar imagedornhege ( 2011-07-11 11:38:39 -0500 )edit
2

answered 2011-07-11 07:35:03 -0500

arebgun gravatar image

updated 2011-07-11 08:38:58 -0500

Did you try increasing the number of iterations or increasing the timeout value? It might be that it's timing out or reaching iteration limit before finding any IK solution.

To change the maximum number of iterations of the IK solver, set maxIterations parameter of arm_kinematics node to some value:

<node pkg="arm_kinematics" type="arm_kinematics" name="arm_kinematics" >
    <param name="maxIterations" value="5000" />
</node>
edit flag offensive delete link more

Comments

I can't see an iteration limit in the request message. I do see a timeout, and I give it 10 seconds, but it returns no found positions before that.
John Hoare gravatar imageJohn Hoare ( 2011-07-11 08:30:38 -0500 )edit
It's the maxIterations parameter of the arm_kinematics node, you have to do it when launching the node.
arebgun gravatar imagearebgun ( 2011-07-11 08:33:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-07-11 07:20:56 -0500

Seen: 987 times

Last updated: Jul 11 '11