Drake
LcmtDrakeSignalTranslator Class Reference

Specializes LcmAndVectorBaseTranslator to handle LCM messages of type drake::lcmt_drake_signal. More...

#include <systems/lcm/lcmt_drake_signal_translator.h>

Inheritance diagram for LcmtDrakeSignalTranslator:
[legend]
Collaboration diagram for LcmtDrakeSignalTranslator:
[legend]

Public Member Functions

 LcmtDrakeSignalTranslator (int size)
 A constructor that sets the expected sizes of the LCM message and the VectorBase. More...
 
void Deserialize (const void *lcm_message_bytes, int lcm_message_length, VectorBase< double > *vector_base) const override
 Translates LCM message bytes into a drake::systems::VectorBase object. More...
 
void Serialize (double time, const VectorBase< double > &vector_base, std::vector< uint8_t > *lcm_message_bytes) const override
 Translates a drake::systems::VectorBase object into LCM message bytes. More...
 
Does not allow copy, move, or assignment
 LcmtDrakeSignalTranslator (const LcmtDrakeSignalTranslator &)=delete
 
LcmtDrakeSignalTranslatoroperator= (const LcmtDrakeSignalTranslator &)=delete
 
 LcmtDrakeSignalTranslator (LcmtDrakeSignalTranslator &&)=delete
 
LcmtDrakeSignalTranslatoroperator= (LcmtDrakeSignalTranslator &&)=delete
 
- Public Member Functions inherited from LcmAndVectorBaseTranslator
 LcmAndVectorBaseTranslator (int size)
 The constructor. More...
 
virtual ~LcmAndVectorBaseTranslator ()
 
int get_vector_size () const
 Returns the size of the vector in the drake::systems::VectorBase object. More...
 
virtual std::unique_ptr< BasicVector< double > > AllocateOutputVector () const
 Allocates the vector storage for an output port of our LCM message type, in case special storage is needed. More...
 
 LcmAndVectorBaseTranslator (const LcmAndVectorBaseTranslator &)=delete
 
LcmAndVectorBaseTranslatoroperator= (const LcmAndVectorBaseTranslator &)=delete
 
 LcmAndVectorBaseTranslator (LcmAndVectorBaseTranslator &&)=delete
 
LcmAndVectorBaseTranslatoroperator= (LcmAndVectorBaseTranslator &&)=delete
 

Detailed Description

Specializes LcmAndVectorBaseTranslator to handle LCM messages of type drake::lcmt_drake_signal.

Assumes the number and order of values in the LCM message and the drake::systems::VectorBase are identical.

Constructor & Destructor Documentation

LcmtDrakeSignalTranslator ( int  size)
inlineexplicit

A constructor that sets the expected sizes of the LCM message and the VectorBase.

Both the LCM message and VectorBase must be the same size.

Parameters
[in]sizeThe number of elements in both VectorBase and drake::lcmt_drake_signal.

Here is the call graph for this function:

Member Function Documentation

void Deserialize ( const void *  lcm_message_bytes,
int  lcm_message_length,
VectorBase< double > *  vector_base 
) const
overridevirtual

Translates LCM message bytes into a drake::systems::VectorBase object.

Parameters
[in]lcm_message_bytesA pointer to a buffer holding the LCM message's data.
[in]lcm_message_lengthThe number of bytes pointed to by the lcm_message_bytes.
[out]vector_baseA pointer to where the translation of the LCM message should be stored. This pointer must not be nullptr.
Exceptions
runtime_errorIf a received LCM message failed to be decoded, or if the decoded LCM message is incompatible with the vector_base. This often occurs when the size of the vector_base does not equal or is incompatible with the size of the decoded LCM message.

Implements LcmAndVectorBaseTranslator.

Here is the call graph for this function:

Here is the caller graph for this function:

LcmtDrakeSignalTranslator& operator= ( const LcmtDrakeSignalTranslator )
delete
void Serialize ( double  time,
const VectorBase< double > &  vector_base,
std::vector< uint8_t > *  lcm_message_bytes 
) const
overridevirtual

Translates a drake::systems::VectorBase object into LCM message bytes.

Parameters
[in]timeThe current time in seconds. This value is typically obtained from drake::systems::Context::get_time().
[in]vector_baseThe object to convert into an LCM message.
[out]lcm_message_bytesThe LCM message bytes. This pointer must not be nullptr.

Implements LcmAndVectorBaseTranslator.

Here is the call graph for this function:

Here is the caller graph for this function:


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