sot-torque-control  1.6.2
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, const double& dt = 0.0);
25 
26  virtual void estimate(std::vector<double>& estimee, const std::vector<double>& el);
27 
28  virtual void estimateRecursive(std::vector<double>& estimee, const std::vector<double>& el, const double& time);
29 
30  void getEstimateDerivative(std::vector<double>& estimeeDerivative, const unsigned int order);
31 
32  private:
33  virtual void fit();
34  virtual double getEsteeme();
35 
36  int dim_; // size of the data
37 
38  // Sums for the recursive computation
39  double sum_ti_;
40  double sum_ti2_;
41  std::vector<double> sum_xi_;
42  std::vector<double> sum_tixi_;
43 
44  // coefficients of the polynomial c2*x^2 + c1*x + c0
45  std::vector<double> c0_;
46  std::vector<double> c1_;
47 
48  // Rows of the pseudo-inverse (when assuming constant sample time)
49  double* pinv0_;
50  double* pinv1_;
51  // Half of the maximum time (according to the size of the window and dt)
52  double tmed_;
53 };
54 
55 #endif
LinEstimator::getEstimateDerivative
void getEstimateDerivative(std::vector< double > &estimeeDerivative, const unsigned int order)
Definition: lin-estimator.cpp:192
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:29
LinEstimator::estimate
virtual void estimate(std::vector< double > &estimee, const std::vector< double > &el)
Definition: lin-estimator.cpp:147
LinEstimator::LinEstimator
LinEstimator(const unsigned int &N, const unsigned int &dim, const double &dt=0.0)
Definition: lin-estimator.cpp:11
LinEstimator
Definition: lin-estimator.hh:16