Timeout for GetPositionIK service does not work as expected when using Trac IK

asked 2019-02-11 05:08:48 -0600

ptriantd gravatar image

updated 2019-02-11 05:34:27 -0600

I am using the GetPositionIK service offered by MoveIt! to check whether a cartesian pose for my robot is feasible in terms of kinematics and collision-free.

I am using trac_ik as a kinematics_solver for my move_group with a timeout of 5 ms and I noticed the following:

If the solve_type for the IK is Manipulation1 and the timeout I am setting in my IKRequest is 30 ms then the IK is successfully computed in around 30 ms. If I set the timeout to 10 ms, then the IK is again successfully computed but in around 10 ms.

My question is: If the IK can be computed in 10 ms, then why does it need 30 ms in the first case? Why is the timeout not working as a timeout but it seems to scale up and down the response time?

The only solve_type mode that seems to lead to reasonable results is Speed.

edit retag flag offensive close merge delete

Comments

Nitpick: question title does not mention Trac IK anywhere. As there is a possibility this is Trac IK specific behaviour that you've observed, you should mention it.

gvdhoorn gravatar imagegvdhoorn ( 2019-02-11 05:33:28 -0600 )edit

I looked through the code, a place where the time limit is used is here As I see the algorithm takes all the time given.

kolya_rage gravatar imagekolya_rage ( 2019-02-11 07:09:01 -0600 )edit

So, there are two time limits here. The Trac IK timeout which I have kept constant at 5 ms and the timeout that I am passing to the GetPositionIK service which I have been changing. The link you provided is for Trac IK and it is normal that Trac IK gets all the time given...

ptriantd gravatar imageptriantd ( 2019-02-11 07:21:48 -0600 )edit

In the plugin code it seems like it instantiates TRAC_IK and passes timeout to the constructor. Isn't it the timeout you are talking about?

kolya_rage gravatar imagekolya_rage ( 2019-02-11 07:52:28 -0600 )edit

Nope. I am talking about the timeout here

ptriantd gravatar imageptriantd ( 2019-02-11 07:54:50 -0600 )edit

yep. You sure that this timeout is not passed to the plugin? If not, then take a look at the service source code itself.

kolya_rage gravatar imagekolya_rage ( 2019-02-11 07:59:36 -0600 )edit

Yes, you are right! This timeout is passed to the plugin indeed...

ptriantd gravatar imageptriantd ( 2019-02-11 08:58:03 -0600 )edit