#include <sot/torque_control/numerical-difference.hh>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | NumericalDifference (const std::string &name) |
DECLARE_SIGNAL_IN (x, dynamicgraph::Vector) | |
DECLARE_SIGNAL_INNER (x_dx_ddx, dynamicgraph::Vector) | |
This signal contains the estimated positions, velocities and accelerations. More... | |
DECLARE_SIGNAL_OUT (ddx, dynamicgraph::Vector) | |
DECLARE_SIGNAL_OUT (dx, dynamicgraph::Vector) | |
DECLARE_SIGNAL_OUT (x_filtered, dynamicgraph::Vector) | |
virtual void | display (std::ostream &os) const |
void | init (const double ×tep, const int &sigSize, const double &delay, const int &polyOrder) |
Protected Member Functions | |
void | sendMsg (const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0) |
Protected Attributes | |
std::vector< double > | m_ddx_filter_std |
double | m_delay |
sampling timestep of the input signal More... | |
double | m_dt |
std::vector< double > | m_dx_filter_std |
2nd derivative More... | |
PolyEstimator * | m_filter |
x signal More... | |
std::vector< double > | m_x_filter_std |
1st derivative More... | |
std::vector< double > | m_x_std |
filtered output More... | |
int | x_size |
delay introduced by the estimation More... | |
This Entity takes as inputs a signal and estimates its first two time derivatives.
Definition at line 47 of file numerical-difference.hh.
NumericalDifference | ( | const std::string & | name | ) |
— CONSTRUCTOR -—
Definition at line 37 of file numerical-difference.cpp.
References ALL_INPUT_SIGNALS, ALL_OUTPUT_SIGNALS, NumericalDifference::init(), NumericalDifference::m_delay, NumericalDifference::m_dt, and NumericalDifference::x_size.
DECLARE_SIGNAL_IN | ( | x | , |
dynamicgraph::Vector | |||
) |
DECLARE_SIGNAL_INNER | ( | x_dx_ddx | , |
dynamicgraph::Vector | |||
) |
This signal contains the estimated positions, velocities and accelerations.
The following inner signals are used because this entity has some output signals whose related quantities are computed at the same time by the same algorithm To avoid the risk of recomputing the same things twice, we create an inner signal that groups together all the quantities that are computed together. Then the single output signals will depend on this inner signal, which is the one triggering the computations. Inner signals are not exposed, so that nobody can access them.
DECLARE_SIGNAL_OUT | ( | ddx | , |
dynamicgraph::Vector | |||
) |
DECLARE_SIGNAL_OUT | ( | dx | , |
dynamicgraph::Vector | |||
) |
DECLARE_SIGNAL_OUT | ( | x_filtered | , |
dynamicgraph::Vector | |||
) |
|
virtual |
Definition at line 139 of file numerical-difference.cpp.
void init | ( | const double & | timestep, |
const int & | sigSize, | ||
const double & | delay, | ||
const int & | polyOrder | ||
) |
Initialize the NumericalDifference.
timestep | Period (in seconds) after which the sensors' data are updated. |
sigSize | Size of the input signal. |
delay | Delay (in seconds) introduced by the estimation. This should be a multiple of timestep. |
polyOrder | Order of the approximation polynomial. int 1 or 2. |
Definition at line 60 of file numerical-difference.cpp.
References NumericalDifference::m_ddx_filter_std, NumericalDifference::m_delay, NumericalDifference::m_dt, NumericalDifference::m_dx_filter_std, NumericalDifference::m_filter, NumericalDifference::m_x_filter_std, NumericalDifference::m_x_std, and NumericalDifference::x_size.
Referenced by NumericalDifference::NumericalDifference().
|
inlineprotected |
Definition at line 98 of file numerical-difference.hh.
|
protected |
std::vector to use with the filters All the variables whose name contains 'filter' are outputs of the filters
Definition at line 72 of file numerical-difference.hh.
Referenced by NumericalDifference::init().
|
protected |
sampling timestep of the input signal
Definition at line 68 of file numerical-difference.hh.
Referenced by NumericalDifference::init(), and NumericalDifference::NumericalDifference().
|
protected |
Definition at line 67 of file numerical-difference.hh.
Referenced by NumericalDifference::init(), and NumericalDifference::NumericalDifference().
|
protected |
2nd derivative
Definition at line 73 of file numerical-difference.hh.
Referenced by NumericalDifference::init().
|
protected |
x signal
polynomial-fitting filters
Definition at line 78 of file numerical-difference.hh.
Referenced by NumericalDifference::init().
|
protected |
1st derivative
Definition at line 74 of file numerical-difference.hh.
Referenced by NumericalDifference::init().
|
protected |
filtered output
Definition at line 75 of file numerical-difference.hh.
Referenced by NumericalDifference::init().
|
protected |
delay introduced by the estimation
Definition at line 69 of file numerical-difference.hh.
Referenced by NumericalDifference::init(), and NumericalDifference::NumericalDifference().