SickSafetyscannersRos.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 
37 
38 
39 namespace sick {
40 
42  : m_private_nh("~")
43  , m_initialised(false)
44  , m_time_offset(0.0)
45  , m_range_min(0.0)
46  , m_range_max(0.0)
47  , m_angle_offset(-90.0)
48  , m_use_pers_conf(false)
49 {
50  dynamic_reconfigure::Server<
51  sick_safetyscanners::SickSafetyscannersConfigurationConfig>::CallbackType reconf_callback =
52  boost::bind(&SickSafetyscannersRos::reconfigureCallback, this, _1, _2);
53  m_dynamic_reconfiguration_server.setCallback(reconf_callback);
54  if (!readParameters())
55  {
56  ROS_ERROR("Could not read parameters.");
58  }
59  // tcp port can not be changed in the sensor configuration, therefore it is hardcoded
61  m_laser_scan_publisher = m_nh.advertise<sensor_msgs::LaserScan>("scan", 100);
63  m_nh.advertise<sick_safetyscanners::ExtendedLaserScanMsg>("extended_laser_scan", 100);
64  m_raw_data_publisher = m_nh.advertise<sick_safetyscanners::RawMicroScanDataMsg>("raw_data", 100);
66  m_nh.advertise<sick_safetyscanners::OutputPathsMsg>("output_paths", 100);
69 
74 
75  // Diagnostics for frequency
77 
83  m_laser_scan_publisher, m_diagnostic_updater, frequency_param, timestamp_param));
85 
86  m_device = std::make_shared<sick::SickSafetyscanners>(
87  boost::bind(&SickSafetyscannersRos::receivedUDPPacket, this, _1),
90  m_device->run();
92 
93  if (m_use_pers_conf)
94  {
96  }
97 
98  m_device->changeSensorSettings(m_communication_settings);
99  m_device->requestConfigMetadata(m_communication_settings, config_meta_data);
100  m_device->requestFirmwareVersion(m_communication_settings, firmware_version);
101 
102  m_initialised = true;
103  ROS_INFO("Successfully launched node.");
104 }
105 
107 {
108  ROS_INFO("Reading Type code settings");
110  m_device->requestTypeCode(m_communication_settings, type_code);
112  m_range_min = 0.1;
113  m_range_max = type_code.getMaxRange();
114 }
115 
117 {
118  ROS_INFO("Reading Persistent Configuration");
120  m_device->requestPersistentConfig(m_communication_settings, config_data);
123 }
124 
126  const sick_safetyscanners::SickSafetyscannersConfigurationConfig& config, const uint32_t& level)
127 {
128  if (isInitialised())
129  {
130  m_communication_settings.setEnabled(config.channel_enabled);
132  if (config.angle_start == config.angle_end)
133  {
136  }
137  else
138  {
141  }
142  m_communication_settings.setFeatures(config.general_system_state,
143  config.derived_settings,
144  config.measurement_data,
145  config.intrusion_data,
146  config.application_io_data);
147  m_device->changeSensorSettings(m_communication_settings);
148 
149  m_frame_id = config.frame_id;
150 
151  m_time_offset = config.time_offset;
152 
153  m_expected_frequency = config.expected_frequency;
154 
155  m_min_intensities = config.min_intensities;
156  }
157 }
158 
160 {
161  return m_initialised;
162 }
163 
164 
166 
168 {
169  std::string sensor_ip_adress = "192.168.1.10";
170  if (!m_private_nh.getParam("sensor_ip", sensor_ip_adress))
171  {
172  // sensor_ip_adress = sick_safetyscanners::SickSafetyscannersConfiguration_sensor_ip;
173  ROS_WARN("Using default sensor IP: %s", sensor_ip_adress.c_str());
174  }
175  m_communication_settings.setSensorIp(sensor_ip_adress);
176 
177 
178  std::string host_ip_adress = "192.168.1.9";
179  if (!m_private_nh.getParam("host_ip", host_ip_adress))
180  {
181  ROS_WARN("Using default host IP: %s", host_ip_adress.c_str());
182  }
183  m_communication_settings.setHostIp(host_ip_adress);
184 
185  std::string interface_ip_adress = "0.0.0.0";
186  if (!m_private_nh.getParam("interface_ip", interface_ip_adress))
187  {
188  ROS_WARN("Using default interface IP: %s", interface_ip_adress.c_str());
189  }
190  m_interface_ip = boost::asio::ip::address_v4::from_string(interface_ip_adress);
191 
192  int host_udp_port = 0;
193  if (!m_private_nh.getParam("host_udp_port", host_udp_port))
194  {
195  ROS_WARN("Using default host UDP Port: %i", host_udp_port);
196  }
198 
199  ROS_WARN("If not further specified the default values for the dynamic reconfigurable parameters "
200  "will be loaded.");
201 
202 
203  int channel = 0;
204  m_private_nh.getParam("channel", channel);
206 
207  bool enabled;
208  m_private_nh.getParam("channel_enabled", enabled);
210 
211  int skip;
212  m_private_nh.getParam("skip", skip);
214 
215  float angle_start;
216  m_private_nh.getParam("angle_start", angle_start);
217 
218  float angle_end;
219  m_private_nh.getParam("angle_end", angle_end);
220 
221  m_private_nh.getParam("frequency_tolerance", m_frequency_tolerance);
222  m_private_nh.getParam("expected_frequency", m_expected_frequency);
223  m_private_nh.getParam("timestamp_min_acceptable", m_timestamp_min_acceptable);
224  m_private_nh.getParam("timestamp_max_acceptable", m_timestamp_max_acceptable);
225 
226  // Included check before calculations to prevent rounding errors while calculating
227  if (angle_start == angle_end)
228  {
231  }
232  else
233  {
236  }
237 
238  m_private_nh.getParam("time_offset", m_time_offset);
239 
240  bool general_system_state;
241  m_private_nh.getParam("general_system_state", general_system_state);
242 
243  bool derived_settings;
244  m_private_nh.getParam("derived_settings", derived_settings);
245 
246  bool measurement_data;
247  m_private_nh.getParam("measurement_data", measurement_data);
248 
249  bool intrusion_data;
250  m_private_nh.getParam("intrusion_data", intrusion_data);
251 
252  bool application_io_data;
253  m_private_nh.getParam("application_io_data", application_io_data);
254 
256  general_system_state, derived_settings, measurement_data, intrusion_data, application_io_data);
257 
258  m_private_nh.getParam("frame_id", m_frame_id);
259 
260  m_private_nh.getParam("use_persistent_config", m_use_pers_conf);
261 
262  m_private_nh.getParam("min_intensities", m_min_intensities);
263 
264  return true;
265 }
266 
268 {
269  if (!data.getMeasurementDataPtr()->isEmpty() && !data.getDerivedValuesPtr()->isEmpty())
270  {
271  sensor_msgs::LaserScan scan = createLaserScanMessage(data);
272 
273  m_diagnosed_laser_scan_publisher->publish(scan);
274  }
275 
276 
277  if (!data.getMeasurementDataPtr()->isEmpty() && !data.getDerivedValuesPtr()->isEmpty())
278  {
279  sick_safetyscanners::ExtendedLaserScanMsg extended_scan = createExtendedLaserScanMessage(data);
280 
282 
283  sick_safetyscanners::OutputPathsMsg output_paths = createOutputPathsMessage(data);
284  m_output_path_publisher.publish(output_paths);
285  }
286 
289 
291 }
292 
293 std::string boolToString(bool b)
294 {
295  return b ? "true" : "false";
296 }
297 
300 {
301  const sick_safetyscanners::DataHeaderMsg& header = m_last_raw_data.header;
302  if (header.timestamp_time == 0 && header.timestamp_date == 0)
303  {
304  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::STALE,
305  "Could not get sensor state");
306  return;
307  }
308 
309  diagnostic_status.addf("Version version", "%c", header.version_version);
310  diagnostic_status.addf("Version major version", "%u", header.version_major_version);
311  diagnostic_status.addf("Version minor version", "%u", header.version_minor_version);
312  diagnostic_status.addf("Version release", "%u", header.version_release);
313  diagnostic_status.addf("Firmware version", "%s", firmware_version.getFirmwareVersion().c_str());
314  diagnostic_status.addf("Serial number of device", "%u", header.serial_number_of_device);
315  diagnostic_status.addf(
316  "Serial number of channel plug", "%u", header.serial_number_of_channel_plug);
317  diagnostic_status.addf("App checksum", "%X", config_meta_data.getAppChecksum());
318  diagnostic_status.addf("Overall checksum", "%X", config_meta_data.getOverallChecksum());
319 
320  diagnostic_status.addf("Channel number", "%u", header.channel_number);
321  diagnostic_status.addf("Sequence number", "%u", header.sequence_number);
322  diagnostic_status.addf("Scan number", "%u", header.scan_number);
323  diagnostic_status.addf("Timestamp date", "%u", header.timestamp_date);
324  diagnostic_status.addf("Timestamp time", "%u", header.timestamp_time);
325 
326  const sick_safetyscanners::GeneralSystemStateMsg& state = m_last_raw_data.general_system_state;
327  diagnostic_status.add("Run mode active", boolToString(state.run_mode_active));
328  diagnostic_status.add("Standby mode active", boolToString(state.standby_mode_active));
329  diagnostic_status.add("Contamination warning", boolToString(state.contamination_warning));
330  diagnostic_status.add("Contamination error", boolToString(state.contamination_error));
331  diagnostic_status.add("Reference contour status", boolToString(state.reference_contour_status));
332  diagnostic_status.add("Manipulation status", boolToString(state.manipulation_status));
333  diagnostic_status.addf(
334  "Current monitoring case no table 1", "%u", state.current_monitoring_case_no_table_1);
335  diagnostic_status.addf(
336  "Current monitoring case no table 2", "%u", state.current_monitoring_case_no_table_2);
337  diagnostic_status.addf(
338  "Current monitoring case no table 3", "%u", state.current_monitoring_case_no_table_3);
339  diagnostic_status.addf(
340  "Current monitoring case no table 4", "%u", state.current_monitoring_case_no_table_4);
341  diagnostic_status.add("Application error", boolToString(state.application_error));
342  diagnostic_status.add("Device error", boolToString(state.device_error));
343 
344  if (state.device_error)
345  {
346  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Device error");
347  }
348  else if (state.application_error)
349  {
350  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Application error");
351  }
352  else if (state.contamination_error)
353  {
354  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::ERROR, "Contamination error");
355  }
356  else if (state.contamination_warning)
357  {
358  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::WARN, "Contamination warning");
359  }
360  else
361  {
362  diagnostic_status.summary(diagnostic_msgs::DiagnosticStatus::OK, "OK");
363  }
364 }
365 
366 sick_safetyscanners::ExtendedLaserScanMsg
368 {
369  sensor_msgs::LaserScan scan = createLaserScanMessage(data);
370  sick_safetyscanners::ExtendedLaserScanMsg msg;
371  msg.laser_scan = scan;
372 
373  std::vector<sick::datastructure::ScanPoint> scan_points =
374  data.getMeasurementDataPtr()->getScanPointsVector();
375  uint32_t num_scan_points = scan_points.size();
376 
377 
378  msg.reflektor_status.resize(num_scan_points);
379  msg.intrusion.resize(num_scan_points);
380  msg.reflektor_median.resize(num_scan_points);
381  std::vector<bool> medians = getMedianReflectors(scan_points);
382  for (uint32_t i = 0; i < num_scan_points; ++i)
383  {
384  const sick::datastructure::ScanPoint scan_point = scan_points.at(i);
385  msg.reflektor_status[i] = scan_point.getReflectorBit();
386  msg.intrusion[i] = scan_point.getContaminationBit();
387  msg.reflektor_median[i] = medians.at(i);
388  }
389  return msg;
390 }
391 
393  const std::vector<sick::datastructure::ScanPoint> scan_points)
394 {
395  std::vector<bool> res;
396  res.resize(scan_points.size());
397  bool last = false;
398  int start = -1;
399  for (size_t i = 0; i < scan_points.size(); i++)
400  {
401  res.at(i) = false;
402  if (!last && scan_points.at(i).getReflectorBit())
403  {
404  last = true;
405  start = i;
406  }
407  else if (last && (!scan_points.at(i).getReflectorBit() || i == scan_points.size() - 1))
408  {
409  last = false;
410  res.at(start + ((i - start) / 2)) = true;
411  }
412  }
413 
414  return res;
415 }
416 
417 sensor_msgs::LaserScan
419 {
420  sensor_msgs::LaserScan scan;
421  scan.header.frame_id = m_frame_id;
422  scan.header.stamp = ros::Time::now();
423  // Add time offset (to account for network latency etc.)
424  scan.header.stamp += ros::Duration().fromSec(m_time_offset);
425  // TODO check why returned number of beams is misaligned to size of vector
426  std::vector<sick::datastructure::ScanPoint> scan_points =
427  data.getMeasurementDataPtr()->getScanPointsVector();
428  uint32_t num_scan_points = scan_points.size();
429 
430  scan.angle_min = sick::degToRad(data.getDerivedValuesPtr()->getStartAngle() + m_angle_offset);
431  double angle_max =
433  ->getScanPointsVector()
434  .at(data.getMeasurementDataPtr()->getScanPointsVector().size() - 1)
435  .getAngle() +
437  scan.angle_max = angle_max;
438  scan.angle_increment = sick::degToRad(data.getDerivedValuesPtr()->getAngularBeamResolution());
439  boost::posix_time::microseconds time_increment =
440  boost::posix_time::microseconds(data.getDerivedValuesPtr()->getInterbeamPeriod());
441  scan.time_increment = time_increment.total_microseconds() * 1e-6;
442  boost::posix_time::milliseconds scan_time =
443  boost::posix_time::milliseconds(data.getDerivedValuesPtr()->getScanTime());
444  scan.scan_time = scan_time.total_microseconds() * 1e-6;
445  scan.range_min = m_range_min;
446  scan.range_max = m_range_max;
447  scan.ranges.resize(num_scan_points);
448  scan.intensities.resize(num_scan_points);
449 
450 
451  for (uint32_t i = 0; i < num_scan_points; ++i)
452  {
453  const sick::datastructure::ScanPoint scan_point = scan_points.at(i);
454  // Filter for intensities
455  if (m_min_intensities < static_cast<double>(scan_point.getReflectivity()))
456  {
457  scan.ranges[i] = static_cast<float>(scan_point.getDistance()) *
458  data.getDerivedValuesPtr()->getMultiplicationFactor() * 1e-3; // mm -> m
459  // Set values close to/greater than max range to infinity according to REP 117
460  // https://www.ros.org/reps/rep-0117.html
461  if (scan.ranges[i] >= (0.999 * m_range_max))
462  {
463  scan.ranges[i] = std::numeric_limits<double>::infinity();
464  }
465  }
466  else
467  {
468  scan.ranges[i] = std::numeric_limits<double>::infinity();
469  }
470  scan.intensities[i] = static_cast<float>(scan_point.getReflectivity());
471  }
472  return scan;
473 }
474 
475 sick_safetyscanners::OutputPathsMsg
477 {
478  sick_safetyscanners::OutputPathsMsg msg;
479 
480  std::shared_ptr<sick::datastructure::ApplicationData> app_data = data.getApplicationDataPtr();
481  sick::datastructure::ApplicationOutputs outputs = app_data->getOutputs();
482 
483  std::vector<bool> eval_out = outputs.getEvalOutVector();
484  std::vector<bool> eval_out_is_safe = outputs.getEvalOutIsSafeVector();
485  std::vector<bool> eval_out_valid = outputs.getEvalOutIsValidVector();
486 
487  std::vector<uint16_t> monitoring_case_numbers = outputs.getMonitoringCaseVector();
488  std::vector<bool> monitoring_case_number_flags = outputs.getMonitoringCaseFlagsVector();
489 
490  // Fix according to issue #46, however why this appears is not clear
491  if (monitoring_case_number_flags.size() > 0)
492  {
493  msg.active_monitoring_case = monitoring_case_numbers.at(0);
494  }
495  else
496  {
497  msg.active_monitoring_case = 0;
498  }
499 
500  for (size_t i = 0; i < eval_out.size(); i++)
501  {
502  msg.status.push_back(eval_out.at(i));
503  msg.is_safe.push_back(eval_out_is_safe.at(i));
504  msg.is_valid.push_back(eval_out_valid.at(i));
505  }
506  return msg;
507 }
508 
509 sick_safetyscanners::RawMicroScanDataMsg
511 {
512  sick_safetyscanners::RawMicroScanDataMsg msg;
513 
514  msg.header = createDataHeaderMessage(data);
515  msg.derived_values = createDerivedValuesMessage(data);
516  msg.general_system_state = createGeneralSystemStateMessage(data);
517  msg.measurement_data = createMeasurementDataMessage(data);
518  msg.intrusion_data = createIntrusionDataMessage(data);
519  msg.application_data = createApplicationDataMessage(data);
520 
521  return msg;
522 }
523 
524 sick_safetyscanners::DataHeaderMsg
526 {
527  sick_safetyscanners::DataHeaderMsg msg;
528 
529  if (!data.getDataHeaderPtr()->isEmpty())
530  {
531  std::shared_ptr<sick::datastructure::DataHeader> data_header = data.getDataHeaderPtr();
532 
533  msg.version_version = data_header->getVersionIndicator();
534  msg.version_release = data_header->getVersionRelease();
535  msg.version_major_version = data_header->getVersionMajorVersion();
536  msg.version_minor_version = data_header->getVersionMinorVersion();
537 
538  msg.scan_number = data_header->getScanNumber();
539  msg.sequence_number = data_header->getSequenceNumber();
540 
541  msg.serial_number_of_device = data_header->getSerialNumberOfDevice();
542  msg.serial_number_of_channel_plug = data_header->getSerialNumberOfSystemPlug();
543 
544  msg.channel_number = data_header->getChannelNumber();
545 
546  msg.timestamp_date = data_header->getTimestampDate();
547  msg.timestamp_time = data_header->getTimestampTime();
548  }
549  return msg;
550 }
551 
552 sick_safetyscanners::DerivedValuesMsg
554 {
555  sick_safetyscanners::DerivedValuesMsg msg;
556 
557  if (!data.getDerivedValuesPtr()->isEmpty())
558  {
559  std::shared_ptr<sick::datastructure::DerivedValues> derived_values = data.getDerivedValuesPtr();
560 
561  msg.multiplication_factor = derived_values->getMultiplicationFactor();
562  msg.scan_time = derived_values->getScanTime();
563  msg.interbeam_period = derived_values->getInterbeamPeriod();
564  msg.number_of_beams = derived_values->getNumberOfBeams();
565  msg.start_angle = derived_values->getStartAngle() + m_angle_offset;
566  msg.angular_beam_resolution = derived_values->getAngularBeamResolution();
567  }
568  return msg;
569 }
570 
571 sick_safetyscanners::GeneralSystemStateMsg
573 {
574  sick_safetyscanners::GeneralSystemStateMsg msg;
575 
576  if (!data.getGeneralSystemStatePtr()->isEmpty())
577  {
578  std::shared_ptr<sick::datastructure::GeneralSystemState> general_system_state =
580 
581  msg.run_mode_active = general_system_state->getRunModeActive();
582  msg.standby_mode_active = general_system_state->getStandbyModeActive();
583  msg.contamination_warning = general_system_state->getContaminationWarning();
584  msg.contamination_error = general_system_state->getContaminationError();
585  msg.reference_contour_status = general_system_state->getReferenceContourStatus();
586  msg.manipulation_status = general_system_state->getManipulationStatus();
587 
588  std::vector<bool> safe_cut_off_path = general_system_state->getSafeCutOffPathVector();
589  for (size_t i = 0; i < safe_cut_off_path.size(); i++)
590  {
591  msg.safe_cut_off_path.push_back(safe_cut_off_path.at(i));
592  }
593 
594  std::vector<bool> non_safe_cut_off_path = general_system_state->getNonSafeCutOffPathVector();
595  for (size_t i = 0; i < non_safe_cut_off_path.size(); i++)
596  {
597  msg.non_safe_cut_off_path.push_back(non_safe_cut_off_path.at(i));
598  }
599 
600  std::vector<bool> reset_required_cut_off_path =
601  general_system_state->getResetRequiredCutOffPathVector();
602  for (size_t i = 0; i < reset_required_cut_off_path.size(); i++)
603  {
604  msg.reset_required_cut_off_path.push_back(reset_required_cut_off_path.at(i));
605  }
606 
607  msg.current_monitoring_case_no_table_1 =
608  general_system_state->getCurrentMonitoringCaseNoTable1();
609  msg.current_monitoring_case_no_table_2 =
610  general_system_state->getCurrentMonitoringCaseNoTable2();
611  msg.current_monitoring_case_no_table_3 =
612  general_system_state->getCurrentMonitoringCaseNoTable3();
613  msg.current_monitoring_case_no_table_4 =
614  general_system_state->getCurrentMonitoringCaseNoTable4();
615 
616  msg.application_error = general_system_state->getApplicationError();
617  msg.device_error = general_system_state->getDeviceError();
618  }
619  return msg;
620 }
621 
622 sick_safetyscanners::MeasurementDataMsg
624 {
625  sick_safetyscanners::MeasurementDataMsg msg;
626 
627  if (!data.getMeasurementDataPtr()->isEmpty())
628  {
629  msg.number_of_beams = data.getMeasurementDataPtr()->getNumberOfBeams();
630  msg.scan_points = createScanPointMessageVector(data);
631  }
632  return msg;
633 }
634 
635 std::vector<sick_safetyscanners::ScanPointMsg>
637 {
638  std::vector<sick_safetyscanners::ScanPointMsg> msg_vector;
639 
640  std::shared_ptr<sick::datastructure::MeasurementData> measurement_data =
641  data.getMeasurementDataPtr();
642  std::vector<sick::datastructure::ScanPoint> scan_points = measurement_data->getScanPointsVector();
643  // uint32_t num_points = measurement_data->getNumberOfBeams();
644  uint32_t num_points = scan_points.size();
645  for (uint32_t i = 0; i < num_points; i++)
646  {
647  sick::datastructure::ScanPoint scan_point = scan_points.at(i);
648  sick_safetyscanners::ScanPointMsg msg;
649  msg.distance = scan_point.getDistance();
650  msg.reflectivity = scan_point.getReflectivity();
651  msg.angle = scan_point.getAngle() + m_angle_offset;
652  msg.valid = scan_point.getValidBit();
653  msg.infinite = scan_point.getInfiniteBit();
654  msg.glare = scan_point.getGlareBit();
655  msg.reflector = scan_point.getReflectorBit();
656  msg.contamination_warning = scan_point.getContaminationWarningBit();
657  msg.contamination = scan_point.getContaminationBit();
658 
659  msg_vector.push_back(msg);
660  }
661  return msg_vector;
662 }
663 
664 sick_safetyscanners::IntrusionDataMsg
666 {
667  sick_safetyscanners::IntrusionDataMsg msg;
668 
669  if (!data.getIntrusionDataPtr()->isEmpty())
670  {
671  msg.data = createIntrusionDatumMessageVector(data);
672  }
673  return msg;
674 }
675 
676 std::vector<sick_safetyscanners::IntrusionDatumMsg>
678 {
679  std::vector<sick_safetyscanners::IntrusionDatumMsg> msg_vector;
680 
681  std::shared_ptr<sick::datastructure::IntrusionData> intrusion_data = data.getIntrusionDataPtr();
682  std::vector<sick::datastructure::IntrusionDatum> intrusion_datums =
683  intrusion_data->getIntrusionDataVector();
684 
685  for (size_t i = 0; i < intrusion_datums.size(); i++)
686  {
687  sick_safetyscanners::IntrusionDatumMsg msg;
688  sick::datastructure::IntrusionDatum intrusion_datum = intrusion_datums.at(i);
689  msg.size = intrusion_datum.getSize();
690  std::vector<bool> flags = intrusion_datum.getFlagsVector();
691  for (size_t j = 0; j < flags.size(); j++)
692  {
693  msg.flags.push_back(flags.at(j));
694  }
695  msg_vector.push_back(msg);
696  }
697  return msg_vector;
698 }
699 
700 sick_safetyscanners::ApplicationDataMsg
702 {
703  sick_safetyscanners::ApplicationDataMsg msg;
704 
705  if (!data.getApplicationDataPtr()->isEmpty())
706  {
707  msg.inputs = createApplicationInputsMessage(data);
708  msg.outputs = createApplicationOutputsMessage(data);
709  }
710  return msg;
711 }
712 
713 sick_safetyscanners::ApplicationInputsMsg
715 {
716  sick_safetyscanners::ApplicationInputsMsg msg;
717 
718  std::shared_ptr<sick::datastructure::ApplicationData> app_data = data.getApplicationDataPtr();
719  sick::datastructure::ApplicationInputs inputs = app_data->getInputs();
720  std::vector<bool> unsafe_inputs = inputs.getUnsafeInputsInputSourcesVector();
721  std::vector<bool> unsafe_inputs_flags = inputs.getUnsafeInputsFlagsVector();
722  for (size_t i = 0; i < unsafe_inputs.size(); i++)
723  {
724  msg.unsafe_inputs_input_sources.push_back(unsafe_inputs.at(i));
725  msg.unsafe_inputs_flags.push_back(unsafe_inputs_flags.at(i));
726  }
727  std::vector<uint16_t> monitoring_case = inputs.getMonitoringCasevector();
728  std::vector<bool> monitoring_case_flags = inputs.getMonitoringCaseFlagsVector();
729  for (size_t i = 0; i < monitoring_case.size(); i++)
730  {
731  msg.monitoring_case_number_inputs.push_back(monitoring_case.at(i));
732  msg.monitoring_case_number_inputs_flags.push_back(monitoring_case_flags.at(i));
733  }
734  msg.linear_velocity_inputs_velocity_0 = inputs.getVelocity0();
735  msg.linear_velocity_inputs_velocity_0_transmitted_safely = inputs.getVelocity0TransmittedSafely();
736  msg.linear_velocity_inputs_velocity_0_valid = inputs.getVelocity0Valid();
737  msg.linear_velocity_inputs_velocity_1 = inputs.getVelocity1();
738  msg.linear_velocity_inputs_velocity_1_transmitted_safely = inputs.getVelocity1TransmittedSafely();
739  msg.linear_velocity_inputs_velocity_1_valid = inputs.getVelocity1Valid();
740 
741  msg.sleep_mode_input = inputs.getSleepModeInput();
742 
743  return msg;
744 }
745 
746 sick_safetyscanners::ApplicationOutputsMsg
748 {
749  sick_safetyscanners::ApplicationOutputsMsg msg;
750 
751  std::shared_ptr<sick::datastructure::ApplicationData> app_data = data.getApplicationDataPtr();
752  sick::datastructure::ApplicationOutputs outputs = app_data->getOutputs();
753 
754  std::vector<bool> eval_out = outputs.getEvalOutVector();
755  std::vector<bool> eval_out_is_safe = outputs.getEvalOutIsSafeVector();
756  std::vector<bool> eval_out_valid = outputs.getEvalOutIsValidVector();
757  for (size_t i = 0; i < eval_out.size(); i++)
758  {
759  msg.evaluation_path_outputs_eval_out.push_back(eval_out.at(i));
760  msg.evaluation_path_outputs_is_safe.push_back(eval_out_is_safe.at(i));
761  msg.evaluation_path_outputs_is_valid.push_back(eval_out_valid.at(i));
762  }
763 
764  std::vector<uint16_t> monitoring_case = outputs.getMonitoringCaseVector();
765  std::vector<bool> monitoring_case_flags = outputs.getMonitoringCaseFlagsVector();
766  for (size_t i = 0; i < monitoring_case.size(); i++)
767  {
768  msg.monitoring_case_number_outputs.push_back(monitoring_case.at(i));
769  msg.monitoring_case_number_outputs_flags.push_back(monitoring_case_flags.at(i));
770  }
771 
772  msg.sleep_mode_output = outputs.getSleepModeOutput();
773  msg.sleep_mode_output_valid = outputs.getFlagsSleepModeOutputIsValid();
774 
775  msg.error_flag_contamination_warning = outputs.getHostErrorFlagContaminationWarning();
776  msg.error_flag_contamination_error = outputs.getHostErrorFlagContaminationError();
777  msg.error_flag_manipulation_error = outputs.getHostErrorFlagManipulationError();
778  msg.error_flag_glare = outputs.getHostErrorFlagGlare();
779  msg.error_flag_reference_contour_intruded = outputs.getHostErrorFlagReferenceContourIntruded();
780  msg.error_flag_critical_error = outputs.getHostErrorFlagCriticalError();
781  msg.error_flags_are_valid = outputs.getFlagsHostErrorFlagsAreValid();
782 
783  msg.linear_velocity_outputs_velocity_0 = outputs.getVelocity0();
784  msg.linear_velocity_outputs_velocity_0_transmitted_safely =
786  msg.linear_velocity_outputs_velocity_0_valid = outputs.getVelocity0Valid();
787  msg.linear_velocity_outputs_velocity_1 = outputs.getVelocity1();
788  msg.linear_velocity_outputs_velocity_1_transmitted_safely =
790  msg.linear_velocity_outputs_velocity_1_valid = outputs.getVelocity1Valid();
791 
792  std::vector<int16_t> resulting_velocities = outputs.getResultingVelocityVector();
793  std::vector<bool> resulting_velocities_flags = outputs.getResultingVelocityIsValidVector();
794 
795  for (size_t i = 0; i < resulting_velocities.size(); i++)
796  {
797  msg.resulting_velocity.push_back(resulting_velocities.at(i));
798  msg.resulting_velocity_flags.push_back(resulting_velocities_flags.at(i));
799  }
800 
801 
802  return msg;
803 }
804 
805 bool SickSafetyscannersRos::getFieldData(sick_safetyscanners::FieldData::Request& req,
806  sick_safetyscanners::FieldData::Response& res)
807 {
808  std::vector<sick::datastructure::FieldData> fields;
809  m_device->requestFieldData(m_communication_settings, fields);
810 
811  for (size_t i = 0; i < fields.size(); i++)
812  {
813  sick::datastructure::FieldData field = fields.at(i);
814  sick_safetyscanners::FieldMsg field_msg;
815 
816  field_msg.start_angle = degToRad(field.getStartAngle() + m_angle_offset);
817  field_msg.angular_resolution = degToRad(field.getAngularBeamResolution());
818  field_msg.protective_field = field.getIsProtectiveField();
819 
820  std::vector<uint16_t> ranges = field.getBeamDistances();
821  for (size_t j = 0; j < ranges.size(); j++)
822  {
823  field_msg.ranges.push_back(static_cast<float>(ranges.at(j)) * 1e-3);
824  }
825 
826  res.fields.push_back(field_msg);
827  }
828 
829  datastructure::DeviceName device_name;
830  m_device->requestDeviceName(m_communication_settings, device_name);
831  res.device_name = device_name.getDeviceName();
832 
833 
834  std::vector<sick::datastructure::MonitoringCaseData> monitoring_cases;
835  m_device->requestMonitoringCases(m_communication_settings, monitoring_cases);
836 
837  for (size_t i = 0; i < monitoring_cases.size(); i++)
838  {
839  sick::datastructure::MonitoringCaseData monitoring_case_data = monitoring_cases.at(i);
840  sick_safetyscanners::MonitoringCaseMsg monitoring_case_msg;
841 
842  monitoring_case_msg.monitoring_case_number = monitoring_case_data.getMonitoringCaseNumber();
843  std::vector<uint16_t> mon_fields = monitoring_case_data.getFieldIndices();
844  std::vector<bool> mon_fields_valid = monitoring_case_data.getFieldsValid();
845  for (size_t j = 0; j < mon_fields.size(); j++)
846  {
847  monitoring_case_msg.fields.push_back(mon_fields.at(j));
848  monitoring_case_msg.fields_valid.push_back(mon_fields_valid.at(j));
849  }
850  res.monitoring_cases.push_back(monitoring_case_msg);
851  }
852 
853  return true;
854 }
855 
856 bool SickSafetyscannersRos::getConfigMetadata(sick_safetyscanners::ConfigMetadata::Request& req,
857  sick_safetyscanners::ConfigMetadata::Response& res)
858 {
859  static_cast<void>(req);
860  sick::datastructure::ConfigMetadata config_metadata;
861  m_device->requestConfigMetadata(m_communication_settings, config_metadata);
862 
863  res.app_checksum = getCheckSumString(config_metadata.getAppChecksum());
864  res.integrity_hash.clear();
865  std::vector<uint32_t> integrity_hash = config_metadata.getIntegrityHash();
866  for (const auto& hash : integrity_hash)
867  {
868  res.integrity_hash.push_back(hash);
869  }
870  res.modification_time_date = config_metadata.getModificationTimeDate();
871  res.modification_time_time = config_metadata.getModificationTimeTime();
872  res.modification_time = getDateString(res.modification_time_date, res.modification_time_time);
873  res.overall_checksum = getCheckSumString(config_metadata.getOverallChecksum());
874  res.transfer_time_date = config_metadata.getModificationTimeDate();
875  res.transfer_time_time = config_metadata.getModificationTimeTime();
876  res.transfer_time = getDateString(res.transfer_time_date, res.transfer_time_time);
877  res.version_c_version = config_metadata.getVersionCVersion();
878  res.version_major_version_number = config_metadata.getVersionMajorVersionNumber();
879  res.version_minor_version_number = config_metadata.getVersionMinorVersionNumber();
880  res.version_release_number = config_metadata.getVersionReleaseNumber();
881 
882  return true;
883 }
884 
885 bool SickSafetyscannersRos::getStatusOverview(sick_safetyscanners::StatusOverview::Request& req,
886  sick_safetyscanners::StatusOverview::Response& res)
887 {
888  static_cast<void>(req);
889 
890  sick::datastructure::StatusOverview status_overview;
891  m_device->requestStatusOverview(m_communication_settings, status_overview);
892 
893  res.version_c_version = status_overview.getVersionCVersion();
894  res.version_major_version_number = status_overview.getVersionMajorVersionNumber();
895  res.version_minor_version_number = status_overview.getVersionMinorVersionNumber();
896  res.version_release_number = status_overview.getVersionReleaseNumber();
897 
898  res.device_state = status_overview.getDeviceState();
899  res.config_state = status_overview.getConfigState();
900  res.application_state = status_overview.getApplicationState();
901  res.current_time_power_on_count = status_overview.getCurrentTimePowerOnCount();
902 
903  res.current_time_date = status_overview.getCurrentTimeDate();
904  res.current_time_time = status_overview.getCurrentTimeTime();
905  res.current_time = getDateString(res.current_time_date, res.current_time_time);
906 
907  res.error_info_code = status_overview.getErrorInfoCode();
908 
909  res.error_info_time_date = status_overview.getErrorInfoDate();
910  res.error_info_time_time = status_overview.getErrorInfoTime();
911  res.error_info_time = getDateString(res.error_info_time_date, res.error_info_time_time);
912 
913  return true;
914 }
915 
916 std::string SickSafetyscannersRos::getCheckSumString(uint32_t checksum)
917 {
918  std::stringstream ss;
919  ss << "0x" << std::hex << (checksum & 0xFF) << ((checksum & 0xFF00) >> 8)
920  << ((checksum & 0xFF0000) >> 16) << ((checksum & 0xFF000000) >> 24);
921  return ss.str();
922 }
923 
924 std::string SickSafetyscannersRos::getDateString(uint32_t days_since_1972, uint32_t milli_seconds)
925 {
926  std::time_t t = static_cast<std::time_t>((730 /* = days from Jan 1 1970 to Jan 1 1972*/
927  + days_since_1972) *
928  24 * 3600 +
929  milli_seconds * 0.001);
930  char buffer[40];
931  std::string retval;
932  strftime(buffer, 40, "%F %X", gmtime(&t));
933  retval = buffer;
934  return retval;
935 }
936 
937 
938 } // namespace sick
std::vector< uint32_t > getIntegrityHash() const
Gets the integrity hash for the scanner.
std::string getVersionCVersion() const
Gets the version indicator for the scanner.
msg
std::vector< bool > getUnsafeInputsFlagsVector() const
Gets the flags for the unsafe input sources.
uint32_t getModificationTimeTime() const
Gets the modification time time for the scanner.
sick_safetyscanners::ApplicationOutputsMsg createApplicationOutputsMessage(const sick::datastructure::Data &data)
std::shared_ptr< MeasurementData > getMeasurementDataPtr() const
Gets the measurement data.
Definition: Data.cpp:74
Class containing the serial number of a laser scanner.
sick_safetyscanners::MeasurementDataMsg createMeasurementDataMessage(const sick::datastructure::Data &data)
uint16_t getErrorInfoDate() const
Gets the error info date for the scanner.
diagnostic_updater::Updater m_diagnostic_updater
sick_safetyscanners::DataHeaderMsg createDataHeaderMessage(const sick::datastructure::Data &data)
uint8_t getInterfaceType() const
Gets the interface type for the scanner.
Definition: TypeCode.cpp:51
void setEInterfaceType(const uint8_t &e_interface_type)
Sets the eInterface type.
void setFeatures(const uint16_t &features)
Set the enabled features.
bool getHostErrorFlagManipulationError() const
Gets if a manipulation error is present.
float getStartAngle() const
Gets the start angle of the scan.
Definition: ConfigData.cpp:171
ROSCPP_DECL void start()
int8_t getSleepModeOutput() const
Gets the state of the sleep mode.
uint8_t getVersionMajorVersionNumber() const
Gets the major version number for the scanner.
void setSensorTcpPort(const uint16_t &sensor_tcp_port)
Sets the sensor tcp port.
uint8_t getDeviceState() const
Gets the device state for the scanner.
uint32_t getCurrentTimePowerOnCount() const
Gets the current time power on count for the scanner.
uint8_t getVersionReleaseNumber() const
Gets the version release number for the scanner.
bool getVelocity1Valid() const
Gets if the second linear velocity output is valid.
ros::ServiceServer m_config_metadata_server
void summary(unsigned char lvl, const std::string s)
float getStartAngle() const
Get the start angle of the scan.
Definition: FieldData.cpp:193
std::vector< bool > getFieldsValid() const
Returns if the fields are configured and valid.
float getMaxRange() const
Gets the max range for the scanner.
Definition: TypeCode.cpp:61
std::vector< uint16_t > getMonitoringCasevector() const
Gets the monitoring case numbers.
int32_t getSize() const
Returns size of flag vector.
int16_t getVelocity0() const
Gets the first linear velocity input.
ros::NodeHandle m_nh
ROS node handle.
void setHardwareID(const std::string &hwid)
void setEnabled(bool enabled)
Sets if the channel is enabled.
bool getHostErrorFlagCriticalError() const
Gets if a critical error is present.
bool getHostErrorFlagContaminationError() const
Gets if a contamination error is present.
uint32_t getAppChecksum() const
Gets the application checksum for the scanner.
void reconfigureCallback(const sick_safetyscanners::SickSafetyscannersConfigurationConfig &config, const uint32_t &level)
Function which is triggered when a dynamic reconfiguration is performed.
sick_safetyscanners::GeneralSystemStateMsg createGeneralSystemStateMessage(const sick::datastructure::Data &data)
std::vector< bool > getEvalOutVector() const
Gets the state of the non safe cut-off paths.
int16_t getVelocity1() const
Gets the second linear velocity input.
uint16_t skipToPublishFrequency(int skip)
Converts a skip value into a "publish frequency" value.
The applications inputs from a udp data packet.
uint8_t getApplicationState() const
Gets the application state for the scanner.
Class containing the data of a single scan point.
Definition: ScanPoint.h:46
void add(const std::string &name, TaskFunction f)
std::vector< sick_safetyscanners::IntrusionDatumMsg > createIntrusionDatumMessageVector(const sick::datastructure::Data &data)
void setEndAngle(const uint32_t &end_angle)
Sets the end angle of the scan.
std::shared_ptr< DiagnosedLaserScanPublisher > m_diagnosed_laser_scan_publisher
Class containing a single IntrusionDatum.
bool getContaminationWarningBit() const
Returns if there is a contamination warning.
Definition: ScanPoint.cpp:103
Field data for warning and protective fields.
Definition: FieldData.h:48
std::shared_ptr< ApplicationData > getApplicationDataPtr() const
Gets the application data.
Definition: Data.cpp:94
std::string getVersionCVersion() const
Gets the version indicator for the scanner.
void sensorDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &diagnostic_status)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ros::ServiceServer m_field_service_server
sick_safetyscanners::RawMicroScanDataMsg createRawDataMessage(const sick::datastructure::Data &data)
bool getVelocity0Valid() const
Gets if the first linear velocity output is valid.
void setPublishingFrequency(const uint16_t &publishing_frequency)
Sets the publishing frequency.
float getEndAngle() const
Gets the end angle of the scan.
Definition: ConfigData.cpp:186
uint8_t getReflectivity() const
Getter for the reflectivity value.
Definition: ScanPoint.cpp:73
#define ROS_WARN(...)
bool getValidBit() const
Returns if the scanpoint is valid.
Definition: ScanPoint.cpp:78
sick_safetyscanners::ApplicationDataMsg createApplicationDataMessage(const sick::datastructure::Data &data)
void addf(const std::string &key, const char *format,...)
bool getVelocity0TransmittedSafely() const
Gets if the first linear velocity output is transmitted safely.
uint8_t getVersionReleaseNumber() const
Gets the version release number for the scanner.
The data class containing all data blocks of a measurement.
Definition: Data.h:55
int16_t getVelocity0() const
Gets the first linear velocity output.
dynamic_reconfigure::Server< sick_safetyscanners::SickSafetyscannersConfigurationConfig > m_dynamic_reconfiguration_server
sick::datastructure::FirmwareVersion firmware_version
bool getInfiniteBit() const
Returns if the scanpoint is infinite.
Definition: ScanPoint.cpp:83
void setSensorIp(const boost::asio::ip::address_v4 &sensor_ip)
Sets the sensor IP-address.
std::string boolToString(bool b)
float getAngularBeamResolution() const
Returns the angular resolution between the beams.
Definition: FieldData.cpp:223
std::vector< bool > getEvalOutIsValidVector() const
If the output path is valid.
sick_safetyscanners::ExtendedLaserScanMsg createExtendedLaserScanMessage(const sick::datastructure::Data &data)
bool getContaminationBit() const
Returns if the scanpoint is contaminated.
Definition: ScanPoint.cpp:98
void publish(const boost::shared_ptr< M > &message) const
sick_safetyscanners::DerivedValuesMsg createDerivedValuesMessage(const sick::datastructure::Data &data)
bool getFieldData(sick_safetyscanners::FieldData::Request &req, sick_safetyscanners::FieldData::Response &res)
uint8_t getConfigState() const
Gets the config state for the scanner.
bool getFlagsSleepModeOutputIsValid() const
Gets if the sleep mode is valid.
Duration & fromSec(double t)
bool getReflectorBit() const
Returns if the scanpoint detects a reflector.
Definition: ScanPoint.cpp:93
void receivedUDPPacket(const datastructure::Data &data)
Function which is called when a new complete UDP Packet is received.
Class containing the device name of a laser scanner.
Definition: DeviceName.h:47
ros::ServiceServer m_status_overview_server
std::vector< uint16_t > getFieldIndices() const
Returns the field indices.
uint32_t getCurrentTimeTime() const
Gets the current time time for the scanner.
#define ROS_INFO(...)
bool getParam(const std::string &key, std::string &s) const
std::vector< uint16_t > getMonitoringCaseVector() const
Gets the currently active monitoring case numbers.
bool getConfigMetadata(sick_safetyscanners::ConfigMetadata::Request &req, sick_safetyscanners::ConfigMetadata::Response &res)
bool getVelocity1Valid() const
Gets if second linear velocity input is valid.
float degToRad(float deg)
Converts degrees to radians.
std::string getFirmwareVersion() const
Gets the firmware version for the scanner.
ros::Publisher m_laser_scan_publisher
ROS topic publisher.
uint16_t getDistance() const
Getter for the distance of the scanpoint.
Definition: ScanPoint.cpp:68
uint16_t getCurrentTimeDate() const
Gets the current time date for the scanner.
sick_safetyscanners::IntrusionDataMsg createIntrusionDataMessage(const sick::datastructure::Data &data)
ros::NodeHandle m_private_nh
ROS private node handle.
bool getVelocity1TransmittedSafely() const
Gets if the second linear velocity output is transmitted safely.
uint8_t getVersionMajorVersionNumber() const
Gets the major version number for the scanner.
std::vector< bool > getMedianReflectors(const std::vector< sick::datastructure::ScanPoint > scan_points)
std::vector< bool > getUnsafeInputsInputSourcesVector() const
Gets the unsafe input sources.
void setStartAngle(const uint32_t &start_angle)
Sets the start angle of the scan.
sick_safetyscanners::ApplicationInputsMsg createApplicationInputsMessage(const sick::datastructure::Data &data)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
sick_safetyscanners::OutputPathsMsg createOutputPathsMessage(const sick::datastructure::Data &data)
std::shared_ptr< sick::SickSafetyscanners > m_device
uint32_t getOverallChecksum() const
Gets the overall checksum for the scanner.
bool getVelocity1TransmittedSafely() const
Gets if second linear velocity input is transmitted safely.
std::vector< bool > getResultingVelocityIsValidVector() const
Gets if the resulting velocities are valid.
sick::datastructure::CommSettings m_communication_settings
The application outputs from a udp data packet.
Config data for current and persistent sensor config.
Definition: ConfigData.h:50
void setHostUdpPort(const uint16_t &host_udp_port)
Sets the host udp port.
sensor_msgs::LaserScan createLaserScanMessage(const sick::datastructure::Data &data)
Stores the data for the different monitoring cases.
void setChannel(const uint8_t &channel)
Sets the channel of the data.
Class containing the serial number of a laser scanner.
float radToDeg(float rad)
Converts radians to degrees.
sick_safetyscanners::RawMicroScanDataMsg m_last_raw_data
boost::asio::ip::address_v4 m_interface_ip
diagnostic_updater::DiagnosedPublisher< sensor_msgs::LaserScan > DiagnosedLaserScanPublisher
bool getHostErrorFlagContaminationWarning() const
Gets if a contamination warning is present.
ROSCPP_DECL void requestShutdown()
int16_t getVelocity1() const
Gets the second linear velocity output.
virtual ~SickSafetyscannersRos()
~SickSafetyscannersRos Destructor if the SickSafetyscanners ROS
bool getVelocity0TransmittedSafely() const
Gets if first linear velocity input is transmitted safely.
float getAngle() const
Getter for the angle in sensor coordinates.
Definition: ScanPoint.cpp:63
std::vector< bool > getMonitoringCaseFlagsVector() const
Gets the monitoring case flags.
std::vector< bool > getFlagsVector() const
Getter for the flags vector.
bool getGlareBit() const
Returns if the scanpoint has glare.
Definition: ScanPoint.cpp:88
bool getStatusOverview(sick_safetyscanners::StatusOverview::Request &req, sick_safetyscanners::StatusOverview::Response &res)
uint8_t getVersionMinorVersionNumber() const
Gets the minor version number for the scanner.
std::string getDateString(uint32_t days_since_1972, uint32_t milli_seconds)
getDateString converts the date representation received as days since 1972-01-01 and milliseconds sin...
sick::datastructure::ConfigMetadata config_meta_data
static Time now()
Class containing the type code of a laser scanner.
Definition: TypeCode.h:62
std::vector< int16_t > getResultingVelocityVector() const
Gets the resulting velocity for each monitoring case table.
uint16_t getMonitoringCaseNumber() const
Returns the number of the monitoring case.
bool readParameters()
Reads and verifies the ROS parameters.
const std::string header
uint16_t getModificationTimeDate() const
Gets the modification time date for the scanner.
void add(const std::string &key, const T &val)
uint8_t getVersionMinorVersionNumber() const
Gets the minor version number for the scanner.
boost::asio::ip::address_v4 getSensorIp() const
Gets the sensor IP-address.
bool getHostErrorFlagReferenceContourIntruded() const
Gets if a reference contour is intruded.
int8_t getSleepModeInput() const
Gets the state of the sleep mode.
ros::Publisher m_extended_laser_scan_publisher
bool getIsProtectiveField() const
Returns if a field is a protective field.
Definition: FieldData.cpp:173
std::vector< uint16_t > getBeamDistances() const
Returns vector with beam distances.
Definition: FieldData.cpp:183
uint32_t getErrorInfoTime() const
Gets the error info time for the scanner.
bool getHostErrorFlagGlare() const
Gets if glare is present.
#define ROS_ERROR(...)
uint32_t getErrorInfoCode() const
Gets the error info code for the scanner.
std::string getDeviceName() const
Gets the device name for the scanner.
Definition: DeviceName.cpp:42
std::vector< sick_safetyscanners::ScanPointMsg > createScanPointMessageVector(const sick::datastructure::Data &data)
std::shared_ptr< DerivedValues > getDerivedValuesPtr() const
Gets the derived values.
Definition: Data.cpp:64
bool getVelocity0Valid() const
Gets if first linear velocity input is valid.
std::string getCheckSumString(uint32_t checksum)
getCheckSumString converts the uint32 value received as checksum such that the hexadecimal representa...
std::vector< bool > getMonitoringCaseFlagsVector() const
Gets if the corresponding monitoring case number is valid.
void setHostIp(const boost::asio::ip::address_v4 &host_ip)
Sets the IP-address of the host from an IP-address.
std::shared_ptr< DataHeader > getDataHeaderPtr() const
Gets the data header.
Definition: Data.cpp:42
bool getFlagsHostErrorFlagsAreValid() const
Gets if the error flags are valid.
SickSafetyscannersRos()
Constructor of the SickSafetyscannersRos.
std::shared_ptr< GeneralSystemState > getGeneralSystemStatePtr() const
Gets the general system state.
Definition: Data.cpp:53
std::shared_ptr< IntrusionData > getIntrusionDataPtr() const
Gets the intrusion data.
Definition: Data.cpp:84
std::vector< bool > getEvalOutIsSafeVector() const
Gets if a cut-off path from the output paths is safe.


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Sat Jun 3 2023 03:04:17