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

MoveIt! planning not continue after successful planning?

asked 2016-04-05 01:44:41 -0500

johnyang gravatar image

updated 2016-04-06 01:23:52 -0500

I was following this movegroup interface tutorial ( ) on my own 7DOF robot. It has successfully found a solution but the program is not continuing to the next line of code. (See code below, so it is not printing out "Visualizing ..." in terminal)

moveit::planning_interface::MoveGroup::Plan my_plan;
bool success = group.plan(my_plan); // stuck here
ROS_INFO("Visualizing plan 1 (pose goal) %s",success?"SUCCESSFUL":"FAILED");

The last displayed lines are:

[ INFO] [1459836629.415696549]: Solution found in 0.395740 seconds
[ INFO] [1459835061.553672913]: SimpleSetup: Path simplification took 0.029544 seconds and changed from 3 to 2 states

Anyone has any idea why this is happening? (I can see in RViz that the planner definitely found the path, but it won't let me continue so I can publish it to "/move_group/display_planned_path"). Either something is blocking the process or is waiting for some messages.

edit retag flag offensive close merge delete


I found a possible cause: It is stuck at waitForResult() in the plan() function. The problem is similar to!top... but I'm running group.plan(my_plan) inside main function.

johnyang gravatar image johnyang  ( 2016-04-06 22:50:15 -0500 )edit

Anyone has any clue how to get out of this waitForResult() function. (it is waiting for cur_simple_state_ == SimpleGoalState::DONE according to the source code)

johnyang gravatar image johnyang  ( 2016-04-06 22:50:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-07 18:03:34 -0500

johnyang gravatar image

I found out where the problem is now after read this post:!top... You have to have the spinner at the right place. I had it wrapped around in an if statement, so the actionlib is not actually working properly without the asyncspinner set properly.

ros::AsyncSpinner spinner(4);
edit flag offensive delete link more


I was about to suggest that

blancoys gravatar image blancoys  ( 2018-04-20 11:09:55 -0500 )edit

Question Tools


Asked: 2016-04-05 01:42:14 -0500

Seen: 987 times

Last updated: Apr 07 '16