00001 00039 #ifndef LibMultiSense_ImuDataMessage 00040 #define LibMultiSense_ImuDataMessage 00041 00042 #include "details/utility/Portability.hh" 00043 00044 namespace crl { 00045 namespace multisense { 00046 namespace details { 00047 namespace wire { 00048 00049 class WIRE_HEADER_ATTRIBS_ ImuSample { 00050 public: 00051 static CRL_CONSTEXPR VersionType VERSION = 1; 00052 static CRL_CONSTEXPR uint16_t TYPE_ACCEL = 1; 00053 static CRL_CONSTEXPR uint16_t TYPE_GYRO = 2; 00054 static CRL_CONSTEXPR uint16_t TYPE_MAG = 3; 00055 00056 uint16_t type; 00057 int64_t timeNanoSeconds; 00058 float x, y, z; 00059 00060 #ifndef SENSORPOD_FIRMWARE 00061 template<class Archive> 00062 void serialize(Archive& message, 00063 const VersionType version) 00064 { 00065 message & type; 00066 message & timeNanoSeconds; 00067 message & x; 00068 message & y; 00069 message & z; 00070 } 00071 #endif // !SENSORPOD_FIRMWARE 00072 }; 00073 00074 class ImuData { 00075 public: 00076 static CRL_CONSTEXPR IdType ID = ID_DATA_IMU; 00077 static CRL_CONSTEXPR VersionType VERSION = 1; 00078 00079 uint32_t sequence; 00080 std::vector<ImuSample> samples; 00081 00082 #ifndef SENSORPOD_FIRMWARE 00083 00084 // 00085 // Constructors 00086 00087 ImuData(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);}; 00088 ImuData() {}; 00089 00090 // 00091 // Serialization routine 00092 00093 template<class Archive> 00094 void serialize(Archive& message, 00095 const VersionType version) 00096 { 00097 message & sequence; 00098 message & samples; 00099 } 00100 #endif // !SENSORPOD_FIRMWARE 00101 00102 }; 00103 00104 }}}}; // namespaces 00105 00106 #endif