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;
76 
78  Eigen::VectorXd m_filter_numerator;
80  Eigen::VectorXd m_filter_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_MAKE_ALIGNED_OPERATOR_NEW CausalFilter(const double &timestep, const int &xSize, const Eigen::VectorXd &filter_numerator, const Eigen::VectorXd &filter_denominator)
void get_x_dx_ddx(const Eigen::VectorXd &base_x, Eigen::VectorXd &x_output_dx_ddx)
double m_dt
sampling timestep of the input signal
Eigen::VectorXd m_filter_numerator
Coefficients of the numerator .
Eigen::VectorXd::Index m_filter_order_m
Size of the numerator .
std::size_t Index
void switch_filter(const Eigen::VectorXd &filter_numerator, const Eigen::VectorXd &filter_denominator)
Eigen::VectorXd m_filter_denominator
Coefficients of the denominator .
Eigen::VectorXd::Index m_filter_order_n
Size of the denominator .


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26