SysDeviceInfoMessage.h
Go to the documentation of this file.
1 
39 #ifndef LibMultiSense_SysDeviceInfoMessage
40 #define LibMultiSense_SysDeviceInfoMessage
41 
42 #include <algorithm>
43 #include <string>
44 #include "Protocol.h"
45 #include "../utility/BufferStream.hh"
46 
47 namespace crl {
48 namespace multisense {
49 namespace details {
50 namespace wire {
51 
52 class PcbInfo {
53 public:
55 
56  std::string name;
57  uint32_t revision;
58 
59  template<class Archive>
60  void serialize(Archive& message,
61  const VersionType version)
62  {
63  (void) version;
64  message & name;
65  message & revision;
66  }
67 };
68 
70 public:
73 
74  //
75  // These constants are stored in flash on the device, do
76  // not change these, only add.
77  //
78  // crl::multisense::DeviceInfo:: has similar constants
79  // that can be changed at will (just remember to
80  // map any differences when translating between
81  // WIRE and API.)
82 
83  static CRL_CONSTEXPR uint8_t MAX_PCBS = 8;
84 
85  static uint8_t maxPcbs()
86  {
87  return MAX_PCBS;
88  }
89 
90  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_SL = 1;
91  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7 = 2;
92  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_M = 3;
93  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7S = 4;
94  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S21 = 5;
95  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_ST21 = 6;
96  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_C6S2_S27 = 7;
97  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S30 = 8;
98  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_S7AR = 9;
99  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_KS21 = 10;
100  static CRL_CONSTEXPR uint32_t HARDWARE_REV_BCAM = 100;
101  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MONO = 101;
102 
103  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_GREY = 1;
104  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_COLOR = 2;
105  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_GREY = 3;
106  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_COLOR = 4;
107  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_IMX104_COLOR = 100;
108  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_AR0234_GREY = 200;
109  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_AR0239_COLOR = 202;
110 
111  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_NONE = 0;
112  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_SL_INTERNAL = 1;
113  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_EXTERNAL = 2;
114  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_PATTERN_PROJECTOR = 3;
115 
116  std::string key;
117  std::string name;
118  std::string buildDate;
119  std::string serialNumber;
121 
122  uint8_t numberOfPcbs;
123  PcbInfo pcbs[MAX_PCBS];
124 
125  std::string imagerName;
126  uint32_t imagerType;
127  uint32_t imagerWidth;
128  uint32_t imagerHeight;
129 
130  std::string lensName;
131  uint32_t lensType;
132  float nominalBaseline; // meters
133  float nominalFocalLength; // meters
134  float nominalRelativeAperture; // f-stop
135 
136  uint32_t lightingType;
137  uint32_t numberOfLights;
138 
139  std::string laserName;
140  uint32_t laserType;
141 
142  std::string motorName;
143  uint32_t motorType;
145 
146  //
147  // Constructors
148 
151  hardwareRevision(0),
152  imagerType(0),
153  imagerWidth(0),
154  imagerHeight(0),
155  lensType(0),
156  nominalBaseline(0),
157  nominalFocalLength(0),
158  nominalRelativeAperture(0.0),
159  lightingType(0),
160  numberOfLights(0),
161  laserType(0),
162  motorType(0),
163  motorGearReduction(0.0) {};
164 
165  //
166  // Serialization routine
167 
168  template<class Archive>
169  void serialize(Archive& message,
170  const VersionType version)
171  {
172  message & key;
173  message & name;
174  message & buildDate;
175  message & serialNumber;
176  message & hardwareRevision;
177 
178  message & numberOfPcbs;
179 
180  uint8_t num = std::min(numberOfPcbs, (uint8_t) MAX_PCBS);
181  for(uint8_t i=0; i<num; i++)
182  pcbs[i].serialize(message, version);
183 
184  message & imagerName;
185  message & imagerType;
186  message & imagerWidth;
187  message & imagerHeight;
188  message & lensName;
189  message & lensType;
190  message & nominalBaseline;
191  message & nominalFocalLength;
192  message & nominalRelativeAperture;
193  message & lightingType;
194  message & numberOfLights;
195  message & laserName;
196  message & laserType;
197  message & motorName;
198  message & motorType;
199  message & motorGearReduction;
200  }
201 };
202 
203 }}}} // namespaces
204 
205 #endif
void serialize(Archive &message, const VersionType version)
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR IdType ID_DATA_SYS_DEVICE_INFO
Definition: Protocol.h:201
Definition: channel.cc:56
SysDeviceInfo(utility::BufferStreamReader &r, VersionType v)
#define CRL_CONSTEXPR
Definition: Portability.hh:51
static CRL_CONSTEXPR VersionType VERSION


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