40 #include <boost/filesystem.hpp> 58 , imarker_parent_(imarker_parent)
59 , psm_(imarker_parent_->psm_)
62 , imarker_server_(imarker_parent_->imarker_server_)
63 , imarker_state_(imarker_parent_->imarker_state_)
64 , visual_tools_(imarker_parent_->visual_tools_)
92 if (feedback->event_type == visualization_msgs::InteractiveMarkerFeedback::MOUSE_UP)
95 double save_every_sec = 0.1;
105 if (feedback->event_type != visualization_msgs::InteractiveMarkerFeedback::POSE_UPDATE)
119 Eigen::Affine3d robot_ee_pose;
139 const std::size_t attempts = 2;
140 const double timeout = 1.0 / 30.0;
147 boost::scoped_ptr<planning_scene_monitor::LockedPlanningSceneRO> ls;
149 constraint_fn = boost::bind(&isStateValid, static_cast<const planning_scene::PlanningSceneConstPtr&>(*ls).get(),
173 geometry_msgs::Pose pose_msg;
190 geometry_msgs::Pose pose_msg;
214 InteractiveMarkerControl control;
215 control.orientation.w = 1;
216 control.orientation.x = 1;
217 control.orientation.y = 0;
218 control.orientation.z = 0;
219 control.name =
"rotate_x";
220 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
222 control.name =
"move_x";
223 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
226 control.orientation.w = 1;
227 control.orientation.x = 0;
228 control.orientation.y = 1;
229 control.orientation.z = 0;
230 control.name =
"rotate_z";
231 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
233 control.name =
"move_z";
234 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
237 control.orientation.w = 1;
238 control.orientation.x = 0;
239 control.orientation.y = 0;
240 control.orientation.z = 1;
241 control.name =
"rotate_y";
242 control.interaction_mode = InteractiveMarkerControl::ROTATE_AXIS;
244 control.name =
"move_y";
245 control.interaction_mode = InteractiveMarkerControl::MOVE_AXIS;
253 visualization_msgs::InteractiveMarkerControl&
256 visualization_msgs::InteractiveMarkerControl control;
257 control.always_visible =
true;
259 visualization_msgs::Marker marker;
260 marker.type = visualization_msgs::Marker::CUBE;
261 marker.scale.x = msg.scale * 0.3;
262 marker.scale.y = msg.scale * 0.10;
263 marker.scale.z = msg.scale * 0.10;
264 marker.color.r = 0.5;
265 marker.color.g = 0.5;
266 marker.color.b = 0.5;
267 marker.color.a = 1.0;
269 control.markers.push_back(marker);
270 msg.controls.push_back(control);
272 return msg.controls.back();
290 const std::size_t num_collision_objects = planning_scene->
getCollisionWorld()->getWorld()->size();
291 if (num_collision_objects == 0)
293 ROS_ERROR_STREAM_NAMED(
"cart_path_planner",
"No collision objects exist in world, you need at least a table " 294 "modeled for the controller to work");
295 ROS_ERROR_STREAM_NAMED(
"cart_path_planner",
"To fix this, relaunch the teleop/head tracking/whatever MoveIt! " 296 "node to publish the collision objects");
306 if (only_check_self_collision)
326 visual_tools->publishContactPoints(*robot_state, planning_scene);
const std::string & getName() const
#define ROS_DEBUG_STREAM_NAMED(name, args)
#define ROS_ERROR_STREAM_NAMED(name, args)
void poseEigenToMsg(const Eigen::Affine3d &e, geometry_msgs::Pose &m)
void poseMsgToEigen(const geometry_msgs::Pose &m, Eigen::Affine3d &e)
void checkSelfCollision(const collision_detection::CollisionRequest &req, collision_detection::CollisionResult &res)
const std::string & getName() const
#define ROS_INFO_STREAM_NAMED(name, args)
void update(bool force=false)
#define ROS_WARN_STREAM_THROTTLE_NAMED(rate, name, args)
void setJointGroupPositions(const std::string &joint_group_name, const double *gstate)
boost::function< bool(RobotState *robot_state, const JointModelGroup *joint_group, const double *joint_group_variable_values)> GroupStateValidityCallbackFn
bool isStateColliding(const std::string &group="", bool verbose=false)
const collision_detection::CollisionWorldConstPtr & getCollisionWorld() const