Tetrapod Project
filter_utils.h
Go to the documentation of this file.
1 #ifndef filter_utils_h
2 #define filter_utils_h
3 
4 #include <Eigen/Core>
5 
7 {
8 public:
10  ThirdOrderFilter(double _dt, double _x_current, double _x_goal, double _omega, double _zeta);
11  void setReference(double _x_goal){x_goal = _x_goal;};
12  void setParameters(double _frequency, double _damping);
13  void setTimestep(double _dt){dt = _dt;}
14  void setCurrentPos(double _x_current){X(0) = _x_current;}
15  double getPosition(){return X(0);}
16  double getSpeed(){return X(1);}
17  double getAcceleration(){return X(2);}
18  void updateFilter();
19  Eigen::Matrix<double, 3, 1> getState() {return X;}
20  double getGoalPos(){return x_goal;}
21 private:
22  Eigen::Matrix<double, 3, 1> X = Eigen::Matrix<double, 3, 1>::Zero();
23  double x_goal;
24  double dt;
25  Eigen::Matrix<double, 3, 3> A_d;
26  Eigen::Matrix<double, 3, 1> B_d;
27 };
28 
29 #endif
Eigen::Matrix< double, 3, 1 > getState()
Definition: filter_utils.h:19
Eigen::Matrix< double, 3, 1 > X
Definition: filter_utils.h:22
void setReference(double _x_goal)
Definition: filter_utils.h:11
void setParameters(double _frequency, double _damping)
Eigen::Matrix< double, 3, 3 > A_d
Definition: filter_utils.h:25
void setCurrentPos(double _x_current)
Definition: filter_utils.h:14
double getSpeed()
Definition: filter_utils.h:16
double getGoalPos()
Definition: filter_utils.h:20
double getAcceleration()
Definition: filter_utils.h:17
void setTimestep(double _dt)
Definition: filter_utils.h:13
Eigen::Matrix< double, 3, 1 > B_d
Definition: filter_utils.h:26
double getPosition()
Definition: filter_utils.h:15