Ask Your Question
0

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 ( http://docs.ros.org/hydro/api/pr2_mov... ) 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");
sleep(5.0);

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

Comments

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

johnyang gravatar imagejohnyang ( 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 imagejohnyang ( 2016-04-06 22:50:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

johnyang gravatar image

I found out where the problem is now after read this post: https://groups.google.com/forum/#!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);
spinner.start();
edit flag offensive delete link more

Comments

I was about to suggest that

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 538 times

Last updated: Apr 07 '16