dispatch.cc
Go to the documentation of this file.
1 
39 
40 #include <wire/AckMessage.hh>
41 
45 
47 #include <wire/CamConfigMessage.hh>
50 #include <wire/DisparityMessage.hh>
51 #include <wire/ImageMessage.hh>
52 #include <wire/ImageMetaMessage.hh>
53 #include <wire/JpegMessage.hh>
54 
56 
57 #include <wire/LidarDataMessage.hh>
58 
59 #include <wire/LedStatusMessage.hh>
60 
62 
64 
65 #include <wire/SysMtuMessage.hh>
76 
77 #include <wire/SysPpsMessage.hh>
78 
79 #include <wire/ImuDataMessage.hh>
80 #include <wire/ImuConfigMessage.hh>
81 #include <wire/ImuInfoMessage.hh>
82 
84 
93 
94 #include <limits>
95 
96 #define __STDC_FORMAT_MACROS
97 #include <inttypes.h>
98 
99 
100 namespace crl {
101 namespace multisense {
102 namespace details {
103 namespace {
104 
105 //
106 // Default UDP assembler
107 
108 void defaultUdpAssembler(utility::BufferStreamWriter& stream,
109  const uint8_t *dataP,
110  uint32_t offset,
111  uint32_t length)
112 {
113  stream.seek(offset);
114  stream.write(dataP, length);
115 }
116 
117 } // anonymous
118 
119 //
120 // Publish an image
121 
123  image::Header& header)
124 {
126 
127  std::list<ImageListener*>::const_iterator it;
128 
129  for(it = m_imageListeners.begin();
130  it != m_imageListeners.end();
131  ++ it)
132  (*it)->dispatch(buffer, header);
133 
136 }
137 
138 //
139 // Publish a laser scan
140 
142  lidar::Header& header)
143 {
145 
146  std::list<LidarListener*>::const_iterator it;
147 
148  for(it = m_lidarListeners.begin();
149  it != m_lidarListeners.end();
150  ++ it)
151  (*it)->dispatch(buffer, header);
152 
155 }
156 //
157 // Publish a PPS event
158 
160 {
162 
163  std::list<PpsListener*>::const_iterator it;
164 
165  for(it = m_ppsListeners.begin();
166  it != m_ppsListeners.end();
167  ++ it)
168  (*it)->dispatch(header);
169 
172 }
173 
174 //
175 // Publish an IMU event
176 
178 {
180 
181  std::list<ImuListener*>::const_iterator it;
182 
183  for(it = m_imuListeners.begin();
184  it != m_imuListeners.end();
185  ++ it)
186  (*it)->dispatch(header);
187 
190 }
191 
192 //
193 // Publish a compressed image
194 
196  compressed_image::Header& header)
197 {
199 
200  std::list<CompressedImageListener*>::const_iterator it;
201 
202  for(it = m_compressedImageListeners.begin();
203  it != m_compressedImageListeners.end();
204  ++ it)
205  (*it)->dispatch(buffer, header);
206 
209 }
210 
211 //
212 // Publish a Ground Surface Spline event
213 
215 {
217 
218  std::list<GroundSurfaceSplineListener*>::const_iterator it;
219 
220  for(it = m_groundSurfaceSplineListeners.begin();
221  it != m_groundSurfaceSplineListeners.end();
222  ++ it)
223  (*it)->dispatch(header);
224 
227 }
228 
229 //
230 // Publish an AprilTag detection event
231 
233 {
235 
236  std::list<AprilTagDetectionListener*>::const_iterator it;
237 
238  for(it = m_aprilTagDetectionListeners.begin();
239  it != m_aprilTagDetectionListeners.end();
240  ++ it)
241  (*it)->dispatch(header);
242 
245 }
246 
247 //
248 // Publish Secondary App Data
249 
251  secondary_app::Header& header)
252 {
254 
255  std::list<SecondaryAppListener*>::const_iterator it;
256 
257  for(it = m_secondaryAppListeners.begin();
258  it != m_secondaryAppListeners.end();
259  it ++)
260  (*it)->dispatch(buffer, header);
261 
264 }
265 
266 
267 //
268 // Dispatch incoming messages
269 
271 {
272  utility::BufferStreamReader stream(buffer);
273 
274  //
275  // Extract the type and version fields, which are stored
276  // first in the stream
277 
278  wire::IdType id;
279  wire::VersionType version;
280 
281  stream & id;
282  stream & version;
283 
284  //
285  // Handle the message.
286  //
287  // Simple, low-rate messages are dynamically stored
288  // off for possible presentation to the user in a signal
289  // handler.
290  //
291  // Larger data types use a threaded dispatch
292  // mechanism with a reference-counted buffer back-end.
293 
294  switch(id) {
296  {
297  wire::LidarData scan(stream, version);
299 
300  const int32_t scanArc = static_cast<int32_t> (utility::degreesToRadians(270.0) * 1e6); // microradians
301  const uint32_t maxRange = static_cast<uint32_t> (30.0 * 1e3); // mm
302 
303  if (false == m_networkTimeSyncEnabled) {
304 
305  header.timeStartSeconds = scan.timeStartSeconds;
306  header.timeStartMicroSeconds = scan.timeStartMicroSeconds;
307  header.timeEndSeconds = scan.timeEndSeconds;
308  header.timeEndMicroSeconds = scan.timeEndMicroSeconds;
309 
310  } else {
311 
313  header.timeStartSeconds, header.timeStartMicroSeconds);
314 
316  header.timeEndSeconds, header.timeEndMicroSeconds);
317  }
318 
319  header.scanId = scan.scanCount;
320  header.spindleAngleStart = scan.angleStart;
321  header.spindleAngleEnd = scan.angleEnd;
322  header.scanArc = scanArc;
323  header.maxRange = maxRange;
324  header.pointCount = scan.points;
325  header.rangesP = scan.distanceP;
326  header.intensitiesP = scan.intensityP;
327 
328  dispatchLidar(buffer, header);
329 
330  break;
331  }
333  {
334  wire::ImageMeta *metaP = new (std::nothrow) wire::ImageMeta(stream, version);
335 
336  if (NULL == metaP)
337  CRL_EXCEPTION_RAW("unable to allocate metadata");
338 
339  m_imageMetaCache.insert(metaP->frameId, metaP); // destroys oldest
340 
343 
344  break;
345  }
347  {
348  wire::JpegImage image(stream, version);
349 
350  const wire::ImageMeta *metaP = m_imageMetaCache.find(image.frameId);
351  if (NULL == metaP)
352  break;
353  //CRL_EXCEPTION("no meta cached for frameId %d", image.frameId);
354 
356 
357  getImageTime(metaP, header.timeSeconds, header.timeMicroSeconds);
358 
359  header.source = image.source | ((uint64_t)image.sourceExtended << 32);
360  header.bitsPerPixel = 0;
361  header.width = image.width;
362  header.height = image.height;
363  header.frameId = image.frameId;
364  header.exposure = metaP->exposureTime;
365  header.gain = metaP->gain;
366  header.framesPerSecond = metaP->framesPerSecond;
367  header.imageDataP = image.dataP;
368  header.imageLength = image.length;
369 
370  dispatchImage(buffer, header);
371 
372  break;
373  }
374  case MSG_ID(wire::Image::ID):
375  {
376  wire::Image image(stream, version);
377 
378  const wire::ImageMeta *metaP = m_imageMetaCache.find(image.frameId);
379  if (NULL == metaP)
380  break;
381  //CRL_EXCEPTION("no meta cached for frameId %d", image.frameId);
382 
384 
385  getImageTime(metaP, header.timeSeconds, header.timeMicroSeconds);
386 
387  header.source = image.source | ((uint64_t)image.sourceExtended << 32);
388  header.bitsPerPixel = image.bitsPerPixel;
389  header.width = image.width;
390  header.height = image.height;
391  header.frameId = image.frameId;
392  if (version >= 2) {
393  header.exposure = image.exposure;
394  header.gain = image.gain;
395  } else {
396  header.exposure = metaP->exposureTime;
397  header.gain = metaP->gain;
398  }
399  header.framesPerSecond = metaP->framesPerSecond;
400  header.imageDataP = image.dataP;
401  header.imageLength = static_cast<uint32_t>(std::ceil(((double) image.bitsPerPixel / 8.0) * image.width * image.height));
402 
403  dispatchImage(buffer, header);
404 
405  break;
406  }
408  {
409  wire::Disparity image(stream, version);
410 
411  const wire::ImageMeta *metaP = m_imageMetaCache.find(image.frameId);
412  if (NULL == metaP)
413  break;
414  //CRL_EXCEPTION("no meta cached for frameId %d", image.frameId);
415 
417 
418  getImageTime(metaP, header.timeSeconds, header.timeMicroSeconds);
419 
420  header.source = Source_Disparity;
422  header.width = image.width;
423  header.height = image.height;
424  header.frameId = image.frameId;
425  header.exposure = metaP->exposureTime;
426  header.gain = metaP->gain;
427  header.framesPerSecond = metaP->framesPerSecond;
428  header.imageDataP = image.dataP;
429  header.imageLength = static_cast<uint32_t>(std::ceil(((double) wire::Disparity::API_BITS_PER_PIXEL / 8.0) * image.width * image.height));
430 
431  dispatchImage(buffer, header);
432 
433  break;
434  }
435  case MSG_ID(wire::SysPps::ID):
436  {
437  wire::SysPps pps(stream, version);
438 
440 
441  header.sensorTime = pps.ppsNanoSeconds;
442 
444  header.timeSeconds, header.timeMicroSeconds);
445 
447 
448  break;
449  }
451  {
452  wire::ImuData imu(stream, version);
453 
455 
456  header.sequence = imu.sequence;
457  header.samples.resize(imu.samples.size());
458 
459  for(uint32_t i=0; i<imu.samples.size(); i++) {
460 
461  const wire::ImuSample& w = imu.samples[i];
462  imu::Sample& a = header.samples[i];
463 
464  //
465  // PTP timestamps which are 0ns are invalid and indicate the camera has lost its PTP sync with the PTP master.
466  // If that is the case, prefer to stamp the data with the non-PTP time sources
467 
468  if (m_ptpTimeSyncEnabled && w.ptpNanoSeconds != 0)
469  {
471  }
472  else {
473  if (false == m_networkTimeSyncEnabled) {
474 
476 
477  } else
480  }
481 
482  switch(w.type) {
486  default: CRL_EXCEPTION("unknown wire IMU type: %d", w.type);
487  }
488 
489  a.x = w.x; a.y = w.y; a.z = w.z;
490  }
491 
493 
494  break;
495  }
497  {
498  wire::CompressedImage image(stream, version);
499 
500  const wire::ImageMeta *metaP = m_imageMetaCache.find(image.frameId);
501  if (NULL == metaP)
502  break;
503  //CRL_EXCEPTION("no meta cached for frameId %d", image.frameId);
504 
506 
507  getImageTime(metaP, header.timeSeconds, header.timeMicroSeconds);
508 
509  header.source = image.source | ((uint64_t)image.sourceExtended << 32);
510  header.bitsPerPixel = image.bitsPerPixel;
511  header.codec = image.codec;
512  header.width = image.width;
513  header.height = image.height;
514  header.frameId = image.frameId;
515  header.exposure = image.exposure;
516  header.gain = image.gain;
517  header.framesPerSecond = metaP->framesPerSecond;
518  header.imageDataP = image.dataP;
519  header.imageLength = image.compressedDataBufferSize;
520 
522  break;
523  }
525  {
526  wire::GroundSurfaceModel spline(stream, version);
527 
529 
530  header.frameId = spline.frameId;
531  header.timestamp = spline.timestamp;
532  header.success = spline.success;
533 
534  header.controlPointsBitsPerPixel = spline.controlPointsBitsPerPixel;
535  header.controlPointsWidth = spline.controlPointsWidth;
536  header.controlPointsHeight = spline.controlPointsHeight;
537  header.controlPointsImageDataP = spline.controlPointsDataP;
538 
539  for (unsigned int i = 0; i < 2; i++)
540  {
541  header.xzCellOrigin[i] = spline.xzCellOrigin[i];
542  header.xzCellSize[i] = spline.xzCellSize[i];
543  header.xzLimit[i] = spline.xzLimit[i];
544  header.minMaxAzimuthAngle[i] = spline.minMaxAzimuthAngle[i];
545  }
546 
547  for (unsigned int i = 0; i < 6; i++)
548  {
549  header.extrinsics[i] = spline.extrinsics[i];
550  header.quadraticParams[i] = spline.quadraticParams[i];
551  }
552 
554  break;
555  }
557  {
558  wire::ApriltagDetections apriltag(stream, version);
559 
561 
562  header.frameId = apriltag.frameId;
563  header.timestamp = apriltag.timestamp;
564  header.imageSource = std::string(apriltag.imageSource);
565  header.success = apriltag.success;
566  header.numDetections = apriltag.numDetections;
567 
568  // Loop over detections and convert from wire to header type
569  for (size_t index = 0 ; index < apriltag.detections.size() ; ++index)
570  {
571  const wire::ApriltagDetection incoming = apriltag.detections[index];
572 
573  apriltag::Header::ApriltagDetection outgoing;
574 
575  outgoing.family = std::string(incoming.family);
576  outgoing.id = incoming.id;
577  outgoing.hamming = incoming.hamming;
578  outgoing.decisionMargin = incoming.decisionMargin;
579 
580  for (unsigned int i = 0; i < 3; i++)
581  {
582  for (unsigned int j = 0; j < 3; j++)
583  {
584  outgoing.tagToImageHomography[i][j] = incoming.tagToImageHomography[i][j];
585  }
586  }
587 
588  outgoing.center[0] = incoming.center[0];
589  outgoing.center[1] = incoming.center[1];
590 
591  for (unsigned int i = 0; i < 4; i++)
592  {
593  for (unsigned int j = 0; j < 2; j++)
594  {
595  outgoing.corners[i][j] = incoming.corners[i][j];
596  }
597  }
598 
599  header.detections.push_back(outgoing);
600  }
601 
603  break;
604  }
606  {
607  wire::SecondaryAppData SecondaryApp(stream, version);
608 
610 
611  wire::SecondaryAppMetadata * metaP = m_secondaryAppMetaCache.find(SecondaryApp.frameId);
612  if (metaP == NULL)
613  break;
614 
615  header.frameId = SecondaryApp.frameId;
616  header.source = SecondaryApp.source | ((uint64_t)SecondaryApp.sourceExtended << 32);
617  header.timeSeconds = SecondaryApp.timeSeconds;
618  header.timeMicroSeconds = SecondaryApp.timeMicroSeconds;
619  header.secondaryAppDataLength = SecondaryApp.length;
620  header.secondaryAppDataP = SecondaryApp.dataP;
621  header.secondaryAppMetadataP = metaP->dataP;
622  header.secondaryAppMetadataLength = metaP->dataLength;
624  break;
625  }
627  {
628  wire::SecondaryAppMetadata *metaP = new (std::nothrow) wire::SecondaryAppMetadata(stream, version);
629 
630  if (NULL == metaP)
631  CRL_EXCEPTION_RAW("unable to allocate metadata");
632 
633  m_secondaryAppMetaCache.insert(metaP->frameId, metaP); // destroys oldest
634  break;
635  }
636  case MSG_ID(wire::Ack::ID):
637  break; // handle below
639  m_messages.store(wire::CamConfig(stream, version));
640  break;
642  m_messages.store(wire::AuxCamConfig(stream, version));
643  break;
645  m_messages.store(wire::RemoteHeadConfig(stream, version));
646  break;
648  m_messages.store(wire::CamHistory(stream, version));
649  break;
651  m_messages.store(wire::LedStatus(stream, version));
652  break;
654  m_messages.store(wire::LedSensorStatus(stream, version));
655  break;
657  m_messages.store(wire::MotorPoll(stream, version));
658  break;
660  m_messages.store(wire::SysFlashResponse(stream, version));
661  break;
663  m_messages.store(wire::SysDeviceInfo(stream, version));
664  break;
666  m_messages.store(wire::SysCameraCalibration(stream, version));
667  break;
669  m_messages.store(wire::SysSensorCalibration(stream, version));
670  break;
672  m_messages.store(wire::SysTransmitDelay(stream, version));
673  break;
675  m_messages.store(wire::SysPacketDelay(stream, version));
676  break;
678  m_messages.store(wire::SysLidarCalibration(stream, version));
679  break;
680  case MSG_ID(wire::SysMtu::ID):
681  m_messages.store(wire::SysMtu(stream, version));
682  break;
684  m_messages.store(wire::SysNetwork(stream, version));
685  break;
687  m_messages.store(wire::SysDeviceModes(stream, version));
688  break;
690  m_messages.store(wire::VersionResponse(stream, version));
691  break;
693  m_messages.store(wire::StatusResponse(stream, version));
694  break;
696  m_messages.store(wire::ImuConfig(stream, version));
697  break;
699  m_messages.store(wire::ImuInfo(stream, version));
700  break;
702  m_messages.store(wire::SysTestMtuResponse(stream, version));
703  break;
706  break;
708  m_messages.store(wire::SecondaryAppConfig(stream, version));
709  break;
712  break;
714  m_messages.store(wire::PtpStatusResponse(stream, version));
715  break;
716  default:
717 
718  CRL_DEBUG("unknown message received: id=%d, version=%d\n",
719  id, version);
720  return;
721  }
722 
723  //
724  // Signal any listeners (_after_ the message is stored/dispatched)
725  //
726  // A [n]ack is a special case where we signal
727  // the returned status code of the ack'd command,
728  // otherwise we signal valid reception of this message.
729 
730  switch(id) {
731  case MSG_ID(wire::Ack::ID):
732  m_watch.signal(wire::Ack(stream, version));
733  break;
734  default:
735  m_watch.signal(id);
736  break;
737  }
738 }
739 
740 //
741 // Get a UDP assembler for this message type. We are given
742 // the first UDP packet in the stream
743 
744 impl::UdpAssembler impl::getUdpAssembler(const uint8_t *firstDatagramP,
745  uint32_t length)
746 {
747  //
748  // Get the message type, it is stored after wire::Header
749 
750  utility::BufferStreamReader stream(firstDatagramP, length);
751  stream.seek(sizeof(wire::Header));
752 
753  wire::IdType messageType;
754  stream & messageType;
755 
756  //
757  // See if a custom handler has been registered
758 
759  UdpAssemblerMap::const_iterator it = m_udpAssemblerMap.find(messageType);
760 
761  if (m_udpAssemblerMap.end() != it)
762  return it->second;
763  else
764  return defaultUdpAssembler;
765 }
766 
767 //
768 // Find a suitably sized buffer for the incoming message
769 
771 {
772  BufferPool *bP = NULL;
773 
774  if (messageLength <= RX_POOL_SMALL_BUFFER_SIZE)
775  bP = &(m_rxSmallBufferPool);
776  else if (messageLength <= RX_POOL_LARGE_BUFFER_SIZE)
777  bP = &(m_rxLargeBufferPool);
778  else
779  CRL_EXCEPTION("message too large: %d bytes", messageLength);
780 
781  //
782  // TODO: re-think the shared() mechanism of the buffers, so we do not
783  // have to walk this vector.
784 
785  BufferPool::const_iterator it = bP->begin();
786  for(; it != bP->end(); it++)
787  if (false == (*it)->shared())
788  return *(*it);
789 
790  CRL_EXCEPTION("no free RX buffers (%d in use by consumers)\n", bP->size());
791 }
792 
793 //
794 // Unwrap a 16-bit wire sequence ID into a unique 64-bit local ID
795 
796 const int64_t& impl::unwrapSequenceId(uint16_t wireId)
797 {
798  //
799  // Look for a sequence change
800 
801  if (wireId != m_lastRxSeqId) {
802 
803  CRL_CONSTEXPR uint16_t ID_MAX = std::numeric_limits<uint16_t>::max();
804  CRL_CONSTEXPR uint16_t ID_MASK = 0xF000;
805  CRL_CONSTEXPR uint16_t ID_HIGH = 0xF000;
806  CRL_CONSTEXPR uint16_t ID_LOW = 0x0000;
807 
808  //
809  // Seed
810 
811  if (-1 == m_lastRxSeqId)
813 
814  //
815  // Detect forward 16-bit wrap
816 
817  else if (((wireId & ID_MASK) == ID_LOW) &&
818  ((m_lastRxSeqId & ID_MASK) == ID_HIGH)) {
819 
820  m_unWrappedRxSeqId += 1 + (static_cast<int64_t>(ID_MAX) - m_lastRxSeqId) + wireId;
821 
822  //
823  // Normal case
824 
825  } else
826  m_unWrappedRxSeqId += static_cast<int64_t>(wireId) - m_lastRxSeqId;
827 
828  //
829  // Remember change
830 
831  m_lastRxSeqId = wireId;
832  }
833 
834  return m_unWrappedRxSeqId;
835 }
836 
837 //
838 // Handles any incoming packets
839 
841 {
843 
844  for(;;) {
845 
846  //
847  // Receive the packet
848 
849 // disable MSVC warning for narrowing conversion.
850 #if defined(WIN32) && !defined(__MINGW64__)
851 #pragma warning (push)
852 #pragma warning (disable : 4267)
853 #endif
854  const int bytesRead = recvfrom(m_serverSocket,
855  (char*)m_incomingBuffer.data(),
856  m_incomingBuffer.size(),
857  0, NULL, NULL);
858 #if defined(WIN32) && !defined(__MINGW64__)
859 #pragma warning (pop)
860 #endif
861 
862  //
863  // Nothing left to read
864 
865  if (bytesRead < 0)
866  break;
867 
868  //
869  // Check for undersized packets
870 
871  else if (bytesRead < (int)sizeof(wire::Header))
872  CRL_EXCEPTION("undersized packet: %d/%d bytes\n",
873  bytesRead, sizeof(wire::Header));
874 
875  //
876  // For convenience below
877 
878  const uint8_t *inP = reinterpret_cast<const uint8_t*>(m_incomingBuffer.data());
879 
880  //
881  // Validate the header
882 
883  const wire::Header& header = *(reinterpret_cast<const wire::Header*>(inP));
884 
885  if (wire::HEADER_MAGIC != header.magic)
886  CRL_EXCEPTION("bad protocol magic: 0x%x, expecting 0x%x",
887  header.magic, wire::HEADER_MAGIC);
888  else if (wire::HEADER_VERSION != header.version)
889  CRL_EXCEPTION("bad protocol version: 0x%x, expecting 0x%x",
890  header.version, wire::HEADER_VERSION);
891  else if (wire::HEADER_GROUP != header.group)
892  CRL_EXCEPTION("bad protocol group: 0x%x, expecting 0x%x",
893  header.group, wire::HEADER_GROUP);
894 
895  //
896  // Unwrap the sequence identifier
897 
898  const int64_t& sequence = unwrapSequenceId(header.sequenceIdentifier);
899 
900  //
901  // See if we are already tracking this message ID
902 
903  UdpTracker *trP = m_udpTrackerCache.find(sequence);
904  if (NULL == trP) {
905 
906  //
907  // If we drop first packet, we will drop entire message. Currently we
908  // require the first datagram in order to assign an assembler.
909  // TODO: re-think this.
910 
911  if (0 != header.byteOffset) {
912  if (m_lastUnexpectedSequenceId != sequence) {
913 #ifdef UDP_ASSEMBLER_DEBUG
914  CRL_DEBUG("Unexpected packet without header: sequence=%" PRId64 " byteOffset=%u\n", sequence, header.byteOffset);
915 #endif
916  m_lastUnexpectedSequenceId = sequence;
917 
920  }
921  continue;
922  }
923  else {
924 
925  //
926  // Create a new tracker for this sequence id.
927 
928  trP = new UdpTracker(header.messageLength,
929  getUdpAssembler(inP, bytesRead),
930  findFreeBuffer(header.messageLength));
931  }
932  }
933 
934  //
935  // Assemble the datagram into the message stream, returns true if the
936  // assembly is complete.
937 
938  if (true == trP->assemble(bytesRead - sizeof(wire::Header),
939  header.byteOffset,
940  &(inP[sizeof(wire::Header)]))) {
941 
942  //
943  // Dispatch to any listeners
944 
945  dispatch(trP->stream());
946 
947  //
948  // Release the tracker
949 
950  if (1 == trP->packets())
951  delete trP; // has not yet been cached
952  else
953  m_udpTrackerCache.remove(sequence);
954 
955  } else if (1 == trP->packets()) {
956 
957  //
958  // Cache the tracker, as more UDP packets are
959  // forthcoming for this message.
960 
961  const std::pair<bool, int64_t> willBeDropped = m_udpTrackerCache.will_drop();
962  if (willBeDropped.first)
963  {
964 #ifdef UDP_ASSEMBLER_DEBUG
965  CRL_DEBUG("UDP Assembler dropping sequence=%" PRId64 "\n", willBeDropped.second);
966 #endif
969  }
970  m_udpTrackerCache.insert(sequence, trP);
971  }
972  }
973 }
974 
975 //
976 // This thread waits for UDP packets
977 
978 #if WIN32
979 DWORD impl::rxThread(void *userDataP)
980 #else
981 void *impl::rxThread(void *userDataP)
982 #endif
983 {
984  impl *selfP = reinterpret_cast<impl*>(userDataP);
985  const impl::socket_t server = selfP->m_serverSocket;
986  fd_set readSet;
987 
988  //
989  // Loop until shutdown
990 
991  while(selfP->m_threadsRunning) {
992 
993  //
994  // Add the server socket to the read set.
995 
996  FD_ZERO(&readSet);
997  FD_SET(server, &readSet);
998 
999  //
1000  // Wait for a new packet to arrive, timing out every once in awhile
1001 
1002  struct timeval tv = {0, 200000}; // 5Hz
1003 #ifdef WIN32
1004  // Windows is "special" and doesn't have the same call semantics as posix
1005  const int result = select (1, &readSet, NULL, NULL, &tv);
1006 #else
1007  const int result = select (server + 1, &readSet, NULL, NULL, &tv);
1008 #endif
1009  if (result <= 0)
1010  continue;
1011 
1012  //
1013  // Let the comm object handle decoding
1014 
1015  try {
1016 
1017  selfP->handle();
1018 
1019  } catch (const std::exception& e) {
1020 
1021  CRL_DEBUG("exception while decoding packet: %s\n", e.what());
1022 
1023  } catch ( ... ) {
1024 
1025  CRL_DEBUG_RAW("unknown exception while decoding packet\n");
1026  }
1027  }
1028 
1029 #if defined(__MINGW64__)
1030  return 0;
1031 #else
1032  return NULL;
1033 #endif
1034 }
1035 
1036 }}} // namespaces
crl::multisense::details::wire::GroundSurfaceModelHeader::extrinsics
float extrinsics[6]
Definition: GroundSurfaceModel.hh:84
crl::multisense::details::wire::SecondaryAppHeader::sourceExtended
uint32_t sourceExtended
Definition: SecondaryAppDataMessage.hh:66
crl::multisense::details::wire::AuxCamConfig
Definition: AuxCamConfigMessage.hh:51
StatusResponseMessage.hh
crl::multisense::details::impl
Definition: Legacy/include/MultiSense/details/channel.hh:88
crl::multisense::details::wire::ApriltagDetectionsHeader::timestamp
int64_t timestamp
Definition: ApriltagDetections.hh:63
crl::multisense::details::wire::SecondaryAppHeader::source
uint32_t source
Definition: SecondaryAppDataMessage.hh:61
crl::multisense::details::wire::GroundSurfaceModelHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: GroundSurfaceModel.hh:51
crl::multisense::details::wire::SysDeviceModes::ID
static CRL_CONSTEXPR IdType ID
Definition: SysDeviceModesMessage.hh:71
crl::multisense::details::wire::SecondaryAppData::dataP
void * dataP
Definition: SecondaryAppDataMessage.hh:87
crl::multisense::details::wire::SysExternalCalibration::ID
static CRL_CONSTEXPR IdType ID
Definition: SysExternalCalibrationMessage.hh:54
crl::multisense::details::wire::VersionResponse
Definition: VersionResponseMessage.hh:50
crl::multisense::details::wire::JpegImageHeader::length
uint32_t length
Definition: JpegMessage.hh:65
crl::multisense::details::wire::ImageHeader::width
uint16_t width
Definition: ImageMessage.hh:64
SysMtuMessage.hh
crl::multisense::details::impl::handle
void handle()
Definition: dispatch.cc:840
crl::multisense::details::wire::MotorPoll
Definition: PollMotorInfoMessage.hh:51
crl::multisense::details::wire::CompressedImageHeader::frameId
int64_t frameId
Definition: CompressedImageMessage.hh:64
crl::multisense::details::impl::m_compressedImageListeners
std::list< CompressedImageListener * > m_compressedImageListeners
Definition: Legacy/include/MultiSense/details/channel.hh:497
SysCameraCalibrationMessage.hh
crl::multisense::details::wire::ImuData
Definition: ImuDataMessage.hh:81
VersionResponseMessage.hh
crl::multisense::details::wire::Ack::ID
static CRL_CONSTEXPR IdType ID
Definition: AckMessage.hh:49
AuxCamConfigMessage.hh
crl::multisense::details::wire::SysNetwork
Definition: SysNetworkMessage.hh:47
crl::multisense::details::wire::CompressedImage::dataP
void * dataP
Definition: CompressedImageMessage.hh:96
crl::multisense::system::ChannelStatistics::numDispatchedGroundSurfaceSpline
std::size_t numDispatchedGroundSurfaceSpline
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4029
crl::multisense::details::wire::GroundSurfaceModelHeader::controlPointsHeight
uint32_t controlPointsHeight
Definition: GroundSurfaceModel.hh:71
crl::multisense::imu::Sample::z
float z
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2625
crl::multisense::details::wire::SysSensorCalibration::ID
static CRL_CONSTEXPR IdType ID
Definition: SysSensorCalibrationMessage.hh:51
SecondaryAppRegisteredAppsMessage.hh
crl::multisense::system::ChannelStatistics::numDispatchedSecondary
std::size_t numDispatchedSecondary
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4037
crl::multisense::details::wire::ImageMetaHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: ImageMetaMessage.hh:52
crl::multisense::details::wire::SysCameraCalibration::ID
static CRL_CONSTEXPR IdType ID
Definition: SysCameraCalibrationMessage.hh:72
crl::multisense::details::impl::m_serverSocket
socket_t m_serverSocket
Definition: Legacy/include/MultiSense/details/channel.hh:404
crl::multisense::details::wire::GroundSurfaceModelHeader::xzCellSize
float xzCellSize[2]
Definition: GroundSurfaceModel.hh:77
crl::multisense::details::wire::SysPacketDelay::ID
static CRL_CONSTEXPR IdType ID
Definition: SysPacketDelayMessage.hh:51
crl::multisense::details::wire::ImuSample::type
uint16_t type
Definition: ImuDataMessage.hh:56
SecondaryAppGetRegisteredAppsMessage.hh
crl::multisense::details::wire::ApriltagDetectionsHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: ApriltagDetections.hh:51
crl::multisense::details::wire::CamConfig
Definition: CamConfigMessage.hh:54
crl::multisense::details::wire::ApriltagDetections::detections
std::vector< ApriltagDetection > detections
Definition: ApriltagDetections.hh:151
crl::multisense::details::wire::Image::dataP
void * dataP
Definition: ImageMessage.hh:92
CRL_DEBUG
#define CRL_DEBUG(fmt,...)
Definition: Exception.hh:71
crl::multisense::details::impl::m_ppsListeners
std::list< PpsListener * > m_ppsListeners
Definition: Legacy/include/MultiSense/details/channel.hh:495
crl::multisense::details::wire::SysTestMtuResponse::ID
static CRL_CONSTEXPR IdType ID
Definition: SysTestMtuResponseMessage.hh:51
crl::multisense::details::impl::m_networkTimeSyncEnabled
bool m_networkTimeSyncEnabled
Definition: Legacy/include/MultiSense/details/channel.hh:523
crl::multisense::details::impl::m_lastRxSeqId
int32_t m_lastRxSeqId
Definition: Legacy/include/MultiSense/details/channel.hh:426
crl::multisense::details::wire::Disparity
Definition: DisparityMessage.hh:84
SysNetworkMessage.hh
crl::multisense::details::wire::JpegImageHeader::source
uint32_t source
Definition: JpegMessage.hh:61
crl::multisense::details::wire::LidarDataHeader::timeEndSeconds
uint32_t timeEndSeconds
Definition: LidarDataMessage.hh:67
crl::multisense::imu::Sample::timeSeconds
uint32_t timeSeconds
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2599
crl::multisense::details::wire::SecondaryAppHeader::length
uint32_t length
Definition: SecondaryAppDataMessage.hh:62
SysTransmitDelayMessage.hh
crl::multisense::details::wire::HEADER_MAGIC
static CRL_CONSTEXPR uint16_t HEADER_MAGIC
Definition: Protocol.hh:76
crl::multisense::details::wire::SysFlashResponse
Definition: SysFlashResponseMessage.hh:50
crl::multisense::details::wire::CompressedImageHeader::codec
uint32_t codec
Definition: CompressedImageMessage.hh:63
crl::multisense::details::wire::JpegImageHeader::width
uint16_t width
Definition: JpegMessage.hh:63
crl::multisense::details::wire::DisparityHeader::API_BITS_PER_PIXEL
static CRL_CONSTEXPR uint8_t API_BITS_PER_PIXEL
Definition: DisparityMessage.hh:59
crl::multisense::details::wire::LidarDataHeader::timeEndMicroSeconds
uint32_t timeEndMicroSeconds
Definition: LidarDataMessage.hh:68
crl::multisense::system::ChannelStatistics::numDispatchedImu
std::size_t numDispatchedImu
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4021
crl::multisense::details::impl::UdpTracker::packets
uint32_t packets()
Definition: Legacy/include/MultiSense/details/channel.hh:371
crl::multisense::details::wire::LedStatus::ID
static CRL_CONSTEXPR IdType ID
Definition: LedStatusMessage.hh:52
ImuConfigMessage.hh
crl::multisense::details::wire::SysSensorCalibration
Definition: SysSensorCalibrationMessage.hh:49
crl::multisense::details::wire::AuxCamConfig::ID
static CRL_CONSTEXPR IdType ID
Definition: AuxCamConfigMessage.hh:53
crl::multisense::imu::Sample::timeMicroSeconds
uint32_t timeMicroSeconds
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2601
crl::multisense::imu::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2647
LidarDataMessage.hh
crl::multisense::details::wire::GroundSurfaceModel::controlPointsDataP
void * controlPointsDataP
Definition: GroundSurfaceModel.hh:112
SecondaryAppConfigMessage.hh
JpegMessage.hh
crl::multisense::details::wire::LidarDataHeader::intensityP
uint32_t * intensityP
Definition: LidarDataMessage.hh:77
crl::multisense::details::wire::ImuSample::TYPE_GYRO
static CRL_CONSTEXPR uint16_t TYPE_GYRO
Definition: ImuDataMessage.hh:53
crl::multisense::details::wire::SysLidarCalibration::ID
static CRL_CONSTEXPR IdType ID
Definition: SysLidarCalibrationMessage.hh:51
LedSensorStatusMessage.hh
crl::multisense::details::wire::ImageMetaHeader::framesPerSecond
float framesPerSecond
Definition: ImageMetaMessage.hh:66
crl::multisense::details::wire::SysCameraCalibration
Definition: SysCameraCalibrationMessage.hh:70
crl::multisense::details::wire::GroundSurfaceModelHeader::xzCellOrigin
float xzCellOrigin[2]
Definition: GroundSurfaceModel.hh:76
ImageMetaMessage.hh
SysSensorCalibrationMessage.hh
SysFlashResponseMessage.hh
crl::multisense::details::impl::dispatchPps
void dispatchPps(pps::Header &header)
Definition: dispatch.cc:159
crl::multisense::Source_Disparity
static CRL_CONSTEXPR DataSource Source_Disparity
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:128
crl::multisense::details::impl::m_channelStatistics
system::ChannelStatistics m_channelStatistics
Definition: Legacy/include/MultiSense/details/channel.hh:552
crl::multisense::details::wire::ImuConfig::ID
static CRL_CONSTEXPR IdType ID
Definition: ImuConfigMessage.hh:78
CamHistoryMessage.hh
DisparityMessage.hh
crl::multisense::details::wire::PtpStatusResponse
Definition: PtpStatusResponseMessage.hh:51
crl::multisense::details::wire::GroundSurfaceModel
Definition: GroundSurfaceModel.hh:109
ImageMessage.hh
LedStatusMessage.hh
crl::multisense::details::wire::HEADER_VERSION
static CRL_CONSTEXPR uint16_t HEADER_VERSION
Definition: Protocol.hh:77
crl::multisense::details::wire::CompressedImageHeader::source
uint32_t source
Definition: CompressedImageMessage.hh:61
crl::multisense::details::wire::LidarDataHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: LidarDataMessage.hh:55
crl::multisense::details::wire::CompressedImageHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: CompressedImageMessage.hh:53
crl::multisense::details::wire::GroundSurfaceModelHeader::minMaxAzimuthAngle
float minMaxAzimuthAngle[2]
Definition: GroundSurfaceModel.hh:79
CRL_CONSTEXPR
#define CRL_CONSTEXPR
Definition: Legacy/include/MultiSense/details/utility/Portability.hh:49
crl::multisense::details::impl::m_udpTrackerCache
DepthCache< int64_t, UdpTracker > m_udpTrackerCache
Definition: Legacy/include/MultiSense/details/channel.hh:437
crl::multisense::details::wire::ImageHeader::gain
float gain
Definition: ImageMessage.hh:67
crl::multisense::details::wire::ImageMeta
Definition: ImageMetaMessage.hh:92
crl::multisense::details::impl::dispatchCompressedImage
void dispatchCompressedImage(utility::BufferStream &buffer, compressed_image::Header &header)
Definition: dispatch.cc:195
crl::multisense::details::wire::ImuSample::ptpNanoSeconds
uint64_t ptpNanoSeconds
Definition: ImuDataMessage.hh:59
CamConfigMessage.hh
crl::multisense::details::wire::MotorPoll::ID
static CRL_CONSTEXPR IdType ID
Definition: PollMotorInfoMessage.hh:54
crl::multisense::details::wire::ApriltagDetections
Definition: ApriltagDetections.hh:145
crl::multisense::details::impl::m_unWrappedRxSeqId
int64_t m_unWrappedRxSeqId
Definition: Legacy/include/MultiSense/details/channel.hh:427
crl::multisense::details::impl::m_dispatchLock
utility::Mutex m_dispatchLock
Definition: Legacy/include/MultiSense/details/channel.hh:467
crl::multisense::details::wire::DisparityHeader::height
uint16_t height
Definition: DisparityMessage.hh:69
crl::multisense::details::wire::LedSensorStatus
Definition: LedSensorStatusMessage.hh:49
crl::multisense::details::wire::LedStatus
Definition: LedStatusMessage.hh:50
crl::multisense::details::wire::ImageHeader::height
uint16_t height
Definition: ImageMessage.hh:65
crl::multisense::details::impl::m_messages
MessageMap m_messages
Definition: Legacy/include/MultiSense/details/channel.hh:510
crl::multisense::details::wire::SysTransmitDelay::ID
static CRL_CONSTEXPR IdType ID
Definition: SysTransmitDelayMessage.hh:50
crl::multisense::details::wire::SecondaryAppHeader::timeSeconds
uint32_t timeSeconds
Definition: SecondaryAppDataMessage.hh:64
CRL_DEBUG_RAW
#define CRL_DEBUG_RAW(fmt)
Definition: Exception.hh:78
crl::multisense::details::wire::SecondaryAppData
Definition: SecondaryAppDataMessage.hh:84
crl::multisense::details::wire::CompressedImage
Definition: CompressedImageMessage.hh:93
crl::multisense::details::wire::LidarDataHeader::angleEnd
int32_t angleEnd
Definition: LidarDataMessage.hh:70
crl::multisense::details::impl::m_secondaryAppListeners
std::list< SecondaryAppListener * > m_secondaryAppListeners
Definition: Legacy/include/MultiSense/details/channel.hh:500
AckMessage.hh
crl::multisense::details::impl::m_rxLargeBufferPool
BufferPool m_rxLargeBufferPool
Definition: Legacy/include/MultiSense/details/channel.hh:444
crl::multisense::details::wire::PtpStatusResponse::ID
static CRL_CONSTEXPR IdType ID
Definition: PtpStatusResponseMessage.hh:53
crl::multisense::details::wire::ApriltagDetectionsHeader::success
uint8_t success
Definition: ApriltagDetections.hh:69
crl::multisense::details::wire::LidarData
Definition: LidarDataMessage.hh:91
crl::multisense::details::wire::LidarDataHeader::points
uint32_t points
Definition: LidarDataMessage.hh:71
crl::multisense::details::wire::GroundSurfaceModelHeader::controlPointsWidth
uint32_t controlPointsWidth
Definition: GroundSurfaceModel.hh:70
crl::multisense::details::wire::CompressedImageHeader::height
uint16_t height
Definition: CompressedImageMessage.hh:66
crl::multisense::details::impl::m_incomingBuffer
std::vector< uint8_t > m_incomingBuffer
Definition: Legacy/include/MultiSense/details/channel.hh:420
crl::multisense::details::impl::m_watch
MessageWatch m_watch
Definition: Legacy/include/MultiSense/details/channel.hh:505
crl::multisense::details::MessageWatch::signal
void signal(wire::IdType id, Status status=Status_Ok)
Definition: signal.hh:57
ApriltagDetections.hh
crl::multisense::details::wire::SecondaryAppRegisteredApps::ID
static CRL_CONSTEXPR IdType ID
Definition: SecondaryAppRegisteredAppsMessage.hh:69
crl::multisense::details::wire::ImuSample::timeNanoSeconds
int64_t timeNanoSeconds
Definition: ImuDataMessage.hh:57
crl::multisense::details::wire::DisparityHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: DisparityMessage.hh:54
CRL_EXCEPTION
#define CRL_EXCEPTION(fmt,...)
Definition: Exception.hh:85
crl::multisense::details::wire::ImageMetaHeader::frameId
int64_t frameId
Definition: ImageMetaMessage.hh:65
crl::multisense::details::wire::StatusResponse
Definition: StatusResponseMessage.hh:50
crl::multisense::details::wire::CompressedImageHeader::exposure
uint32_t exposure
Definition: CompressedImageMessage.hh:67
crl::multisense::system::ChannelStatistics::numDispatchedPps
std::size_t numDispatchedPps
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4017
crl::multisense::details::wire::ImuData::ID
static CRL_CONSTEXPR IdType ID
Definition: ImuDataMessage.hh:83
crl::multisense::system::ChannelStatistics::numDispatchedCompressedImage
std::size_t numDispatchedCompressedImage
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4025
crl::multisense::details::wire::SysPps::ppsNanoSeconds
int64_t ppsNanoSeconds
Definition: SysPpsMessage.hh:55
crl
Definition: Legacy/details/channel.cc:61
crl::multisense::details::wire::SysTransmitDelay
Definition: SysTransmitDelayMessage.hh:48
crl::multisense::details::impl::dispatchGroundSurfaceSpline
void dispatchGroundSurfaceSpline(ground_surface::Header &header)
Definition: dispatch.cc:214
crl::multisense::details::impl::m_secondaryAppMetaCache
DepthCache< int64_t, wire::SecondaryAppMetadata > m_secondaryAppMetaCache
Definition: Legacy/include/MultiSense/details/channel.hh:455
crl::multisense::details::utility::BufferStream::seek
void seek(std::size_t idx)
Definition: BufferStream.hh:93
crl::multisense::apriltag::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2972
crl::multisense::details::wire::VersionResponse::ID
static CRL_CONSTEXPR IdType ID
Definition: VersionResponseMessage.hh:52
PollMotorInfoMessage.hh
crl::multisense::compressed_image::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2862
crl::multisense::details::wire::SecondaryAppConfig::ID
static CRL_CONSTEXPR IdType ID
Definition: SecondaryAppConfigMessage.hh:52
crl::multisense::imu::Sample::x
float x
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2609
crl::multisense::details::wire::LedSensorStatus::ID
static CRL_CONSTEXPR IdType ID
Definition: LedSensorStatusMessage.hh:51
crl::multisense::details::wire::ImageHeader::bitsPerPixel
uint32_t bitsPerPixel
Definition: ImageMessage.hh:62
crl::multisense::details::wire::SysDeviceInfo
Definition: SysDeviceInfoMessage.hh:69
crl::multisense::details::utility::BufferStreamWriter
Definition: BufferStream.hh:259
SecondaryAppControlMessage.hh
crl::multisense::details::wire::ImuInfo::ID
static CRL_CONSTEXPR IdType ID
Definition: ImuInfoMessage.hh:111
crl::multisense::details::wire::DisparityHeader::width
uint16_t width
Definition: DisparityMessage.hh:68
crl::multisense::details::wire::ImuData::sequence
uint32_t sequence
Definition: ImuDataMessage.hh:86
crl::multisense::details::wire::SysPacketDelay
Definition: SysPacketDelayMessage.hh:49
crl::multisense::details::wire::SysMtu
Definition: SysMtuMessage.hh:48
crl::multisense::lidar::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2065
crl::multisense::imu::Sample
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2586
crl::multisense::details::wire::ImuSample::x
float x
Definition: ImuDataMessage.hh:58
crl::multisense::details::wire::LidarDataHeader::angleStart
int32_t angleStart
Definition: LidarDataMessage.hh:69
crl::multisense::details::wire::JpegImage
Definition: JpegMessage.hh:86
crl::multisense::details::impl::unwrapSequenceId
const int64_t & unwrapSequenceId(uint16_t id)
Definition: dispatch.cc:796
crl::multisense::details::wire::SysPps::ID
static CRL_CONSTEXPR IdType ID
Definition: SysPpsMessage.hh:49
crl::multisense::details::wire::CompressedImageHeader::bitsPerPixel
uint32_t bitsPerPixel
Definition: CompressedImageMessage.hh:62
crl::multisense::details::utility::TimeStamp
Definition: TimeStamp.hh:69
crl::multisense::imu::Sample::Type_Gyroscope
static CRL_CONSTEXPR Type Type_Gyroscope
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2593
crl::multisense::details::impl::dispatchAprilTagDetections
void dispatchAprilTagDetections(apriltag::Header &header)
Definition: dispatch.cc:232
crl::multisense::details::wire::JpegImage::dataP
void * dataP
Definition: JpegMessage.hh:89
crl::multisense::details::wire::LidarDataHeader::distanceP
uint32_t * distanceP
Definition: LidarDataMessage.hh:76
crl::multisense::details::wire::VersionType
uint16_t VersionType
Definition: Protocol.hh:137
crl::multisense::details::wire::ApriltagDetection::decisionMargin
float decisionMargin
Definition: ApriltagDetections.hh:107
crl::multisense::details::wire::SecondaryAppHeader::frameId
int64_t frameId
Definition: SecondaryAppDataMessage.hh:63
crl::multisense::details::wire::LidarDataHeader::scanCount
uint32_t scanCount
Definition: LidarDataMessage.hh:64
crl::multisense::details::wire::JpegImageHeader::frameId
int64_t frameId
Definition: JpegMessage.hh:62
crl::multisense::details::wire::Ack
Definition: AckMessage.hh:47
crl::multisense::details::impl::m_imageMetaCache
DepthCache< int64_t, wire::ImageMeta > m_imageMetaCache
Definition: Legacy/include/MultiSense/details/channel.hh:450
MSG_ID
#define MSG_ID(x)
Definition: Protocol.hh:344
crl::multisense::details::impl::dispatchSecondaryApplication
void dispatchSecondaryApplication(utility::BufferStream &buffer, secondary_app::Header &header)
Definition: dispatch.cc:250
crl::multisense::details::impl::RX_POOL_SMALL_BUFFER_SIZE
static CRL_CONSTEXPR uint32_t RX_POOL_SMALL_BUFFER_SIZE
Definition: Legacy/include/MultiSense/details/channel.hh:300
crl::multisense::details::wire::RemoteHeadConfig
Definition: RemoteHeadConfigMessage.hh:89
crl::multisense::details::wire::ImageHeader::source
uint32_t source
Definition: ImageMessage.hh:61
crl::multisense::details::impl::dispatchImage
void dispatchImage(utility::BufferStream &buffer, image::Header &header)
Definition: dispatch.cc:122
crl::multisense::details::wire::Image
Definition: ImageMessage.hh:89
RemoteHeadConfigMessage.hh
crl::multisense::details::wire::ImageHeader::sourceExtended
uint32_t sourceExtended
Definition: ImageMessage.hh:68
crl::multisense::details::impl::socket_t
int32_t socket_t
Definition: Legacy/include/MultiSense/details/channel.hh:94
crl::multisense::details::wire::SysExternalCalibration
Definition: SysExternalCalibrationMessage.hh:52
crl::multisense::imu::Sample::Type_Accelerometer
static CRL_CONSTEXPR Type Type_Accelerometer
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2592
SysPacketDelayMessage.hh
crl::multisense::details::wire::LidarDataHeader::timeStartMicroSeconds
uint32_t timeStartMicroSeconds
Definition: LidarDataMessage.hh:66
crl::multisense::details::wire::HEADER_GROUP
static CRL_CONSTEXPR uint16_t HEADER_GROUP
Definition: Protocol.hh:82
crl::multisense::details::wire::GroundSurfaceModelHeader::controlPointsBitsPerPixel
uint32_t controlPointsBitsPerPixel
Definition: GroundSurfaceModel.hh:69
crl::multisense::details::impl::dispatchImu
void dispatchImu(imu::Header &header)
Definition: dispatch.cc:177
crl::multisense::details::wire::SysFlashResponse::ID
static CRL_CONSTEXPR IdType ID
Definition: SysFlashResponseMessage.hh:52
SysExternalCalibrationMessage.hh
crl::multisense::details::wire::GroundSurfaceModelHeader::quadraticParams
float quadraticParams[6]
Definition: GroundSurfaceModel.hh:89
crl::multisense::details::impl::dispatch
void dispatch(utility::BufferStreamWriter &buffer)
Definition: dispatch.cc:270
crl::multisense::details::impl::m_ptpTimeSyncEnabled
bool m_ptpTimeSyncEnabled
Definition: Legacy/include/MultiSense/details/channel.hh:524
crl::multisense::details::wire::GroundSurfaceModelHeader::success
uint8_t success
Definition: GroundSurfaceModel.hh:64
crl::multisense::details::wire::ApriltagDetection
Definition: ApriltagDetections.hh:91
crl::multisense::details::impl::m_lidarListeners
std::list< LidarListener * > m_lidarListeners
Definition: Legacy/include/MultiSense/details/channel.hh:494
crl::multisense::details::impl::m_rxLock
utility::Mutex m_rxLock
Definition: Legacy/include/MultiSense/details/channel.hh:483
crl::multisense::details::wire::ImageHeader::frameId
int64_t frameId
Definition: ImageMessage.hh:63
crl::multisense::secondary_app::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:3028
crl::multisense::details::wire::ImageHeader::exposure
uint32_t exposure
Definition: ImageMessage.hh:66
crl::multisense::details::wire::ImageMetaHeader::exposureTime
uint32_t exposureTime
Definition: ImageMetaMessage.hh:68
crl::multisense::details::wire::ImageMetaHeader::gain
float gain
Definition: ImageMetaMessage.hh:67
crl::multisense::details::impl::RX_POOL_LARGE_BUFFER_SIZE
static CRL_CONSTEXPR uint32_t RX_POOL_LARGE_BUFFER_SIZE
Definition: Legacy/include/MultiSense/details/channel.hh:298
crl::multisense::details::wire::ImageHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: ImageMessage.hh:53
crl::multisense::details::wire::ApriltagDetection::tagToImageHomography
double tagToImageHomography[3][3]
Definition: ApriltagDetections.hh:112
channel.hh
crl::multisense::details::impl::rxThread
static void * rxThread(void *userDataP)
Definition: dispatch.cc:981
crl::multisense::details::impl::m_imuListeners
std::list< ImuListener * > m_imuListeners
Definition: Legacy/include/MultiSense/details/channel.hh:496
crl::multisense::details::impl::UdpTracker
Definition: Legacy/include/MultiSense/details/channel.hh:357
header
std_msgs::Header const * header(const M &m)
crl::multisense::details::impl::getImageTime
void getImageTime(const WireT *wire, uint32_t &seconds, uint32_t &microSeconds)
Definition: Legacy/include/MultiSense/details/channel.hh:254
crl::multisense::details::wire::CamConfig::ID
static CRL_CONSTEXPR IdType ID
Definition: CamConfigMessage.hh:56
crl::multisense::details::wire::JpegImageHeader::sourceExtended
uint32_t sourceExtended
Definition: JpegMessage.hh:67
crl::multisense::details::wire::SysMtu::ID
static CRL_CONSTEXPR IdType ID
Definition: SysMtuMessage.hh:50
crl::multisense::details::wire::ApriltagDetection::family
char family[32]
Definition: ApriltagDetections.hh:96
crl::multisense::details::wire::ApriltagDetection::id
uint32_t id
Definition: ApriltagDetections.hh:99
CRL_EXCEPTION_RAW
#define CRL_EXCEPTION_RAW(fmt)
Definition: Exception.hh:91
ImuInfoMessage.hh
SysDeviceModesMessage.hh
crl::multisense::details::wire::LidarDataHeader::timeStartSeconds
uint32_t timeStartSeconds
Definition: LidarDataMessage.hh:65
crl::multisense::details::wire::ApriltagDetectionsHeader::numDetections
uint32_t numDetections
Definition: ApriltagDetections.hh:72
crl::multisense::details::wire::RemoteHeadConfig::ID
static CRL_CONSTEXPR IdType ID
Definition: RemoteHeadConfigMessage.hh:91
PtpStatusResponseMessage.hh
crl::multisense::details::impl::m_aprilTagDetectionListeners
std::list< AprilTagDetectionListener * > m_aprilTagDetectionListeners
Definition: Legacy/include/MultiSense/details/channel.hh:499
crl::multisense::details::utility::degreesToRadians
Type degreesToRadians(Type const &value)
Definition: Units.hh:55
crl::multisense::details::wire::SecondaryAppHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: SecondaryAppDataMessage.hh:53
multisense
Definition: factory.cc:39
crl::multisense::details::impl::m_groundSurfaceSplineListeners
std::list< GroundSurfaceSplineListener * > m_groundSurfaceSplineListeners
Definition: Legacy/include/MultiSense/details/channel.hh:498
crl::multisense::details::impl::BufferPool
std::vector< utility::BufferStreamWriter * > BufferPool
Definition: Legacy/include/MultiSense/details/channel.hh:442
crl::multisense::details::wire::SysLidarCalibration
Definition: SysLidarCalibrationMessage.hh:49
crl::multisense::details::wire::ApriltagDetection::center
double center[2]
Definition: ApriltagDetections.hh:115
crl::multisense::details::wire::ImuConfig
Definition: ImuConfigMessage.hh:76
crl::multisense::details::wire::Disparity::dataP
void * dataP
Definition: DisparityMessage.hh:87
crl::multisense::details::wire::ImuSample::z
float z
Definition: ImuDataMessage.hh:58
crl::multisense::details::wire::CompressedImageHeader::sourceExtended
uint32_t sourceExtended
Definition: CompressedImageMessage.hh:70
crl::multisense::imu::Sample::Type_Magnetometer
static CRL_CONSTEXPR Type Type_Magnetometer
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2594
crl::multisense::details::wire::SecondaryAppMetaHeader::dataLength
uint32_t dataLength
Definition: SecondaryAppMetaMessage.hh:62
crl::multisense::details::impl::findFreeBuffer
utility::BufferStreamWriter & findFreeBuffer(uint32_t messageLength)
Definition: dispatch.cc:770
crl::multisense::details::wire::ApriltagDetectionsHeader::frameId
int64_t frameId
Definition: ApriltagDetections.hh:60
SecondaryAppDataMessage.hh
crl::multisense::details::wire::SecondaryAppHeader::timeMicroSeconds
uint32_t timeMicroSeconds
Definition: SecondaryAppDataMessage.hh:65
CompressedImageMessage.hh
crl::multisense::details::wire::CamHistory::ID
static CRL_CONSTEXPR IdType ID
Definition: CamHistoryMessage.hh:53
crl::multisense::details::impl::m_imageListeners
std::list< ImageListener * > m_imageListeners
Definition: Legacy/include/MultiSense/details/channel.hh:493
crl::multisense::details::wire::ImuSample::TYPE_ACCEL
static CRL_CONSTEXPR uint16_t TYPE_ACCEL
Definition: ImuDataMessage.hh:52
crl::multisense::pps::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2560
crl::multisense::details::wire::Header
Header
Definition: Protocol.hh:128
GroundSurfaceModel.hh
crl::multisense::details::wire::ImuSample::TYPE_MAG
static CRL_CONSTEXPR uint16_t TYPE_MAG
Definition: ImuDataMessage.hh:54
crl::multisense::details::wire::SecondaryAppMetaHeader::frameId
int64_t frameId
Definition: SecondaryAppMetaMessage.hh:61
crl::multisense::details::impl::UdpTracker::assemble
bool assemble(uint32_t bytes, uint32_t offset, const uint8_t *dataP)
Definition: Legacy/include/MultiSense/details/channel.hh:373
crl::multisense::details::wire::GroundSurfaceModelHeader::xzLimit
float xzLimit[2]
Definition: GroundSurfaceModel.hh:78
crl::multisense::details::wire::ImuData::samples
std::vector< ImuSample > samples
Definition: ImuDataMessage.hh:87
crl::multisense::details::impl::m_lastUnexpectedSequenceId
int64_t m_lastUnexpectedSequenceId
Definition: Legacy/include/MultiSense/details/channel.hh:432
crl::multisense::details::impl::m_statisticsLock
utility::Mutex m_statisticsLock
Definition: Legacy/include/MultiSense/details/channel.hh:551
crl::multisense::details::wire::SecondaryAppMetaHeader::dataP
void * dataP
Definition: SecondaryAppMetaMessage.hh:63
crl::multisense::details::wire::SecondaryAppConfig
Definition: SecondaryAppConfigMessage.hh:50
crl::multisense::details::utility::ScopedLock
Definition: linux/Thread.hh:165
SysTestMtuResponseMessage.hh
crl::multisense::details::wire::SecondaryAppMetadata
Definition: SecondaryAppMetaMessage.hh:78
crl::multisense::details::wire::SecondaryAppRegisteredApps
Definition: SecondaryAppRegisteredAppsMessage.hh:66
crl::multisense::details::wire::SysTestMtuResponse
Definition: SysTestMtuResponseMessage.hh:49
crl::multisense::details::wire::SysNetwork::ID
static CRL_CONSTEXPR IdType ID
Definition: SysNetworkMessage.hh:49
crl::multisense::details::utility::BufferStreamReader
Definition: BufferStream.hh:192
crl::multisense::imu::Sample::type
Type type
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2597
crl::multisense::details::impl::getUdpAssembler
UdpAssembler getUdpAssembler(const uint8_t *udpDatagramP, uint32_t length)
Definition: dispatch.cc:744
crl::multisense::details::wire::ApriltagDetectionsHeader::imageSource
char imageSource[32]
Definition: ApriltagDetections.hh:66
crl::multisense::details::impl::toHeaderTime
void toHeaderTime(T nanoSeconds, uint32_t &seconds, uint32_t &microSeconds) const
Definition: Legacy/include/MultiSense/details/channel.hh:242
SysLidarCalibrationMessage.hh
crl::multisense::system::ChannelStatistics::numImageMetaData
std::size_t numImageMetaData
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4005
crl::multisense::system::ChannelStatistics::numDispatchedLidar
std::size_t numDispatchedLidar
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4013
crl::multisense::details::wire::CompressedImageHeader::compressedDataBufferSize
uint32_t compressedDataBufferSize
Definition: CompressedImageMessage.hh:69
crl::multisense::details::wire::GroundSurfaceModelHeader::frameId
int64_t frameId
Definition: GroundSurfaceModel.hh:62
crl::multisense::details::wire::IdType
uint16_t IdType
Definition: Protocol.hh:136
crl::multisense::details::impl::UdpAssembler
void(* UdpAssembler)(utility::BufferStreamWriter &stream, const uint8_t *dataP, uint32_t offset, uint32_t length)
Definition: Legacy/include/MultiSense/details/channel.hh:236
crl::multisense::details::impl::m_threadsRunning
bool m_threadsRunning
Definition: Legacy/include/MultiSense/details/channel.hh:477
ImuDataMessage.hh
crl::multisense::ground_surface::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2921
crl::multisense::details::utility::BufferStream
Definition: BufferStream.hh:66
crl::multisense::details::impl::sensorToLocalTime
utility::TimeStamp sensorToLocalTime(const utility::TimeStamp &sensorTime)
Definition: Legacy/details/channel.cc:667
crl::multisense::details::wire::CompressedImageHeader::gain
float gain
Definition: CompressedImageMessage.hh:68
crl::multisense::details::wire::StatusResponse::ID
static CRL_CONSTEXPR IdType ID
Definition: StatusResponseMessage.hh:52
crl::multisense::details::impl::UdpTracker::stream
utility::BufferStreamWriter & stream()
Definition: Legacy/include/MultiSense/details/channel.hh:370
crl::multisense::details::wire::SysPps
Definition: SysPpsMessage.hh:47
crl::multisense::details::wire::SecondaryAppMetaHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: SecondaryAppMetaMessage.hh:53
crl::multisense::details::wire::ApriltagDetection::corners
double corners[4][2]
Definition: ApriltagDetections.hh:122
SysDeviceInfoMessage.hh
crl::multisense::details::wire::CamHistory
Definition: CamHistoryMessage.hh:51
crl::multisense::details::impl::m_rxSmallBufferPool
BufferPool m_rxSmallBufferPool
Definition: Legacy/include/MultiSense/details/channel.hh:445
crl::multisense::details::wire::ImuSample
Definition: ImuDataMessage.hh:49
crl::multisense::details::wire::ImuSample::y
float y
Definition: ImuDataMessage.hh:58
crl::multisense::details::wire::SysDeviceInfo::ID
static CRL_CONSTEXPR IdType ID
Definition: SysDeviceInfoMessage.hh:71
crl::multisense::system::ChannelStatistics::numDispatchedImage
std::size_t numDispatchedImage
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4009
crl::multisense::details::MessageMap::store
void store(const T &msg)
Definition: Legacy/include/MultiSense/details/storage.hh:57
crl::multisense::system::ChannelStatistics::numDroppedAssemblers
std::size_t numDroppedAssemblers
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:4001
crl::multisense::details::wire::JpegImageHeader::ID
static CRL_CONSTEXPR IdType ID
Definition: JpegMessage.hh:53
crl::multisense::details::wire::JpegImageHeader::height
uint16_t height
Definition: JpegMessage.hh:64
crl::multisense::details::wire::SysDeviceModes
Definition: SysDeviceModesMessage.hh:69
crl::multisense::details::wire::CompressedImageHeader::width
uint16_t width
Definition: CompressedImageMessage.hh:65
crl::multisense::details::wire::GroundSurfaceModelHeader::timestamp
int64_t timestamp
Definition: GroundSurfaceModel.hh:63
crl::multisense::imu::Sample::y
float y
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:2617
crl::multisense::details::wire::ImuInfo
Definition: ImuInfoMessage.hh:109
SysPpsMessage.hh
crl::multisense::image::Header
Definition: Legacy/include/MultiSense/MultiSenseTypes.hh:460
SecondaryAppActivateMessage.hh
crl::multisense::details::wire::DisparityHeader::frameId
int64_t frameId
Definition: DisparityMessage.hh:67
crl::multisense::details::impl::m_udpAssemblerMap
UdpAssemblerMap m_udpAssemblerMap
Definition: Legacy/include/MultiSense/details/channel.hh:462
crl::multisense::details::wire::ApriltagDetection::hamming
uint8_t hamming
Definition: ApriltagDetections.hh:102
crl::multisense::details::impl::dispatchLidar
void dispatchLidar(utility::BufferStream &buffer, lidar::Header &header)
Definition: dispatch.cc:141


multisense_lib
Author(s):
autogenerated on Thu Apr 17 2025 02:49:08