position.h
Go to the documentation of this file.
1 #ifndef POSITION_H
2 #define POSITION_H
3 
4 #include <ros/ros.h>
5 #include <tf2/utils.h>
6 #include <geometry_msgs/Pose.h>
7 #include <cpswarm_msgs/OutOfBounds.h>
8 #include <cpswarm_msgs/GetSector.h>
9 
10 using namespace std;
11 using namespace ros;
12 
16 class position
17 {
18 public:
22  position ();
23 
27  ~position ();
28 
34  double bearing (geometry_msgs::Pose p) const;
35 
42  geometry_msgs::Pose compute_goal (double distance, double direction) const;
43 
51  geometry_msgs::Pose compute_goal (geometry_msgs::Pose start, double distance, double direction) const;
52 
58  double dist (geometry_msgs::Pose p) const;
59 
66  double dist (geometry_msgs::Pose p1, geometry_msgs::Pose p2) const;
67 
72  geometry_msgs::Pose get_pose () const;
73 
78  double get_yaw () const;
79 
85  bool move (geometry_msgs::Pose pose);
86 
92  bool occupied (geometry_msgs::Pose pose);
93 
99  bool out_of_bounds (geometry_msgs::Pose pose);
100 
101 private:
107  double get_yaw (geometry_msgs::Pose pose) const;
108 
114  bool reached (geometry_msgs::Pose goal);
115 
120  void pose_callback (const geometry_msgs::PoseStamped::ConstPtr& msg);
121 
125  Subscriber pose_sub;
126 
130  ServiceClient out_of_bounds_client;
131 
135  ServiceClient occupied_sector_client;
136 
140  Publisher pose_pub;
141 
145  NodeHandle nh;
146 
150  Rate* rate;
151 
155  geometry_msgs::Pose pose;
156 
161 
165  double goal_timeout;
166 
171 };
172 
173 #endif // POSITION_H
double goal_timeout
The time in seconds that the CPS is given time to reach a destination before giving up...
Definition: position.h:165
NodeHandle nh
A node handle for the main ROS node.
Definition: position.h:145
Rate * rate
The loop rate object for running the behavior control loops at a specific frequency.
Definition: position.h:150
bool pose_valid
Whether a valid position has been received.
Definition: position.h:160
geometry_msgs::Pose pose
Current position of the CPS.
Definition: position.h:155
double goal_tolerance
The distance that the CPS can be away from a goal while still being considered to have reached that g...
Definition: position.h:170
A class to provide position related functionalities.
Definition: position.h:16
Publisher pose_pub
Publisher for sending the goal position of the CPS to the position controller in the abstraction libr...
Definition: position.h:140
ServiceClient occupied_sector_client
Service client for determining the sector occupied by obstacles.
Definition: position.h:135
Subscriber pose_sub
Subscriber for the position of the CPS.
Definition: position.h:125
ServiceClient out_of_bounds_client
Service client for determining whether the goal is out of the area bounds.
Definition: position.h:130


position
Author(s):
autogenerated on Sun Dec 29 2019 10:25:17