43 , m_initialised(false)
47 , m_angle_offset(-90.0)
48 , m_use_pers_conf(false)
50 dynamic_reconfigure::Server<
51 sick_safetyscanners::SickSafetyscannersConfigurationConfig>::CallbackType reconf_callback =
63 m_nh.
advertise<sick_safetyscanners::ExtendedLaserScanMsg>(
"extended_laser_scan", 100);
66 m_nh.
advertise<sick_safetyscanners::OutputPathsMsg>(
"output_paths", 100);
86 m_device = std::make_shared<sick::SickSafetyscanners>(
98 m_device->changeSensorSettings(m_communication_settings);
103 ROS_INFO(
"Successfully launched node.");
108 ROS_INFO(
"Reading Type code settings");
118 ROS_INFO(
"Reading Persistent Configuration");
126 const sick_safetyscanners::SickSafetyscannersConfigurationConfig& config,
const uint32_t& level)
132 if (config.angle_start == config.angle_end)
143 config.derived_settings,
144 config.measurement_data,
145 config.intrusion_data,
146 config.application_io_data);
169 std::string sensor_ip_adress =
"192.168.1.10";
173 ROS_WARN(
"Using default sensor IP: %s", sensor_ip_adress.c_str());
178 std::string host_ip_adress =
"192.168.1.9";
181 ROS_WARN(
"Using default host IP: %s", host_ip_adress.c_str());
185 std::string interface_ip_adress =
"0.0.0.0";
188 ROS_WARN(
"Using default interface IP: %s", interface_ip_adress.c_str());
190 m_interface_ip = boost::asio::ip::address_v4::from_string(interface_ip_adress);
192 int host_udp_port = 0;
195 ROS_WARN(
"Using default host UDP Port: %i", host_udp_port);
199 ROS_WARN(
"If not further specified the default values for the dynamic reconfigurable parameters " 227 if (angle_start == angle_end)
240 bool general_system_state;
243 bool derived_settings;
246 bool measurement_data;
252 bool application_io_data;
256 general_system_state, derived_settings, measurement_data, intrusion_data, application_io_data);
295 return b ?
"true" :
"false";
302 if (header.timestamp_time == 0 && header.timestamp_date == 0)
304 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::STALE,
305 "Could not get sensor state");
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);
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);
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);
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));
344 if (state.device_error)
346 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"Device error");
348 else if (state.application_error)
350 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"Application error");
352 else if (state.contamination_error)
354 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::ERROR,
"Contamination error");
356 else if (state.contamination_warning)
358 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::WARN,
"Contamination warning");
362 diagnostic_status.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"OK");
366 sick_safetyscanners::ExtendedLaserScanMsg
370 sick_safetyscanners::ExtendedLaserScanMsg
msg;
371 msg.laser_scan = scan;
373 std::vector<sick::datastructure::ScanPoint> scan_points =
375 uint32_t num_scan_points = scan_points.size();
378 msg.reflektor_status.resize(num_scan_points);
379 msg.intrusion.resize(num_scan_points);
380 msg.reflektor_median.resize(num_scan_points);
382 for (uint32_t i = 0; i < num_scan_points; ++i)
387 msg.reflektor_median[i] = medians.at(i);
393 const std::vector<sick::datastructure::ScanPoint> scan_points)
395 std::vector<bool> res;
396 res.resize(scan_points.size());
399 for (
size_t i = 0; i < scan_points.size(); i++)
402 if (!last && scan_points.at(i).getReflectorBit())
407 else if (last && (!scan_points.at(i).getReflectorBit() || i == scan_points.size() - 1))
410 res.at(start + ((i - start) / 2)) =
true;
417 sensor_msgs::LaserScan
420 sensor_msgs::LaserScan scan;
426 std::vector<sick::datastructure::ScanPoint> scan_points =
428 uint32_t num_scan_points = scan_points.size();
433 ->getScanPointsVector()
437 scan.angle_max = angle_max;
439 boost::posix_time::microseconds time_increment =
441 scan.time_increment = time_increment.total_microseconds() * 1e-6;
442 boost::posix_time::milliseconds scan_time =
444 scan.scan_time = scan_time.total_microseconds() * 1e-6;
447 scan.ranges.resize(num_scan_points);
448 scan.intensities.resize(num_scan_points);
451 for (uint32_t i = 0; i < num_scan_points; ++i)
457 scan.ranges[i] =
static_cast<float>(scan_point.
getDistance()) *
463 scan.ranges[i] = std::numeric_limits<double>::infinity();
468 scan.ranges[i] = std::numeric_limits<double>::infinity();
470 scan.intensities[i] =
static_cast<float>(scan_point.
getReflectivity());
475 sick_safetyscanners::OutputPathsMsg
478 sick_safetyscanners::OutputPathsMsg
msg;
491 if (monitoring_case_number_flags.size() > 0)
493 msg.active_monitoring_case = monitoring_case_numbers.at(0);
497 msg.active_monitoring_case = 0;
500 for (
size_t i = 0; i < eval_out.size(); i++)
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));
509 sick_safetyscanners::RawMicroScanDataMsg
512 sick_safetyscanners::RawMicroScanDataMsg
msg;
524 sick_safetyscanners::DataHeaderMsg
527 sick_safetyscanners::DataHeaderMsg
msg;
531 std::shared_ptr<sick::datastructure::DataHeader> data_header = data.
getDataHeaderPtr();
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();
538 msg.scan_number = data_header->getScanNumber();
539 msg.sequence_number = data_header->getSequenceNumber();
541 msg.serial_number_of_device = data_header->getSerialNumberOfDevice();
542 msg.serial_number_of_channel_plug = data_header->getSerialNumberOfSystemPlug();
544 msg.channel_number = data_header->getChannelNumber();
546 msg.timestamp_date = data_header->getTimestampDate();
547 msg.timestamp_time = data_header->getTimestampTime();
552 sick_safetyscanners::DerivedValuesMsg
555 sick_safetyscanners::DerivedValuesMsg
msg;
559 std::shared_ptr<sick::datastructure::DerivedValues> derived_values = data.
getDerivedValuesPtr();
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();
571 sick_safetyscanners::GeneralSystemStateMsg
574 sick_safetyscanners::GeneralSystemStateMsg
msg;
578 std::shared_ptr<sick::datastructure::GeneralSystemState> general_system_state =
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();
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++)
591 msg.safe_cut_off_path.push_back(safe_cut_off_path.at(i));
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++)
597 msg.non_safe_cut_off_path.push_back(non_safe_cut_off_path.at(i));
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++)
604 msg.reset_required_cut_off_path.push_back(reset_required_cut_off_path.at(i));
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();
616 msg.application_error = general_system_state->getApplicationError();
617 msg.device_error = general_system_state->getDeviceError();
622 sick_safetyscanners::MeasurementDataMsg
625 sick_safetyscanners::MeasurementDataMsg
msg;
635 std::vector<sick_safetyscanners::ScanPointMsg>
638 std::vector<sick_safetyscanners::ScanPointMsg> msg_vector;
640 std::shared_ptr<sick::datastructure::MeasurementData> measurement_data =
642 std::vector<sick::datastructure::ScanPoint> scan_points = measurement_data->getScanPointsVector();
644 uint32_t num_points = scan_points.size();
645 for (uint32_t i = 0; i < num_points; i++)
648 sick_safetyscanners::ScanPointMsg
msg;
659 msg_vector.push_back(msg);
664 sick_safetyscanners::IntrusionDataMsg
667 sick_safetyscanners::IntrusionDataMsg
msg;
676 std::vector<sick_safetyscanners::IntrusionDatumMsg>
679 std::vector<sick_safetyscanners::IntrusionDatumMsg> msg_vector;
681 std::shared_ptr<sick::datastructure::IntrusionData> intrusion_data = data.
getIntrusionDataPtr();
682 std::vector<sick::datastructure::IntrusionDatum> intrusion_datums =
683 intrusion_data->getIntrusionDataVector();
685 for (
size_t i = 0; i < intrusion_datums.size(); i++)
687 sick_safetyscanners::IntrusionDatumMsg
msg;
689 msg.size = intrusion_datum.
getSize();
691 for (
size_t j = 0; j < flags.size(); j++)
693 msg.flags.push_back(flags.at(j));
695 msg_vector.push_back(msg);
700 sick_safetyscanners::ApplicationDataMsg
703 sick_safetyscanners::ApplicationDataMsg
msg;
713 sick_safetyscanners::ApplicationInputsMsg
716 sick_safetyscanners::ApplicationInputsMsg
msg;
722 for (
size_t i = 0; i < unsafe_inputs.size(); i++)
724 msg.unsafe_inputs_input_sources.push_back(unsafe_inputs.at(i));
725 msg.unsafe_inputs_flags.push_back(unsafe_inputs_flags.at(i));
729 for (
size_t i = 0; i < monitoring_case.size(); i++)
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));
734 msg.linear_velocity_inputs_velocity_0 = inputs.
getVelocity0();
737 msg.linear_velocity_inputs_velocity_1 = inputs.
getVelocity1();
746 sick_safetyscanners::ApplicationOutputsMsg
749 sick_safetyscanners::ApplicationOutputsMsg
msg;
757 for (
size_t i = 0; i < eval_out.size(); i++)
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));
766 for (
size_t i = 0; i < monitoring_case.size(); i++)
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));
783 msg.linear_velocity_outputs_velocity_0 = outputs.
getVelocity0();
784 msg.linear_velocity_outputs_velocity_0_transmitted_safely =
787 msg.linear_velocity_outputs_velocity_1 = outputs.
getVelocity1();
788 msg.linear_velocity_outputs_velocity_1_transmitted_safely =
795 for (
size_t i = 0; i < resulting_velocities.size(); i++)
797 msg.resulting_velocity.push_back(resulting_velocities.at(i));
798 msg.resulting_velocity_flags.push_back(resulting_velocities_flags.at(i));
806 sick_safetyscanners::FieldData::Response& res)
808 std::vector<sick::datastructure::FieldData> fields;
811 for (
size_t i = 0; i < fields.size(); i++)
814 sick_safetyscanners::FieldMsg field_msg;
821 for (
size_t j = 0; j < ranges.size(); j++)
823 field_msg.ranges.push_back(static_cast<float>(ranges.at(j)) * 1e-3);
826 res.fields.push_back(field_msg);
834 std::vector<sick::datastructure::MonitoringCaseData> monitoring_cases;
837 for (
size_t i = 0; i < monitoring_cases.size(); i++)
840 sick_safetyscanners::MonitoringCaseMsg monitoring_case_msg;
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++)
847 monitoring_case_msg.fields.push_back(mon_fields.at(j));
848 monitoring_case_msg.fields_valid.push_back(mon_fields_valid.at(j));
850 res.monitoring_cases.push_back(monitoring_case_msg);
857 sick_safetyscanners::ConfigMetadata::Response& res)
859 static_cast<void>(req);
864 res.integrity_hash.clear();
866 for (
const auto& hash : integrity_hash)
868 res.integrity_hash.push_back(hash);
872 res.modification_time =
getDateString(res.modification_time_date, res.modification_time_time);
876 res.transfer_time =
getDateString(res.transfer_time_date, res.transfer_time_time);
886 sick_safetyscanners::StatusOverview::Response& res)
888 static_cast<void>(req);
905 res.current_time =
getDateString(res.current_time_date, res.current_time_time);
911 res.error_info_time =
getDateString(res.error_info_time_date, res.error_info_time_time);
918 std::stringstream ss;
919 ss <<
"0x" << std::hex << (checksum & 0xFF) << ((checksum & 0xFF00) >> 8)
920 << ((checksum & 0xFF0000) >> 16) << ((checksum & 0xFF000000) >> 24);
926 std::time_t t =
static_cast<std::time_t
>((730
929 milli_seconds * 0.001);
932 strftime(buffer, 40,
"%F %X", gmtime(&t));
sick_safetyscanners::ApplicationOutputsMsg createApplicationOutputsMessage(const sick::datastructure::Data &data)
std::shared_ptr< MeasurementData > getMeasurementDataPtr() const
Gets the measurement data.
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.
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.
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.
std::vector< bool > getFieldsValid() const
Returns if the fields are configured and valid.
float getMaxRange() const
Gets the max range for the scanner.
int32_t getSize() const
Returns size of flag vector.
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.
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.
uint16_t skipToPublishFrequency(int skip)
Converts a skip value into a "publish frequency" value.
uint8_t getApplicationState() const
Gets the application state for the scanner.
Class containing the data of a single scan point.
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.
Field data for warning and protective fields.
std::shared_ptr< ApplicationData > getApplicationDataPtr() const
Gets the application data.
std::string getVersionCVersion() const
Gets the version indicator for the scanner.
void sensorDiagnostics(diagnostic_updater::DiagnosticStatusWrapper &diagnostic_status)
double m_frequency_tolerance
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.
uint8_t getReflectivity() const
Getter for the reflectivity value.
bool getValidBit() const
Returns if the scanpoint is valid.
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.
The data class containing all data blocks of a measurement.
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.
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.
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.
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.
ros::Publisher m_output_path_publisher
bool getFlagsSleepModeOutputIsValid() const
Gets if the sleep mode is valid.
Duration & fromSec(double t)
bool getReflectorBit() const
Returns if the scanpoint detects a reflector.
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.
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.
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)
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.
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.
std::vector< bool > getMedianReflectors(const std::vector< sick::datastructure::ScanPoint > scan_points)
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
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.
void setHostUdpPort(const uint16_t &host_udp_port)
Sets the host udp port.
double m_expected_frequency
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.
ros::Publisher m_raw_data_publisher
float radToDeg(float rad)
Converts radians to degrees.
sick_safetyscanners::RawMicroScanDataMsg m_last_raw_data
boost::asio::ip::address_v4 m_interface_ip
double m_timestamp_max_acceptable
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
float getAngle() const
Getter for the angle in sensor coordinates.
std::vector< bool > getFlagsVector() const
Getter for the flags vector.
bool getGlareBit() const
Returns if the scanpoint has glare.
bool getStatusOverview(sick_safetyscanners::StatusOverview::Request &req, sick_safetyscanners::StatusOverview::Response &res)
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
void readTypeCodeSettings()
Class containing the type code of a laser scanner.
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.
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.
ros::Publisher m_extended_laser_scan_publisher
bool getIsProtectiveField() const
Returns if a field is a protective field.
void readPersistentConfig()
std::vector< uint16_t > getBeamDistances() const
Returns vector with beam distances.
double m_timestamp_min_acceptable
uint32_t getErrorInfoTime() const
Gets the error info time for the scanner.
bool getHostErrorFlagGlare() const
Gets if glare is present.
uint32_t getErrorInfoCode() const
Gets the error info code for the scanner.
std::string getDeviceName() const
Gets the device name for the scanner.
std::vector< sick_safetyscanners::ScanPointMsg > createScanPointMessageVector(const sick::datastructure::Data &data)
std::shared_ptr< DerivedValues > getDerivedValuesPtr() const
Gets the derived values.
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.
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.
std::shared_ptr< IntrusionData > getIntrusionDataPtr() const
Gets the intrusion data.
std::vector< bool > getEvalOutIsSafeVector() const
Gets if a cut-off path from the output paths is safe.