Drake
ViewerDrawTranslator Class Reference

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

#include <drake/multibody/rigid_body_plant/viewer_draw_translator.h>

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

Public Member Functions

 ViewerDrawTranslator (const RigidBodyTree< double > &tree)
 A constructor that sets the expected sizes of both the LCM message and VectorBase vector to be the size of the state vector of tree, which is the sum of the number of position and velocity states in tree. More...
 
void Deserialize (const void *lcm_message_bytes, int lcm_message_length, VectorBase< double > *vector_base) const override
 This method must not be called. 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
 ViewerDrawTranslator (const ViewerDrawTranslator &)=delete
 
ViewerDrawTranslatoroperator= (const ViewerDrawTranslator &)=delete
 
 ViewerDrawTranslator (ViewerDrawTranslator &&)=delete
 
ViewerDrawTranslatoroperator= (ViewerDrawTranslator &&)=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_viewer_draw.

It translates between a VectorBase<double> that contains the state vector of a RigidBodyTree, and a drake::lcmt_viewer_draw message.

Constructor & Destructor Documentation

ViewerDrawTranslator ( const RigidBodyTree< double > &  tree)
explicit

A constructor that sets the expected sizes of both the LCM message and VectorBase vector to be the size of the state vector of tree, which is the sum of the number of position and velocity states in tree.

Parameters
[in]treeA reference to the RigidBodyTree with which to obtain the pose of each RigidBody to be included in the drake::lcmt_viewer_draw LCM message. This reference must remain valid for the lifetime of this object.

Member Function Documentation

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

This method must not be called.

It is not implemented and will abort if called. The method could be implement should the need arise.

Implements LcmAndVectorBaseTranslator.

ViewerDrawTranslator& operator= ( ViewerDrawTranslator &&  )
delete
ViewerDrawTranslator& operator= ( const ViewerDrawTranslator )
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: