LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
ImuDataMessage.hh
Go to the documentation of this file.
1
39#ifndef LibMultiSense_ImuDataMessage
40#define LibMultiSense_ImuDataMessage
41
43
44namespace crl {
45namespace multisense {
46namespace details {
47namespace wire {
48
50public:
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;
58 float x, y, z;
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
81class ImuData {
82public:
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
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
#define WIRE_HEADER_ATTRIBS_
Definition Protocol.hh:65
static CRL_CONSTEXPR VersionType VERSION
ImuData(utility::BufferStreamReader &r, VersionType v)
void serialize(Archive &message, const VersionType version)
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR IdType ID_DATA_IMU
Definition Protocol.hh:221