SysDeviceInfoMessage.hh
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.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_MULTISENSE_MONOCAM = 11;
101  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_REMOTE_HEAD_VPB = 12;
102  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_REMOTE_HEAD_STEREO = 13;
103  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MULTISENSE_REMOTE_HEAD_MONOCAM = 14;
104  static CRL_CONSTEXPR uint32_t HARDWARE_REV_BCAM = 100;
105  static CRL_CONSTEXPR uint32_t HARDWARE_REV_MONO = 101;
106 
107  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_GREY = 1;
108  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV2000_COLOR = 2;
109  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_GREY = 3;
110  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_CMV4000_COLOR = 4;
111  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_FLIR_TAU2 = 7;
112  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_IMX104_COLOR = 100;
113  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_AR0234_GREY = 200;
114  static CRL_CONSTEXPR uint32_t IMAGER_TYPE_AR0239_COLOR = 202;
115 
116  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_NONE = 0;
117  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_SL_INTERNAL = 1;
118  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_EXTERNAL = 2;
119  static CRL_CONSTEXPR uint32_t LIGHTING_TYPE_S21_PATTERN_PROJECTOR = 3;
120 
121  std::string key;
122  std::string name;
123  std::string buildDate;
124  std::string serialNumber;
126 
127  uint8_t numberOfPcbs;
128  PcbInfo pcbs[MAX_PCBS];
129 
130  std::string imagerName;
131  uint32_t imagerType;
132  uint32_t imagerWidth;
133  uint32_t imagerHeight;
134 
135  std::string lensName;
136  uint32_t lensType;
137  float nominalBaseline; // meters
138  float nominalFocalLength; // meters
139  float nominalRelativeAperture; // f-stop
140 
141  uint32_t lightingType;
142  uint32_t numberOfLights;
143 
144  std::string laserName;
145  uint32_t laserType;
146 
147  std::string motorName;
148  uint32_t motorType;
150 
151  //
152  // Constructors
153 
156  hardwareRevision(0),
157  imagerType(0),
158  imagerWidth(0),
159  imagerHeight(0),
160  lensType(0),
161  nominalBaseline(0),
162  nominalFocalLength(0),
163  nominalRelativeAperture(0.0),
164  lightingType(0),
165  numberOfLights(0),
166  laserType(0),
167  motorType(0),
168  motorGearReduction(0.0) {};
169 
170  //
171  // Serialization routine
172 
173  template<class Archive>
174  void serialize(Archive& message,
175  const VersionType version)
176  {
177  message & key;
178  message & name;
179  message & buildDate;
180  message & serialNumber;
181  message & hardwareRevision;
182 
183  message & numberOfPcbs;
184 
185  uint8_t num = std::min(numberOfPcbs, (uint8_t) MAX_PCBS);
186  for(uint8_t i=0; i<num; i++)
187  pcbs[i].serialize(message, version);
188 
189  message & imagerName;
190  message & imagerType;
191  message & imagerWidth;
192  message & imagerHeight;
193  message & lensName;
194  message & lensType;
195  message & nominalBaseline;
196  message & nominalFocalLength;
197  message & nominalRelativeAperture;
198  message & lightingType;
199  message & numberOfLights;
200  message & laserName;
201  message & laserType;
202  message & motorName;
203  message & motorType;
204  message & motorGearReduction;
205  }
206 };
207 
208 }}}} // namespaces
209 
210 #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.hh:205
Definition: channel.cc:58
SysDeviceInfo(utility::BufferStreamReader &r, VersionType v)
#define CRL_CONSTEXPR
Definition: Portability.hh:49
static CRL_CONSTEXPR VersionType VERSION


multisense_lib
Author(s):
autogenerated on Sat Jun 24 2023 03:01:21