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

Is it possible to score IK solutions on MoveIt?

asked 2022-01-14 09:21:36 -0500

willemstuijt gravatar image

updated 2022-01-15 04:37:46 -0500

I am using MoveIt with a custom robotic arm. And it is working pretty well, it converges really fast to a solution.

My problem is that these solutions are far from optimal. The path planner usually performs pretty well. But the IK solver frequently converges to very odd positions (I am using TRAC-IK), something like 1 out of 3 solutions are not great.

I was wondering if it was possible to customize how the IK solver evaluates different solutions. Maybe something like running the IK solver N times and choosing the best solution given a custom evaluation function. Is this possible? For example, finding N different solutions and choosing the solution where joint X is closest to value Y. Doesn't sound like it should be that complicated to do. If this is possible through the Python API then even better, but if it is necessary to do through C++ then that is also fine.

edit retag flag offensive close merge delete

Comments

1

An observation: this is a good example of an xy-problem.

The question is titled:

Is it possible to score IK solutions on MoveIt?

while the actual problem is:

the IK solver frequently converges to very odd positions

that's what the question should have been about.

gvdhoorn gravatar image gvdhoorn  ( 2022-01-14 13:11:40 -0500 )edit

Yes. I see that now. Thanks for the observation.

willemstuijt gravatar image willemstuijt  ( 2022-01-15 04:38:11 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-01-15 04:36:51 -0500

willemstuijt gravatar image

I was already using solve_type: Distance. What improved my results was increasing the kinematics_solver_timeout which was at it's default of 0.005, still not always a great solution but much better. I guess it is a tradeoff between computation speed and better solutions. I previously thought kinematics_solver_timeout was the timeout before finding any feasible solution and not the total time given to finding a better solution based on solve_type. Makes sense now. I still think it would be nice to be able to tell MoveIt which joint values are most likely to be close to the solution to help the IK a little bit, at least for my use case.

edit flag offensive delete link more
0

answered 2022-01-14 09:32:58 -0500

Airuno2L gravatar image

It might be worth trying out the TRAC-IK solver instead of the default KDL solver inside MoveIT. They have a MoveIT plug-in that looks pretty easy to use. I think you can insert they type of constraints you're talking about into the TRAC-IK solver.

edit flag offensive delete link more

Comments

I am using TRAC-IK, however I don't see where I could configure this. Maybe it is important to add that I would like to be able to specify different scoring functions for different sorts of movements during runtime and not just in the initial configuration.

willemstuijt gravatar image willemstuijt  ( 2022-01-14 09:38:03 -0500 )edit

I don't know about changing during runtime, but to configure the solver just add this to your kinematics.yaml file:

solve_type: Distance

(more info here)

That would let the solver run until the timeout is met, then select the solution that is closest in joint space to the current position. The default behavior is just to output the first viable solution computed.

Airuno2L gravatar image Airuno2L  ( 2022-01-14 10:15:03 -0500 )edit

Configuring Trac-IK with the Distance solve type should already improve things quite a bit.

There is no support for "custom scoring functions". At least not in vanilla MoveIt, nor in Trac-IK.

I am using TRAC-IK [..]

@willemstuijt: you don't mention this in your OP. Please include relevant information when posting questions, otherwise you run the risk of people suggesting things you've already seen/or done.

@Airuno2L: I've updated your "more info here" link to point to the Noetic version of the documentation. No need to keep linking to Kinetic.

gvdhoorn gravatar image gvdhoorn  ( 2022-01-14 13:12:40 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2022-01-14 09:21:36 -0500

Seen: 104 times

Last updated: Jan 15 '22