controller.h
Go to the documentation of this file.
1 #ifndef CONTROLLER_H
2 #define CONTROLLER_H
3 
4 // ROS
5 #include <ros/ros.h>
6 #include <geometry_msgs/Twist.h>
7 #include <nav_msgs/Odometry.h>
8 #include <nav_msgs/Path.h>
9 #include <tuw_multi_robot_msgs/RobotInfo.h>
10 
12 {
13 typedef struct Point_t
14 {
15  float x = 0;
16  float y = 0;
17  float theta = 0;
18 } PathPoint;
19 
20 
21 
22 typedef enum state_t
23 {
24  run,
28 } state;
29 
31 {
32 
33 public:
38  Controller();
44  void setPath(std::shared_ptr<std::vector<PathPoint>> _path);
51  void update(PathPoint _odom, float _delta_t);
58  void setSpeedParams(float _max_v, float _max_w);
65  void getSpeed(float *_v, float *_w);
71  void setGoalRadius(float _r);
79  void setPID(float _Kp, float _Ki, float _Kd);
85  void setState(state s);
90  size_t getProgress();
95  bool isActive();
96 
97  int getStatus();
98  void setGoodId(int);
99  int getGoodId();
100  void setOrderId(int);
101  int getOrderId();
102  void setOrderStatus(int);
103  int getOrderStatus();
104 
105 private:
106  float normalizeAngle(float _angle);
107  float absolute(float _val);
108  bool checkGoal(PathPoint _odom);
109  std::vector<PathPoint> path_;
111  float max_v_, max_w_;
112  float v_, w_;
113  bool plan_active = false;
114  float e_last_ = 0;
115  float e_dot_ = 0;
116  float Kp_ = 5;
117  float Kd_ = 1;
118  float Ki_ = 0.0;
119 
120  int robot_status = tuw_multi_robot_msgs::RobotInfo::STATUS_STOPPED;
121  int goodId;
122  int orderId;
124 
125  float goal_radius_ = 0.25;
126 
127  state actual_cmd_ = run;
128 
129 protected:
131 };
132 
133 } // namespace velocity_controller
134 
135 #endif // CONTROLLER_NODE_H
struct velocity_controller::Point_t PathPoint
XmlRpcServer s
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
std::vector< PathPoint > path_
Definition: controller.h:109
enum velocity_controller::state_t state


tuw_multi_robot_ctrl
Author(s): Benjamin Binder
autogenerated on Mon Feb 28 2022 23:57:38