ImuDataMessage.h
Go to the documentation of this file.
1 
39 #ifndef LibMultiSense_ImuDataMessage
40 #define LibMultiSense_ImuDataMessage
41 
43 
44 namespace crl {
45 namespace multisense {
46 namespace details {
47 namespace wire {
48 
50 public:
51  static CRL_CONSTEXPR VersionType VERSION = 2;
52  static CRL_CONSTEXPR uint16_t TYPE_ACCEL = 1;
53  static CRL_CONSTEXPR uint16_t TYPE_GYRO = 2;
54  static CRL_CONSTEXPR uint16_t TYPE_MAG = 3;
55 
56  uint16_t type;
57  int64_t timeNanoSeconds;
58  float x, y, z;
59  uint64_t ptpNanoSeconds;
60 
61 #ifndef SENSORPOD_FIRMWARE
62  template<class Archive>
63  void serialize(Archive& message,
64  const VersionType version)
65  {
66  (void) version;
67  message & type;
68  message & timeNanoSeconds;
69  message & x;
70  message & y;
71  message & z;
72 
73  if (version >= 2)
74  {
75  message & ptpNanoSeconds;
76  }
77  }
78 #endif // !SENSORPOD_FIRMWARE
79 };
80 
81 class ImuData {
82 public:
84  static CRL_CONSTEXPR VersionType VERSION = 1;
85 
86  uint32_t sequence;
87  std::vector<ImuSample> samples;
88 
89 #ifndef SENSORPOD_FIRMWARE
90 
91  //
92  // Constructors
93 
95  ImuData() {};
96 
97  //
98  // Serialization routine
99 
100  template<class Archive>
101  void serialize(Archive& message,
102  const VersionType version)
103  {
104  (void) version;
105  message & sequence;
106  message & samples;
107  }
108 #endif // !SENSORPOD_FIRMWARE
109 
110 };
111 
112 }}}} // namespaces
113 
114 #endif
static CRL_CONSTEXPR IdType ID_DATA_IMU
Definition: Protocol.h:209
void serialize(Stream &stream, const T &t)
Definition: channel.cc:56
ImuData(utility::BufferStreamReader &r, VersionType v)
#define WIRE_HEADER_ATTRIBS_
Definition: Protocol.h:64
void serialize(Archive &message, const VersionType version)
void serialize(Archive &message, const VersionType version)
#define CRL_CONSTEXPR
Definition: Portability.hh:51


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50