Time Delay Object for Piecewise-Constant Signals. More...
#include <time_value_buffer.h>
Public Member Functions | |
void | appendValues (double t, const Eigen::Ref< const Eigen::VectorXd > &u) |
void | getValues (double ts, double dt, std::vector< std::pair< double, Eigen::VectorXd >> &useq_out) |
Compute the delayed values. More... | |
bool | isEmpty () const |
void | reset () |
Reset internal buffer. More... | |
void | setInitialValue (const Eigen::Ref< const Eigen::VectorXd > &uinit) |
Specify initial value. More... | |
TimeValueBuffer ()=default | |
Default constructor. More... | |
Private Attributes | |
std::vector< std::pair< double, Eigen::VectorXd > > | _ucache |
Eigen::VectorXd | _uinit |
Time Delay Object for Piecewise-Constant Signals.
This class realzies a time delay for piecewise-constant signals (discretization can be arbitrarily and must not be uniform). Internally, the object caches the last few controls in combination with their time durations. This time is then mapped to the delayed time basis. In case no previous signal value is present, a previously defined initial value is returned (default: zero vector).
Definition at line 53 of file time_value_buffer.h.
|
default |
Default constructor.
void corbo::TimeValueBuffer::appendValues | ( | double | t, |
const Eigen::Ref< const Eigen::VectorXd > & | u | ||
) |
Definition at line 89 of file time_value_buffer.cpp.
void corbo::TimeValueBuffer::getValues | ( | double | ts, |
double | dt, | ||
std::vector< std::pair< double, Eigen::VectorXd >> & | useq_out | ||
) |
Compute the delayed values.
Adds the input u to the internal cache and returns all vectors u that fall into the time interval [t, dt]. If no previously cache vector is available (e.g. at the beginning), an initial value is returned (see setInitialValue()).
[in] | t | Current time stamp |
[in] | u | Value which is expected at t in case of ignoring the time-delay |
[in] | dt | Duration for u (note, we assume a piecewise constant signal) |
[out] | useq_out | vector containing pairs of (dt and controls) (from the delayed time-base) [useq_out is cleared] |
Definition at line 30 of file time_value_buffer.cpp.
|
inline |
Definition at line 81 of file time_value_buffer.h.
|
inline |
Reset internal buffer.
Definition at line 84 of file time_value_buffer.h.
|
inline |
Specify initial value.
Definition at line 79 of file time_value_buffer.h.
|
private |
Definition at line 90 of file time_value_buffer.h.
|
private |
Definition at line 88 of file time_value_buffer.h.