|
41 | 41 | #include <moveit/robot_model_loader/robot_model_loader.h> |
42 | 42 | #include <moveit/planning_interface/planning_interface.h> |
43 | 43 | #include <moveit/planning_scene/planning_scene.h> |
44 | | -#include <moveit/planning_scene_monitor/planning_scene_monitor.h> |
45 | 44 | #include <moveit/kinematic_constraints/utils.h> |
46 | 45 | #include <moveit_msgs/DisplayTrajectory.h> |
47 | 46 | #include <moveit_msgs/PlanningScene.h> |
@@ -72,30 +71,19 @@ int main(int argc, char** argv) |
72 | 71 | // .. _RobotModelLoader: |
73 | 72 | // http://docs.ros.org/indigo/api/moveit_ros_planning/html/classrobot__model__loader_1_1RobotModelLoader.html |
74 | 73 | const std::string PLANNING_GROUP = "panda_arm"; |
75 | | - robot_model_loader::RobotModelLoaderPtr robot_model_loader( |
76 | | - new robot_model_loader::RobotModelLoader("robot_description")); |
77 | | - robot_model::RobotModelPtr robot_model = robot_model_loader->getModel(); |
| 74 | + robot_model_loader::RobotModelLoader robot_model_loader("robot_description"); |
| 75 | + robot_model::RobotModelPtr robot_model = robot_model_loader.getModel(); |
78 | 76 | /* Create a RobotState and JointModelGroup to keep track of the current robot pose and planning group*/ |
79 | 77 | robot_state::RobotStatePtr robot_state(new robot_state::RobotState(robot_model)); |
80 | 78 | const robot_state::JointModelGroup* joint_model_group = robot_state->getJointModelGroup(PLANNING_GROUP); |
81 | 79 |
|
82 | | - // Using the :moveit_core:`RobotModel`, we can construct a |
83 | | - // :planning_scene:`PlanningScene` that maintains the state of |
84 | | - // the world (including the robot). |
| 80 | + // Using the :moveit_core:`RobotModel`, we can construct a :planning_scene:`PlanningScene` |
| 81 | + // that maintains the state of the world (including the robot). |
85 | 82 | planning_scene::PlanningScenePtr planning_scene(new planning_scene::PlanningScene(robot_model)); |
86 | 83 |
|
87 | | - // With the planning scene we create a planing scene monitor that |
88 | | - // monitors planning scene diffs and applys them to the planning scene |
89 | | - planning_scene_monitor::PlanningSceneMonitorPtr psm( |
90 | | - new planning_scene_monitor::PlanningSceneMonitor(planning_scene, robot_model_loader)); |
91 | | - psm->startPublishingPlanningScene(planning_scene_monitor::PlanningSceneMonitor::UPDATE_SCENE); |
92 | | - psm->startStateMonitor(); |
93 | | - psm->startSceneMonitor(); |
| 84 | + // Configure a valid robot state |
| 85 | + planning_scene->getCurrentStateNonConst().setToDefaultValues(joint_model_group, "ready"); |
94 | 86 |
|
95 | | - while (!psm->getStateMonitor()->haveCompleteState() && ros::ok()) |
96 | | - { |
97 | | - ROS_INFO_STREAM_THROTTLE_NAMED(1, node_name, "Waiting for complete state from topic "); |
98 | | - } |
99 | 87 | // We will now construct a loader to load a planner, by name. |
100 | 88 | // Note that we are using the ROS pluginlib library here. |
101 | 89 | boost::scoped_ptr<pluginlib::ClassLoader<planning_interface::PlannerManager>> planner_plugin_loader; |
@@ -138,7 +126,7 @@ int main(int argc, char** argv) |
138 | 126 | // The package MoveItVisualTools provides many capabilties for visualizing objects, robots, |
139 | 127 | // and trajectories in RViz as well as debugging tools such as step-by-step introspection of a script |
140 | 128 | namespace rvt = rviz_visual_tools; |
141 | | - moveit_visual_tools::MoveItVisualTools visual_tools("panda_link0", rviz_visual_tools::RVIZ_MARKER_TOPIC, psm); |
| 129 | + moveit_visual_tools::MoveItVisualTools visual_tools("panda_link0"); |
142 | 130 | visual_tools.loadRobotStatePub("/display_robot_state"); |
143 | 131 | visual_tools.enableBatchPublishing(); |
144 | 132 | visual_tools.deleteAllMarkers(); // clear all old markers |
|
0 commit comments