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 
11 {
12 typedef struct Point_t
13 {
14  float x = 0;
15  float y = 0;
16  float theta = 0;
17 } PathPoint;
18 
19 typedef enum state_t
20 {
21  run,
25 } state;
26 
28 {
29 
30 public:
35  Controller();
41  void setPath(std::shared_ptr<std::vector<PathPoint>> _path);
48  void update(PathPoint _odom, float _delta_t);
55  void setSpeedParams(float _max_v, float _max_w);
62  void getSpeed(float *_v, float *_w);
68  void setGoalRadius(float _r);
76  void setPID(float _Kp, float _Ki, float _Kd);
82  void setState(state s);
83 
84 private:
85  float normalizeAngle(float _angle);
86  float absolute(float _val);
87  bool checkGoal(PathPoint _odom);
88  std::shared_ptr<std::vector<PathPoint>> path_;
89  float max_v_, max_w_;
90  float v_, w_;
91  std::vector<PathPoint>::iterator path_iterator_;
92  bool plan_active = false;
93  float e_last_ = 0;
94  float e_dot_ = 0;
95  float Kp_ = 5;
96  float Kd_ = 1;
97  float Ki_ = 0.0;
98  float goal_radius_ = 0.25;
99 
100  state actual_cmd_ = run;
101 
102 protected:
104 };
105 
106 } // namespace velocity_controller
107 
108 #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 >::iterator path_iterator_
Definition: controller.h:91
enum velocity_controller::state_t state
TFSIMD_FORCE_INLINE Vector3 absolute() const
std::shared_ptr< std::vector< PathPoint > > path_
Definition: controller.h:88


tuw_multi_robot_ctrl
Author(s): Benjamin Binder
autogenerated on Mon Jun 10 2019 15:42:29