Drake
SignalLog< T > Class Template Reference

This utility class serves as an in-memory cache of time-dependent vector values. More...

#include <drake/systems/primitives/signal_log.h>

Public Member Functions

 SignalLog (int input_size, int batch_allocation_size=1000)
 Constructs the signal log. More...
 
int num_samples () const
 Returns the number of samples taken since construction or last reset(). More...
 
Eigen::VectorBlock< const VectorX< T > > sample_times () const
 Accesses the logged time stamps. More...
 
Eigen::Block< const MatrixX< T >, Eigen::Dynamic, Eigen::Dynamic, true > data () const
 Accesses the logged data. More...
 
void reset ()
 Clears the logged data. More...
 
void AddData (T time, VectorX< T > sample)
 Adds a sample to the data set with the associated time value. More...
 
int64_t get_input_size () const
 Reports the size of the log's input vector. More...
 
Does not allow copy, move, or assignment
 SignalLog (const SignalLog &)=delete
 
SignalLogoperator= (const SignalLog &)=delete
 
 SignalLog (SignalLog &&)=delete
 
SignalLogoperator= (SignalLog &&)=delete
 

Detailed Description

template<typename T>
class drake::systems::SignalLog< T >

This utility class serves as an in-memory cache of time-dependent vector values.

Note that this is a standalone class, not a Drake System. It is primarily intended to support the Drake System primitive SignalLogger, but can be used independently.

Template Parameters
TThe vector element type, which must be a valid Eigen scalar.

Constructor & Destructor Documentation

◆ SignalLog() [1/3]

SignalLog ( const SignalLog< T > &  )
delete

◆ SignalLog() [2/3]

SignalLog ( SignalLog< T > &&  )
delete

◆ SignalLog() [3/3]

SignalLog ( int  input_size,
int  batch_allocation_size = 1000 
)
explicit

Constructs the signal log.

Parameters
input_sizeDimension of the per-time step data set.
batch_allocation_sizeStorage is (re)allocated in blocks of size (input_size X batch_allocation_size).

Member Function Documentation

◆ AddData()

void AddData ( time,
VectorX< T >  sample 
)

Adds a sample to the data set with the associated time value.

Parameters
timeThe time value for this sample.
sampleA vector of data of the declared size for this log.

◆ data()

Eigen::Block<const MatrixX<T>, Eigen::Dynamic, Eigen::Dynamic, true> data ( ) const
inline

Accesses the logged data.

◆ get_input_size()

int64_t get_input_size ( ) const
inline

Reports the size of the log's input vector.

◆ num_samples()

int num_samples ( ) const
inline

Returns the number of samples taken since construction or last reset().

◆ operator=() [1/2]

SignalLog& operator= ( SignalLog< T > &&  )
delete

◆ operator=() [2/2]

SignalLog& operator= ( const SignalLog< T > &  )
delete

◆ reset()

void reset ( )
inline

Clears the logged data.

◆ sample_times()

Eigen::VectorBlock<const VectorX<T> > sample_times ( ) const
inline

Accesses the logged time stamps.


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