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

Revision history [back]

click to hide/show revision 1
initial version

In this section of your code:

 # Choice of the planners
planner = "RRTstarkConfigDefault"  # Asymptotic optimal tree-based planner
# planner = "ESTkConfigDefault"  # Default: tree-based planner
# planner = "RRTConnectConfigDefault"  # Tree-based planner
# planner = "PRMstarkConfigDefault"  # Probabilistic Roadmap planner

planning_attempts = 100  # planning attempts
planning_time = 50  # [s] Planning time for computation

you tell MoveIt to use the RRTstarkConfigDefault planner config and set planning_time to 50 seconds. This planner is an "asymptotic optimal" planner, which means that after finding an initial feasible solution it will continue to plan to try to find better solutions until it reaches its time limit. In your video I can see that this planner finds its initial solution very quickly after you trigger the planning request, but only returns its solution after 50 seconds have elapsed, which matches the value you've set for planning_time.

Have you tried switching to a different planner like ESTkConfigDefault or RRTConnectConfigDefault? RRTConnect, for example, will return as soon as it finds an initial solution, which is useful if you want quick answers to plans of varying complexity. Or, you could try reducing planning_time, though there's a risk that if you pick a very short time limit the planner might not be able to find even an initial solution before timing out if the problem is very complicated.

The Open Motion Planning Library that MoveIt uses provides documentation about each of these planning algorithms here, which could be useful for selecting which one is best for your application.