Why planning scene can't subscribe the new planning scene?
Hi everyone! I am trying to add an object into RVIZ throught C++ interface. I had follow the official tutorial Planning Scene ROS API and failed in step 1....
My Code is follow
moveit_visual_tools::MoveItVisualTools visual_tool("world");
visual_tool.deleteAllMarkers();
ros::Publisher planning_scene_diff_publisher = node_hadle.advertise<moveit_msgs::PlanningScene>("planning_Scene",1);
ros::WallDuration sleep_t(0.5);
while (planning_scene_diff_publisher.getNumSubscribers() < 1)
{
sleep_t.sleep();
}
visual_tool.prompt("Press 'next' in the RvizVisualToolsGui window to start the demo");
The fixed frame of my robot is "world".
The "Planning Scene Topic" shows in RVIZ is "/move_group/monitored_planning_scene".
After I run my code, I will see the can't break form while (planning_scene_diff_publisher.getNumSubscribers() < 1)
.
In addition, rqt_graph shows nothing has subscribed from "planning_Scene" which I just creat.