00001 00037 #ifndef LibMultiSense_ImuInfoMessage 00038 #define LibMultiSense_ImuInfoMessage 00039 00040 #include <typeinfo> 00041 00042 #include "details/utility/Portability.hh" 00043 00044 namespace crl { 00045 namespace multisense { 00046 namespace details { 00047 namespace wire { 00048 namespace imu { 00049 00050 class RateType { 00051 public: 00052 static CRL_CONSTEXPR VersionType VERSION = 1; 00053 00054 float sampleRate; 00055 float bandwidthCutoff; 00056 00057 template<class Archive> 00058 void serialize(Archive& message, 00059 const VersionType version) 00060 { 00061 message & sampleRate; 00062 message & bandwidthCutoff; 00063 } 00064 }; 00065 00066 class RangeType { 00067 public: 00068 static CRL_CONSTEXPR VersionType VERSION = 1; 00069 00070 float range; 00071 float resolution; 00072 00073 template<class Archive> 00074 void serialize(Archive& message, 00075 const VersionType version) 00076 { 00077 message & range; 00078 message & resolution; 00079 } 00080 }; 00081 00082 class Details { 00083 public: 00084 static CRL_CONSTEXPR VersionType VERSION = 1; 00085 00086 std::string name; 00087 std::string device; 00088 std::string units; 00089 std::vector<RateType> rates; 00090 std::vector<RangeType> ranges; 00091 00092 template<class Archive> 00093 void serialize(Archive& message, 00094 const VersionType version) 00095 { 00096 message & name; 00097 message & device; 00098 message & units; 00099 message & rates; 00100 message & ranges; 00101 } 00102 }; 00103 00104 } // namespace imu 00105 00106 class ImuInfo { 00107 public: 00108 static CRL_CONSTEXPR IdType ID = ID_DATA_IMU_INFO; 00109 static CRL_CONSTEXPR VersionType VERSION = 1; 00110 00111 // 00112 // IMU details per sensor 00113 00114 uint32_t maxSamplesPerMessage; 00115 std::vector<imu::Details> details; 00116 00117 // 00118 // Constructors 00119 00120 ImuInfo(utility::BufferStreamReader&r, VersionType v) {serialize(r,v);}; 00121 ImuInfo() {}; 00122 00123 // 00124 // Serialization routine 00125 00126 template<class Archive> 00127 void serialize(Archive& message, 00128 const VersionType version) 00129 { 00130 message & maxSamplesPerMessage; 00131 message & details; 00132 } 00133 }; 00134 00135 }}}}; // namespaces 00136 00137 #endif