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

#include <sot/torque_control/numerical-difference.hh>

Inheritance diagram for NumericalDifference:
Collaboration diagram for NumericalDifference:

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)
 
 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 &timestep, 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...
 
PolyEstimatorm_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...
 

Detailed Description

This Entity takes as inputs a signal and estimates its first two time derivatives.

Definition at line 49 of file numerical-difference.hh.

Constructor & Destructor Documentation

◆ NumericalDifference()

NumericalDifference ( const std::string &  name)

— CONSTRUCTOR -—

Definition at line 37 of file numerical-difference.cpp.

Member Function Documentation

◆ DECLARE_SIGNAL_IN()

DECLARE_SIGNAL_IN ( ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_INNER()

DECLARE_SIGNAL_INNER ( x_dx_ddx  ,
dynamicgraph::Vector   
)

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. This signal contains the estimated positions, velocities and accelerations.

◆ DECLARE_SIGNAL_OUT() [1/3]

DECLARE_SIGNAL_OUT ( ddx  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_OUT() [2/3]

DECLARE_SIGNAL_OUT ( dx  ,
dynamicgraph::Vector   
)

◆ DECLARE_SIGNAL_OUT() [3/3]

DECLARE_SIGNAL_OUT ( x_filtered  ,
dynamicgraph::Vector   
)

◆ display()

void display ( std::ostream &  os) const
virtual

Definition at line 154 of file numerical-difference.cpp.

◆ init()

void init ( const double &  timestep,
const int &  sigSize,
const double &  delay,
const int &  polyOrder 
)

Initialize the NumericalDifference.

Parameters
timestepPeriod (in seconds) after which the sensors' data are updated.
sigSizeSize of the input signal.
delayDelay (in seconds) introduced by the estimation. This should be a multiple of timestep.
polyOrderOrder of the approximation polynomial. int 1 or 2.
Note
The estimationDelay is half of the length of the window used for the polynomial fitting. The larger the delay, the smoother the estimations.

Definition at line 71 of file numerical-difference.cpp.

◆ sendMsg()

void sendMsg ( const std::string &  msg,
MsgType  t = MSG_TYPE_INFO,
const char *  = "",
int  = 0 
)
inlineprotected

Definition at line 105 of file numerical-difference.hh.

Member Data Documentation

◆ m_ddx_filter_std

std::vector<double> m_ddx_filter_std
protected

std::vector to use with the filters All the variables whose name contains 'filter' are outputs of the filters

Definition at line 77 of file numerical-difference.hh.

◆ m_delay

double m_delay
protected

sampling timestep of the input signal

Definition at line 73 of file numerical-difference.hh.

◆ m_dt

double m_dt
protected

Definition at line 72 of file numerical-difference.hh.

◆ m_dx_filter_std

std::vector<double> m_dx_filter_std
protected

2nd derivative

Definition at line 78 of file numerical-difference.hh.

◆ m_filter

PolyEstimator* m_filter
protected

x signal

polynomial-fitting filters

Definition at line 83 of file numerical-difference.hh.

◆ m_x_filter_std

std::vector<double> m_x_filter_std
protected

1st derivative

Definition at line 79 of file numerical-difference.hh.

◆ m_x_std

std::vector<double> m_x_std
protected

filtered output

Definition at line 80 of file numerical-difference.hh.

◆ x_size

int x_size
protected

delay introduced by the estimation

Definition at line 74 of file numerical-difference.hh.


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