waypoints_navi.hpp
Go to the documentation of this file.
1 
6 #ifndef YOCS_WAYPOINT_NAVI_HPP_
7 #define YOCS_WAYPOINT_NAVI_HPP_
8 
9 #include <tf/tf.h>
10 #include <tf/transform_listener.h>
11 #include <ros/ros.h>
12 #include <geometry_msgs/PointStamped.h>
13 #include <move_base_msgs/MoveBaseAction.h>
17 #include <yocs_msgs/NavigationControl.h>
18 #include <yocs_msgs/NavigationControlStatus.h>
19 #include <yocs_msgs/TrajectoryList.h>
20 #include <yocs_msgs/WaypointList.h>
21 
22 
23 namespace yocs
24 {
25 
26 /*
27  * TODO
28  * * think about how to best visualise the waypoint(s)/trajectory(ies) which are being executed
29  * * add RViz interface to yocs_waypoint_provider
30  */
31 
33 {
34 public:
37 
38  bool init();
39 
40  void waypointsCB(const yocs_msgs::WaypointList::ConstPtr& wps);
41 
42  void trajectoriesCB(const yocs_msgs::TrajectoryList::ConstPtr& trajs);
43 
44  void navCtrlCB(const yocs_msgs::NavigationControl::ConstPtr& nav_ctrl);
45 
46  void spin();
47 
48 private:
49  const geometry_msgs::PoseStamped NOWHERE;
50 
51  enum { NONE = 0,
54  } mode_;
55 
56  enum { IDLE = 0,
60  } state_;
61 
62  double frequency_;
63  double close_enough_;
64  double goal_timeout_;
65  std::string robot_frame_;
66  std::string world_frame_;
67 
68  std::vector<geometry_msgs::PoseStamped> waypoints_;
69  std::vector<geometry_msgs::PoseStamped>::iterator waypoints_it_;
70 
71  geometry_msgs::PoseStamped goal_;
72 
73  yocs_msgs::WaypointList wp_list_;
74  yocs_msgs::TrajectoryList traj_list_;
75 
79 
83 
85 
86  bool cancelAllGoals(double timeout = 2.0);
87 
88  void resetWaypoints();
89 
90  bool equals(const geometry_msgs::PoseStamped& a, const geometry_msgs::PoseStamped& b);
91 
92  bool equals(const geometry_msgs::Point& a, const geometry_msgs::Point& b);
93 
94  void publishStatusUpdate(const uint8_t& status);
95 };
96 
97 } // namespace yocs
98 
99 #endif /* YOCS_WAYPOINT_NAVI_HPP_ */
bool equals(const geometry_msgs::PoseStamped &a, const geometry_msgs::PoseStamped &b)
bool cancelAllGoals(double timeout=2.0)
const geometry_msgs::PoseStamped NOWHERE
void navCtrlCB(const yocs_msgs::NavigationControl::ConstPtr &nav_ctrl)
yocs_msgs::TrajectoryList traj_list_
ros::Subscriber trajectories_sub_
std::vector< geometry_msgs::PoseStamped >::iterator waypoints_it_
actionlib::SimpleActionClient< move_base_msgs::MoveBaseAction > move_base_ac_
yocs_msgs::WaypointList wp_list_
void publishStatusUpdate(const uint8_t &status)
void trajectoriesCB(const yocs_msgs::TrajectoryList::ConstPtr &trajs)
ros::Subscriber nav_ctrl_sub_
enum yocs::WaypointsGoalNode::@1 state_
void waypointsCB(const yocs_msgs::WaypointList::ConstPtr &wps)
tf::TransformListener tf_listener_
std::vector< geometry_msgs::PoseStamped > waypoints_
geometry_msgs::PoseStamped goal_
enum yocs::WaypointsGoalNode::@0 mode_
ros::Publisher status_pub_
ros::Subscriber waypoints_sub_


yocs_waypoints_navi
Author(s): Jorge Santos Simon
autogenerated on Mon Jun 10 2019 15:54:12