ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

why GetConstraintAwarePositionIK return a failure so quickly?

asked 2012-10-29 22:46:43 -0500

updated 2014-01-28 17:14:06 -0500

ngrennan gravatar image

when using GetConstraintAwarePositionIK, i set the timeout to 5 seconds. but sometimes it returnes an error code "NO_IK_SOLUTION" very very quickly(less than 1 seconds). why does this happen? according to my understanding, if it cannot find a solution, it should keep trying until timeout.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-30 22:48:55 -0500

Adolfo Rodriguez T gravatar image

If the maximum number of iterations/retries is reached and no solution is found, or if an IK solution is found but does not satisfy the constraints, GetConstraintAwarePositionIK will not succeed. This can very easily take less than 5s, especially if your IK routine is fast, and the max_search_iterations parameter is set to a low number. If you would like to keep on trying until the timeout is reached, try increasing max_search_iterations to a large-enough value. Btw, what value are you currently using? (if unspecified it defaults to three).

edit flag offensive delete link more


well, i'm using the default value... where can i set this value? seems it's not in the param list

yangyangcv gravatar image yangyangcv  ( 2012-10-30 23:12:35 -0500 )edit

If you use the KDL arm kinematics plugin, then in the same place you configure the root and tip links of the IK solver, Depending on your setup, this might be in a launch file or a yaml file.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2012-10-31 00:40:27 -0500 )edit

Here is the relevant plugin code that fetches the parameter.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2012-10-31 00:41:13 -0500 )edit

I'm using KDL and i just set max_search_iterations to 1,000,000, still IK fails very quickly

yangyangcv gravatar image yangyangcv  ( 2012-10-31 01:46:17 -0500 )edit

Can you confirm that 1e6 iterations are taking place?, or put otherwise, that your computation time is now six orders of magnitude higher?.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2012-10-31 02:27:04 -0500 )edit

now i know the reason. the ik program will check the state validity of the goal state first. if it's invalid(e.g. in collision), it will directly return a failure

yangyangcv gravatar image yangyangcv  ( 2012-10-31 20:45:50 -0500 )edit

This does not make much sense, as there is no way to check state validity before performing IK. That's the whole point of the IK search, find a joint configuration that satisfies both the task-space goal and limits/collision constraints. Which overload of searchPositionIK(...) are you invoking?.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2012-11-04 23:46:23 -0500 )edit

sorry for not explaining it clearly. the validity check before IK only checks the validity for the end effector. so if the goal pose makes the end effector collides with other objects, this check return a failure.

yangyangcv gravatar image yangyangcv  ( 2012-11-05 14:39:13 -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

1 follower


Asked: 2012-10-29 22:46:43 -0500

Seen: 109 times

Last updated: Oct 30 '12