sot-torque-control  1.6.5
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
lin-estimator.hh
Go to the documentation of this file.
1 /*
2  Oscar Efrain RAMOS PONCE, LAAS-CNRS
3  Date: 28/10/2014
4  Object to estimate a polynomial of first order that fits some data.
5 */
6 
7 #ifndef _LIN_ESTIMATOR_HH_
8 #define _LIN_ESTIMATOR_HH_
9 
11 
16 class LinEstimator : public PolyEstimator {
17  public:
24  LinEstimator(const unsigned int& N, const unsigned int& dim,
25  const double& dt = 0.0);
26 
27  virtual void estimate(std::vector<double>& estimee,
28  const std::vector<double>& el);
29 
30  virtual void estimateRecursive(std::vector<double>& estimee,
31  const std::vector<double>& el,
32  const double& time);
33 
34  void getEstimateDerivative(std::vector<double>& estimeeDerivative,
35  const unsigned int order);
36 
37  private:
38  virtual void fit();
39  virtual double getEsteeme();
40 
41  int dim_; // size of the data
42 
43  // Sums for the recursive computation
44  double sum_ti_;
45  double sum_ti2_;
46  std::vector<double> sum_xi_;
47  std::vector<double> sum_tixi_;
48 
49  // coefficients of the polynomial c2*x^2 + c1*x + c0
50  std::vector<double> c0_;
51  std::vector<double> c1_;
52 
53  // Rows of the pseudo-inverse (when assuming constant sample time)
54  double* pinv0_;
55  double* pinv1_;
56  // Half of the maximum time (according to the size of the window and dt)
57  double tmed_;
58 };
59 
60 #endif
LinEstimator::getEstimateDerivative
void getEstimateDerivative(std::vector< double > &estimeeDerivative, const unsigned int order)
Definition: lin-estimator.cpp:195
poly-estimator.hh
LinEstimator::estimateRecursive
virtual void estimateRecursive(std::vector< double > &estimee, const std::vector< double > &el, const double &time)
Definition: lin-estimator.cpp:57
PolyEstimator
Definition: poly-estimator.hh:30
LinEstimator::estimate
virtual void estimate(std::vector< double > &estimee, const std::vector< double > &el)
Definition: lin-estimator.cpp:149
LinEstimator::LinEstimator
LinEstimator(const unsigned int &N, const unsigned int &dim, const double &dt=0.0)
Definition: lin-estimator.cpp:10
LinEstimator
Definition: lin-estimator.hh:16