sot-torque-control  1.6.4
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
 
Loading...
Searching...
No Matches
quad-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 _QUAD_ESTIMATOR_HH_
8#define _QUAD_ESTIMATOR_HH_
9
11
18 public:
25 QuadEstimator(const unsigned int& N, const unsigned int& dim,
26 const double& dt = 0.0);
27
28 virtual void estimate(std::vector<double>& estimee,
29 const std::vector<double>& el);
30
31 virtual void estimateRecursive(std::vector<double>& estimee,
32 const std::vector<double>& el,
33 const double& time);
34
35 virtual void getEstimateDerivative(std::vector<double>& estimeeDerivative,
36 const unsigned int order);
37
38 private:
39 virtual double getEsteeme();
40 virtual void fit();
41
42 int dim_; // size of the data
43
44 // Sums for the recursive computation
45 double sum_ti_;
46 double sum_ti2_;
47 double sum_ti3_;
48 double sum_ti4_;
49 std::vector<double> sum_xi_;
50 std::vector<double> sum_tixi_;
51 std::vector<double> sum_ti2xi_;
52
53 // coefficients of the polynomial c2*x^2 + c1*x + c0
54 std::vector<double> c0_;
55 std::vector<double> c1_;
56 std::vector<double> c2_;
57
58 // Rows of the pseudo-inverse (when assuming constant sample time)
59 double* pinv0_;
60 double* pinv1_;
61 double* pinv2_;
62 // Half of the maximum time (according to the size of the window and dt)
63 double tmed_;
64};
65
66#endif
virtual void estimateRecursive(std::vector< double > &estimee, const std::vector< double > &el, const double &time)
virtual void getEstimateDerivative(std::vector< double > &estimeeDerivative, const unsigned int order)
virtual void estimate(std::vector< double > &estimee, const std::vector< double > &el)