sot-torque-control  1.6.5
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
QuadEstimator Class Reference

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

Inheritance diagram for QuadEstimator:
Collaboration diagram for QuadEstimator:

Public Member Functions

 QuadEstimator (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)
 
virtual 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_
 

Detailed Description

Object to fit a quadratic polynomial to a given data. This can be used to compute the accelerations given the positions.

Definition at line 17 of file quad-estimator.hh.

Constructor & Destructor Documentation

◆ QuadEstimator()

QuadEstimator ( const unsigned int &  N,
const unsigned int &  dim,
const double &  dt = 0.0 
)

Create a quadratic estimator on a window of length N

Parameters
Nis the window length.
dimis the dimension of the input elements (number of dofs).
dtis the control (sampling) time.

Definition at line 10 of file quad-estimator.cpp.

Member Function Documentation

◆ estimate()

void estimate ( std::vector< double > &  estimee,
const std::vector< double > &  data_element 
)
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.

Parameters
[out]estimeeis the calculated estimation.
[in]data_elementis the new data vector.

Implements PolyEstimator.

Definition at line 199 of file quad-estimator.cpp.

◆ estimateRecursive()

void estimateRecursive ( std::vector< double > &  estimee,
const std::vector< double > &  data_element,
const double &  time 
)
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".

Parameters
[out]estimeeis the calculated estimation
[in]data_elementis the new data.
[in]timeis the time stamp corresponding to the new data.

Implements PolyEstimator.

Definition at line 69 of file quad-estimator.cpp.

◆ getEstimateDerivative()

void getEstimateDerivative ( std::vector< double > &  estimeeDerivative,
const unsigned int  order 
)
virtual

Get the time derivative of the estimated polynomial.

Parameters
[out]estimeeDerivativeis the calculated time derivative.
[in]orderThe order of the derivative (e.g. 1 means the first derivative).

Implements PolyEstimator.

Definition at line 248 of file quad-estimator.cpp.


The documentation for this class was generated from the following files: