pid.h
Go to the documentation of this file.
1 #ifndef HECTOR_QUADROTOR_CONTROLLER_PID_H
2 #define HECTOR_QUADROTOR_CONTROLLER_PID_H
3 
4 #include <ros/node_handle.h>
5 
7 
8 class PID
9 {
10 public:
11  struct parameters {
12  parameters();
13  bool enabled;
14  double time_constant;
15  double k_p;
16  double k_i;
17  double k_d;
18  double limit_i;
19  double limit_output;
20  } parameters_;
21 
22  struct state {
23  state();
24  double p, i, d;
25  double input, dinput;
26  double dx;
27  } state_;
28 
29 public:
30  PID();
31  PID(const parameters& parameters);
32  ~PID();
33 
34  void init(const ros::NodeHandle &param_nh);
35  void reset();
36 
37  double update(double input, double x, double dx, const ros::Duration& dt);
38  double update(double error, double dx, const ros::Duration& dt);
39 
40  double getFilteredControlError(double& filtered_error, double time_constant, const ros::Duration& dt);
41 };
42 
43 } // namespace hector_quadrotor_controller
44 
45 #endif // HECTOR_QUADROTOR_CONTROLLER_PID_H
d
struct hector_quadrotor_controller::PID::parameters parameters_
void init(const ros::NodeHandle &param_nh)
Definition: pid.cpp:65
double update(double input, double x, double dx, const ros::Duration &dt)
Definition: pid.cpp:87
struct hector_quadrotor_controller::PID::state state_
double getFilteredControlError(double &filtered_error, double time_constant, const ros::Duration &dt)
Definition: pid.cpp:141


hector_quadrotor_controller
Author(s): Johannes Meyer
autogenerated on Sun Jul 10 2016 04:30:48