waypoint_provider.hpp
Go to the documentation of this file.
1 /*
2  Way point Provider
3 
4  highly inspired by yocs_waypoint_navi written by Jorge Santos
5 
6  LICENSE : BSD - https://raw.github.com/yujinrobot/yujin_ocs/license/LICENSE
7 
8  Author : Jihoon Lee
9  Date : Dec 2013
10  */
11 
12 
13 #ifndef _YOCS_WAYPOINT_PROVIDER_HPP_
14 #define _YOCS_WAYPOINT_PROVIDER_HPP_
15 
16 #include <geometry_msgs/Pose.h>
17 #include <ros/ros.h>
18 #include <visualization_msgs/MarkerArray.h>
19 #include <yocs_msgs/Trajectory.h>
20 #include <yocs_msgs/TrajectoryList.h>
21 #include <yocs_msgs/WaypointListService.h>
22 #include <yocs_msgs/WaypointList.h>
23 
24 /*
25  It simply parses waypoints in yaml file and provides latch topic
26 
27  Future improvements
28  - Utilise database for persistent waypoint storing
29  - add/remove waypoints via srv or pub/sub
30  */
31 
32 namespace yocs {
34  public:
35  WaypointProvider(ros::NodeHandle& n, yocs_msgs::WaypointList& wps, yocs_msgs::TrajectoryList& trajs);
37 
38  void spin();
39  protected:
40  void init();
41  bool processWaypointsService(yocs_msgs::WaypointListService::Request& request,
42  yocs_msgs::WaypointListService::Response& response);
43  void generateWaypointMarkers(const yocs_msgs::WaypointList& wps, visualization_msgs::MarkerArray& wp_markers);
44  void generateTrajectoryMarkers(const yocs_msgs::TrajectoryList& trajs,
45  visualization_msgs::MarkerArray& traj_markers);
46  void createMarkerArrow(const int i, const yocs_msgs::Waypoint& wp, visualization_msgs::Marker& marker);
47  void createMarkerLineStrip(const int i, const yocs_msgs::Trajectory& traj, visualization_msgs::Marker& marker);
48  void createMarkerLabel(const std::string frame_id,
49  const int id,
50  const std::string ns,
51  const std::string wp_name,
52  const geometry_msgs::Pose wp_pose,
53  visualization_msgs::Marker& marker);
54 
55  private:
61 
62  yocs_msgs::WaypointList waypoints_;
63  yocs_msgs::TrajectoryList trajectories_;
64  visualization_msgs::MarkerArray waypoint_markers_, trajectory_markers_;
65 
68  };
69 }
70 
71 #endif // _YOCS_WAYPOINT_PROVIDER_HPP_
ros::Publisher waypoints_marker_pub_
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)
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_
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)


yocs_waypoint_provider
Author(s): Jihoon Lee
autogenerated on Mon Jun 10 2019 15:54:09