16 yocs_msgs::WaypointList& wps,
17 yocs_msgs::TrajectoryList& trajs) : nh_(n)
41 yocs_msgs::WaypointListService::Response& response)
43 ROS_INFO(
"Waypoint Manager : Received request");
46 response.success =
false;
50 response.success =
true;
56 visualization_msgs::MarkerArray& wp_viz)
58 wp_viz.markers.clear();
62 for(i = 0; i < wps.waypoints.size(); i++)
64 visualization_msgs::Marker marker;
65 visualization_msgs::Marker label;
71 wps.waypoints[i].name,
72 wps.waypoints[i].pose,
75 wp_viz.markers.push_back(marker);
76 wp_viz.markers.push_back(label);
81 visualization_msgs::MarkerArray& traj_markers)
83 traj_markers.markers.clear();
84 for(
unsigned int traj = 0; traj < trajs.trajectories.size(); ++traj)
86 visualization_msgs::Marker marker;
88 traj_markers.markers.push_back(marker);
94 const yocs_msgs::Waypoint& wp,
95 visualization_msgs::Marker& marker)
97 marker.header.frame_id = wp.header.frame_id;
99 marker.ns =
"waypoints";
101 marker.pose = wp.pose;
102 marker.type = visualization_msgs::Marker::ARROW;
103 marker.action = visualization_msgs::Marker::ADD;
104 marker.color.r = 0.0f;
105 marker.color.g = 1.0f;
106 marker.color.b = 0.0f;
107 marker.color.a = 1.0f;
108 marker.scale.x = 0.1;
109 marker.scale.y = 0.1;
110 marker.scale.z = 0.1;
116 const std::string ns,
117 const std::string wp_name,
118 const geometry_msgs::Pose wp_pose,
119 visualization_msgs::Marker& marker)
121 marker.header.frame_id = frame_id;
125 marker.scale.x = 0.1;
126 marker.scale.y = 0.1;
127 marker.scale.z = 0.1;
128 marker.color.r = 1.0f;
129 marker.color.g = 1.0f;
130 marker.color.b = 1.0f;
131 marker.color.a = 1.0f;
132 marker.pose = wp_pose;
133 marker.pose.position.z = marker.pose.position.z + marker.scale.z / 2.0 + 0.05;
134 marker.type = visualization_msgs::Marker::TEXT_VIEW_FACING;
135 marker.action = visualization_msgs::Marker::ADD;
136 marker.text = wp_name;
140 const yocs_msgs::Trajectory& traj,
141 visualization_msgs::Marker& marker)
143 marker.header.frame_id = traj.waypoints[0].header.frame_id;
145 marker.ns =
"trajectories";
147 marker.pose = geometry_msgs::Pose();
148 marker.type = visualization_msgs::Marker::LINE_STRIP;
149 marker.action = visualization_msgs::Marker::ADD;
150 marker.color.r = 0.0f;
151 marker.color.g = 0.0f;
152 marker.color.b = 1.0f;
153 marker.color.a = 1.0f;
154 marker.scale.x = 0.1;
155 marker.scale.y = 0.1;
156 marker.scale.z = 0.1;
157 for(
unsigned int wp = 0; wp < traj.waypoints.size(); ++wp)
159 marker.points.push_back(traj.waypoints[wp].pose.position);
160 marker.colors.push_back(marker.color);
ros::Publisher waypoints_marker_pub_
void publish(const boost::shared_ptr< M > &message) const
yocs_msgs::WaypointList waypoints_
bool processWaypointsService(yocs_msgs::WaypointListService::Request &request, yocs_msgs::WaypointListService::Response &response)
ros::Publisher trajectories_pub_
yocs_msgs::TrajectoryList trajectories_
void createMarkerLineStrip(const int i, const yocs_msgs::Trajectory &traj, visualization_msgs::Marker &marker)
void generateTrajectoryMarkers(const yocs_msgs::TrajectoryList &trajs, visualization_msgs::MarkerArray &traj_markers)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ros::Publisher waypoints_pub_
void createMarkerLabel(const std::string frame_id, const int id, const std::string ns, const std::string wp_name, const geometry_msgs::Pose wp_pose, visualization_msgs::Marker &marker)
visualization_msgs::MarkerArray waypoint_markers_
ros::Publisher trajectory_marker_pub_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
WaypointProvider(ros::NodeHandle &n, yocs_msgs::WaypointList &wps, yocs_msgs::TrajectoryList &trajs)
ros::ServiceServer waypoints_srv_
void createMarkerArrow(const int i, const yocs_msgs::Waypoint &wp, visualization_msgs::Marker &marker)
visualization_msgs::MarkerArray trajectory_markers_
void generateWaypointMarkers(const yocs_msgs::WaypointList &wps, visualization_msgs::MarkerArray &wp_markers)