ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Using arm_kinematics, Inverse Kinematics Calculations fail

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

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 -0600

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 image John Hoare  ( 2011-07-11 08:26:30 -0600 )edit
Changing the number of iterations didn't help either?
arebgun gravatar image arebgun  ( 2011-07-11 08:29:47 -0600 )edit
After changing the maxIterations, the search goes on for longer, but it still does not seem to find a solution.
John Hoare gravatar image John Hoare  ( 2011-07-11 08:37:31 -0600 )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 image Sachin Chitta  ( 2011-07-11 08:54:46 -0600 )edit
Is the general approach to generate random configurations and try multiple times?
John Hoare gravatar image John Hoare  ( 2011-07-11 09:25:17 -0600 )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 image egiljones  ( 2011-07-11 10:45:43 -0600 )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 image Pi Robot  ( 2011-07-11 11:15:50 -0600 )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 image dornhege  ( 2011-07-11 11:38:39 -0600 )edit
2

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

arebgun gravatar image

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

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 image John Hoare  ( 2011-07-11 08:30:38 -0600 )edit
It's the maxIterations parameter of the arm_kinematics node, you have to do it when launching the node.
arebgun gravatar image arebgun  ( 2011-07-11 08:33:37 -0600 )edit

Question Tools

Stats

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

Seen: 1,625 times

Last updated: Jul 11 '11