Timeout for GetPositionIK service does not work as expected when using Trac IK
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
.
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.
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.
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...
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?
https://bitbucket.org/traclabs/trac_i...
Nope. I am talking about the timeout here
yep. You sure that this timeout is not passed to the plugin? If not, then take a look at the service source code itself.
Yes, you are right! This timeout is passed to the plugin indeed...