MoveIt! move_group plan function not returning [closed]
I can't figure out what I am doing wrong that would cause this issue. I originally was just using the move() function but that wasn't returning either. I thought it had something to do with just running this in rviz and not really executing anything.
So I switched to plan() instead but found I was having the same issue. I've attached the barebones I've boiled this down to:
#include <ros/ros.h>
#include <moveit/move_group_interface/move_group.h>
int main(int argc, char **argv) {
ros::init(argc, argv, "move_group_interface_demo");
ros::NodeHandle node;
move_group_interface::MoveGroup group("arm");
ros::Rate rate(1);
while (node.ok()){
group.setRandomTarget();
moveit::planning_interface::MoveGroup::Plan plan;
ROS_INFO("Planning");
if(group.plan(plan)) {
ROS_INFO("Planning Successful");
}
else {
ROS_WARN("Planning failed!");
}
rate.sleep();
}
ROS_INFO("DONE");
ros::waitForShutdown();
return 0;
}
Like I said, I'm sure it's a careless mistake that I'm not seeing. I'm using the demo.launch file created using the MoveIt! Setup Assistant. I see the plan being visualized in RViz after the planning is initiated? But the function doesn't return in this simple node.
In the terminal I see "Planning" being printed but neither the successful or failure messages print after that.
Also, I can use the planners in MoveIt! just fine inside of RViz to "plan and execute".
Any ideas?
Perfect question! You'd better ask this at https://groups.google.com/forum/#!forum/moveit-users, and I'm sure you'll get a quick answer there.
Thanks Martin, I'll repost this to their google-group.
Thanks for the question (and the answer) skiesel. Was useful. :)