#include <sot/torque_control/utils/lin-estimator.hh>


Public Member Functions | |
| LinEstimator (const unsigned int &N, const unsigned int &dim, const double &dt=0.0) | |
| virtual void | estimate (std::vector< double > &estimee, const std::vector< double > &el) |
| virtual void | estimateRecursive (std::vector< double > &estimee, const std::vector< double > &el, const double &time) |
| void | getEstimateDerivative (std::vector< double > &estimeeDerivative, const unsigned int order) |
Public Member Functions inherited from PolyEstimator | |
| PolyEstimator (const unsigned int &order, const unsigned int &N, const double &dt) | |
| void | estimate (std::vector< double > &estimee, const std::vector< double > &data_element, const double &time) |
| unsigned int | getWindowLength () |
| void | setWindowLength (const unsigned int &N) |
Additional Inherited Members | |
Protected Attributes inherited from PolyEstimator | |
| Eigen::VectorXd | coeff_ |
| Coefficients for the least squares solution. More... | |
| double | dt_ |
| Sampling (control) time. More... | |
| bool | dt_zero_ |
| Indicate that dt is zero (dt is invalid) More... | |
| std::vector< std::vector< double > > | elem_list_ |
| All the data (N elements of size dim) More... | |
| bool | first_run_ |
| unsigned int | N_ |
| Window length. More... | |
| unsigned int | order_ |
| Order of the polynomial estimator. More... | |
| unsigned int | pt_ |
| Circular index to each data and time element. More... | |
| Eigen::MatrixXd | R_ |
| std::vector< double > | t_ |
| Time vector setting the lowest time to zero (for numerical stability). More... | |
| std::vector< double > | time_list_ |
| Time vector corresponding to each element in elem_list_. More... | |
| std::vector< double > | x_ |
Object to fit a first order polynomial to a given data. This can be used to compute the velocities given the positions.
Definition at line 16 of file lin-estimator.hh.
| LinEstimator | ( | const unsigned int & | N, |
| const unsigned int & | dim, | ||
| const double & | dt = 0.0 |
||
| ) |
Create a linear estimator on a window of length N
| N | is the window length. |
| dim | is the dimension of the input elements (number of dofs). |
| dt | is the control (sampling) time. |
Definition at line 10 of file lin-estimator.cpp.
|
virtual |
Estimate the polynomial given a new element assuming a constant time difference. This constant time difference between consecutive samples is given by dt (specified in the constructor).
Note: This function will only work if dt is different to zero.
| [out] | estimee | is the calculated estimation. |
| [in] | data_element | is the new data vector. |
Implements PolyEstimator.
Definition at line 149 of file lin-estimator.cpp.
|
virtual |
Estimate the polynomial given a new element using a recursive algorithm. This method is faster. However, it takes the time as it is (it does not set the lowest time to zero), which can create "ill-conditions".
| [out] | estimee | is the calculated estimation |
| [in] | data_element | is the new data. |
| [in] | time | is the time stamp corresponding to the new data. |
Implements PolyEstimator.
Definition at line 57 of file lin-estimator.cpp.
|
virtual |
Get the time derivative of the estimated polynomial.
| [out] | estimeeDerivative | is the calculated time derivative. |
| [in] | order | The order of the derivative (e.g. 1 means the first derivative). |
Implements PolyEstimator.
Definition at line 195 of file lin-estimator.cpp.