Public Member Functions | Private Attributes | List of all members
corbo::TimeValueBuffer Class Reference

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
 

Detailed Description

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).

Author
Christoph Rösmann (chris.nosp@m.toph.nosp@m..roes.nosp@m.mann.nosp@m.@tu-d.nosp@m.ortm.nosp@m.und.d.nosp@m.e)

Definition at line 53 of file time_value_buffer.h.

Constructor & Destructor Documentation

◆ TimeValueBuffer()

corbo::TimeValueBuffer::TimeValueBuffer ( )
default

Default constructor.

Member Function Documentation

◆ appendValues()

void corbo::TimeValueBuffer::appendValues ( double  t,
const Eigen::Ref< const Eigen::VectorXd > &  u 
)

Definition at line 89 of file time_value_buffer.cpp.

◆ getValues()

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()).

See also
setInitialValue(), setTimeDelay(), reset()
Parameters
[in]tCurrent time stamp
[in]uValue which is expected at t in case of ignoring the time-delay
[in]dtDuration for u (note, we assume a piecewise constant signal)
[out]useq_outvector 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.

◆ isEmpty()

bool corbo::TimeValueBuffer::isEmpty ( ) const
inline

Definition at line 81 of file time_value_buffer.h.

◆ reset()

void corbo::TimeValueBuffer::reset ( )
inline

Reset internal buffer.

Definition at line 84 of file time_value_buffer.h.

◆ setInitialValue()

void corbo::TimeValueBuffer::setInitialValue ( const Eigen::Ref< const Eigen::VectorXd > &  uinit)
inline

Specify initial value.

Definition at line 79 of file time_value_buffer.h.

Member Data Documentation

◆ _ucache

std::vector<std::pair<double, Eigen::VectorXd> > corbo::TimeValueBuffer::_ucache
private

Definition at line 90 of file time_value_buffer.h.

◆ _uinit

Eigen::VectorXd corbo::TimeValueBuffer::_uinit
private

Definition at line 88 of file time_value_buffer.h.


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


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:08:03