wbc
PIDController.hpp
Go to the documentation of this file.
1#ifndef PID_CONTROLLER_HPP
2#define PID_CONTROLLER_HPP
3
4#include <base/Eigen.hpp>
5#include "PIDCtrlParams.hpp"
6
7namespace wbc{
8
31protected:
34 base::VectorXd control_error;
35 base::VectorXd prev_control_error;
36 base::VectorXd dead_zone;
37 base::VectorXd max_ctrl_output;
38 base::VectorXd integral;
39 base::VectorXd derivative;
40 base::VectorXd control_output;
41 base::VectorXd setpoint;
42 base::VectorXd feedback;
43
44public:
46 virtual ~PIDController(){}
47
49 void update(const double delta_t);
50
51 void setPID(const PIDCtrlParams &params);
53 void setMaxCtrlOutput(const base::VectorXd &max);
54 const base::VectorXd &maxCtrlOutput(){return max_ctrl_output;}
55 void setDeadZone(const base::VectorXd &dz);
56 const base::VectorXd &deadZone(){return dead_zone;}
57 void applySaturation(const base::VectorXd& in, const base::VectorXd& max, base::VectorXd &out);
58 void applyDeadZone(const base::VectorXd& in, const base::VectorXd& min, base::VectorXd& out);
59 uint getDimension(){return dimension;}
60 base::VectorXd getControlError(){return control_error;}
61
62 virtual const base::VectorXd& computeDerivative(const double delta_t);
63};
64
65}
66
67#endif
The PIDController class implements an n-dimensional PID controller.
Definition PIDController.hpp:30
const base::VectorXd & deadZone()
Definition PIDController.hpp:56
void applyDeadZone(const base::VectorXd &in, const base::VectorXd &min, base::VectorXd &out)
Definition PIDController.cpp:50
const base::VectorXd & maxCtrlOutput()
Definition PIDController.hpp:54
base::VectorXd control_error
Definition PIDController.hpp:34
virtual ~PIDController()
Definition PIDController.hpp:46
base::VectorXd derivative
Definition PIDController.hpp:39
base::VectorXd integral
Definition PIDController.hpp:38
void update(const double delta_t)
Definition PIDController.cpp:22
virtual const base::VectorXd & computeDerivative(const double delta_t)
Definition PIDController.cpp:88
base::VectorXd setpoint
Definition PIDController.hpp:41
uint dimension
Definition PIDController.hpp:33
PIDCtrlParams pid_params
Definition PIDController.hpp:32
void setDeadZone(const base::VectorXd &dz)
Definition PIDController.cpp:81
PIDController(uint dimension)
Definition PIDController.cpp:7
base::VectorXd dead_zone
Definition PIDController.hpp:36
void setPID(const PIDCtrlParams &params)
Definition PIDController.cpp:63
base::VectorXd max_ctrl_output
Definition PIDController.hpp:37
uint getDimension()
Definition PIDController.hpp:59
void setMaxCtrlOutput(const base::VectorXd &max)
Definition PIDController.cpp:75
base::VectorXd feedback
Definition PIDController.hpp:42
base::VectorXd getControlError()
Definition PIDController.hpp:60
base::VectorXd control_output
Definition PIDController.hpp:40
void applySaturation(const base::VectorXd &in, const base::VectorXd &max, base::VectorXd &out)
Definition PIDController.cpp:42
const PIDCtrlParams & getPID()
Definition PIDController.hpp:52
base::VectorXd prev_control_error
Definition PIDController.hpp:35
Definition PIDCtrlParams.hpp:8
Definition ContactsAccelerationConstraint.cpp:3