40 #include <boost/filesystem.hpp>
62 #if 0 // Ensure there are objects in the planning scene
63 const std::size_t num_collision_objects =
planning_scene->getCollisionEnv()->getWorld()->size();
64 if (num_collision_objects == 0)
66 ROS_ERROR_STREAM_NAMED(
"cart_path_planner",
"No collision objects exist in world, you need at least a table "
67 "modeled for the controller to work");
68 ROS_ERROR_STREAM_NAMED(
"cart_path_planner",
"To fix this, relaunch the teleop/head tracking/whatever MoveIt "
69 "node to publish the collision objects");
79 if (only_check_self_collision)
111 : name_(imarker_name)
112 , imarker_parent_(imarker_parent)
113 , imarker_state_(imarker_parent_->imarker_state_)
114 , psm_(imarker_parent_->psm_)
115 , visual_tools_(imarker_parent_->visual_tools_)
116 , arm_data_(arm_data)
118 , imarker_server_(imarker_parent_->imarker_server_)
146 if (feedback->event_type == visualization_msgs::InteractiveMarkerFeedback::MOUSE_UP)
149 double save_every_sec = 0.1;
159 if (feedback->event_type != visualization_msgs::InteractiveMarkerFeedback::POSE_UPDATE)
173 Eigen::Isometry3d robot_ee_pose;
193 const double timeout = 1.0 / 30.0;
200 boost::scoped_ptr<planning_scene_monitor::LockedPlanningSceneRO> ls;
202 constraint_fn = boost::bind(&isStateValid,
static_cast<const planning_scene::PlanningSceneConstPtr&
>(*ls).get(),
204 boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3);
266 InteractiveMarkerControl control;
267 control.orientation.w = 1;
268 control.orientation.x = 1;
269 control.orientation.y = 0;
270 control.orientation.z = 0;
271 control.name =
"rotate_x";
272 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
274 control.name =
"move_x";
275 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
278 control.orientation.w = 1;
279 control.orientation.x = 0;
280 control.orientation.y = 1;
281 control.orientation.z = 0;
282 control.name =
"rotate_z";
283 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
285 control.name =
"move_z";
286 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
289 control.orientation.w = 1;
290 control.orientation.x = 0;
291 control.orientation.y = 0;
292 control.orientation.z = 1;
293 control.name =
"rotate_y";
294 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
296 control.name =
"move_y";
297 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
306 visualization_msgs::InteractiveMarkerControl&
309 visualization_msgs::InteractiveMarkerControl control;
310 control.always_visible =
true;
312 visualization_msgs::Marker marker;
313 marker.type = visualization_msgs::Marker::CUBE;
314 marker.scale.x = msg.scale * 0.3;
315 marker.scale.y = msg.scale * 0.10;
316 marker.scale.z = msg.scale * 0.10;
319 control.markers.push_back(marker);
320 msg.controls.push_back(control);
322 return msg.controls.back();