Drake
lcmt_drake_signal_translator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <vector>
5 
9 
10 namespace drake {
11 namespace systems {
12 namespace lcm {
13 
14 /**
15  * Specializes LcmAndVectorBaseTranslator to handle LCM messages of type
16  * `drake::lcmt_drake_signal`.
17  *
18  * Assumes the number and order of values in the LCM message and the
19  * drake::systems::VectorBase are identical.
20  */
22  public:
24 
25  /**
26  * A constructor that sets the expected sizes of the LCM message and the
27  * VectorBase. Both the LCM message and VectorBase must be the same size.
28  *
29  * @param[in] size The number of elements in both `VectorBase` and
30  * `drake::lcmt_drake_signal`.
31  */
32  explicit LcmtDrakeSignalTranslator(int size)
34 
35  void Deserialize(
36  const void* lcm_message_bytes, int lcm_message_length,
37  VectorBase<double>* vector_base) const override;
38 
39  void Serialize(double time,
40  const VectorBase<double>& vector_base,
41  std::vector<uint8_t>* lcm_message_bytes) const override;
42 };
43 
44 } // namespace lcm
45 } // namespace systems
46 } // namespace drake
Specializes LcmAndVectorBaseTranslator to handle LCM messages of type drake::lcmt_drake_signal.
Definition: lcmt_drake_signal_translator.h:21
Definition: automotive_demo.cc:90
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.
Definition: lcmt_drake_signal_translator.cc:50
const double time
Definition: robot_plan_interpolator_test.cc:64
Defines an abstract parent class of all translators that convert between LCM message bytes and drake:...
Definition: lcm_and_vector_base_translator.h:18
#define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname)
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:33
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.
Definition: lcmt_drake_signal_translator.cc:18
Provides careful macros to selectively enable or disable the special member functions for copy-constr...