sot-core  4.11.6
Hierarchical task solver plug-in for dynamic-graph.
causal-filter.hh
Go to the documentation of this file.
1 #ifndef _SOT_CORE_CAUSAL_FILTER_H_
2 #define _SOT_CORE_CAUSAL_FILTER_H_
3 /*
4  * Copyright 2017-, Rohan Budhirja, LAAS-CNRS
5  *
6  * This file is part of sot-torque-control.
7  * sot-torque-control is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  * sot-torque-control is distributed in the hope that it will be
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details. You should
15  * have received a copy of the GNU Lesser General Public License along
16  * with sot-torque-control. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 /* --------------------------------------------------------------------- */
20 /* --- INCLUDE --------------------------------------------------------- */
21 /* --------------------------------------------------------------------- */
22 #include <Eigen/Core>
23 
42 namespace dynamicgraph {
43 namespace sot {
44 
45 class CausalFilter {
46 public:
47  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
48 
57  CausalFilter(const double &timestep, const int &xSize,
58  const Eigen::VectorXd &filter_numerator,
59  const Eigen::VectorXd &filter_denominator);
60 
61  void get_x_dx_ddx(const Eigen::VectorXd &base_x,
62  Eigen::VectorXd &x_output_dx_ddx);
63 
64  void switch_filter(const Eigen::VectorXd &filter_numerator,
65  const Eigen::VectorXd &filter_denominator);
66 
67 private:
69  double m_dt;
71  int m_x_size;
73  Eigen::VectorXd::Index m_filter_order_m;
75  Eigen::VectorXd::Index m_filter_order_n;
76 
78  Eigen::VectorXd m_filter_numerator;
80  Eigen::VectorXd m_filter_denominator;
81  bool m_first_sample;
83  int m_pt_numerator;
84  int m_pt_denominator;
85  Eigen::MatrixXd m_input_buffer;
86  Eigen::MatrixXd m_output_buffer;
87 }; // class CausalFilter
88 } // namespace sot
89 } // namespace dynamicgraph
90 #endif /* _SOT_CORE_CAUSAL_FILTER_H_ */
Eigen::VectorXd::Index Index
Definition: robot-utils.hh:39
Definition: causal-filter.hh:45
void switch_filter(const Eigen::VectorXd &filter_numerator, const Eigen::VectorXd &filter_denominator)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CausalFilter(const double &timestep, const int &xSize, const Eigen::VectorXd &filter_numerator, const Eigen::VectorXd &filter_denominator)
Definition: abstract-sot-external-interface.hh:17
void get_x_dx_ddx(const Eigen::VectorXd &base_x, Eigen::VectorXd &x_output_dx_ddx)