SickSafetyscanners.h
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 #ifndef SICK_SAFETYSCANNERS_SICKSAFETYSCANNERS_H
36 #define SICK_SAFETYSCANNERS_SICKSAFETYSCANNERS_H
37 
38 #include <ros/ros.h>
39 
40 #include <boost/function.hpp>
41 #include <boost/scoped_ptr.hpp>
42 #include <boost/thread.hpp>
43 
44 #include <iostream>
45 #include <string>
46 #include <vector>
47 
55 
77 
78 namespace sick {
79 
84 {
85 public:
90  typedef boost::function<void(const sick::datastructure::Data&)> packetReceivedCallbackFunction;
91 
98  SickSafetyscanners(const packetReceivedCallbackFunction& newPacketReceivedCallbackFunction,
100  boost::asio::ip::address_v4 interface_ip);
101 
105  virtual ~SickSafetyscanners();
106 
111  bool run();
112 
118 
125  sick::datastructure::TypeCode& type_code);
126 
128  sick::datastructure::ApplicationName& application_name);
130  sick::datastructure::SerialNumber& serial_number);
132  sick::datastructure::FirmwareVersion& firmware_version);
133  void requestOrderNumber(const datastructure::CommSettings& settings,
134  datastructure::OrderNumber& order_number);
135  void requestProjectName(const datastructure::CommSettings& settings,
136  datastructure::ProjectName& project_name);
137  void requestUserName(const datastructure::CommSettings& settings,
138  datastructure::UserName& user_name);
140  datastructure::ConfigMetadata& config_metadata);
142  datastructure::StatusOverview& status_overview);
144  datastructure::DeviceStatus& device_status);
146  datastructure::RequiredUserAction& required_user_action);
147  void FindSensor(const datastructure::CommSettings& settings, uint16_t blink_time);
155  std::vector<sick::datastructure::FieldData>& field_data);
156 
164  datastructure::DeviceName& device_name);
165 
173  sick::datastructure::ConfigData& config_data);
180  void
182  std::vector<sick::datastructure::MonitoringCaseData>& monitoring_cases);
183 
184 
185 private:
186  packetReceivedCallbackFunction m_newPacketReceivedCallbackFunction;
187 
188  std::shared_ptr<boost::asio::io_service> m_io_service_ptr;
189  std::shared_ptr<boost::asio::io_service::work> m_io_work_ptr;
190  std::shared_ptr<sick::communication::AsyncUDPClient> m_async_udp_client_ptr;
191  std::shared_ptr<sick::communication::AsyncTCPClient> m_async_tcp_client_ptr;
192  boost::scoped_ptr<boost::thread> m_udp_client_thread_ptr;
193 
194  std::shared_ptr<sick::cola2::Cola2Session> m_session_ptr;
195 
196  std::shared_ptr<sick::data_processing::UDPPacketMerger> m_packet_merger_ptr;
197 
199  bool udpClientThread();
203  void stopTCPConnection();
205  void requestFieldDataInColaSession(std::vector<sick::datastructure::FieldData>& fields);
218  sick::datastructure::RequiredUserAction& required_user_action);
220  std::vector<sick::datastructure::MonitoringCaseData>& monitoring_cases);
221  void FindSensorInColaSession(uint16_t blink_time);
222 };
223 
224 } // namespace sick
225 
226 
227 #endif // SICK_SAFETYSCANNERS_SICKSAFETYSCANNERS_H
void requestOrderNumber(const datastructure::CommSettings &settings, datastructure::OrderNumber &order_number)
void FindSensorInColaSession(uint16_t blink_time)
Class containing the serial number of a laser scanner.
void requestFieldData(const sick::datastructure::CommSettings &settings, std::vector< sick::datastructure::FieldData > &field_data)
Requests data of the protective and warning fields from the sensor.
Class containing the user name of a laser scanner.
Definition: UserName.h:47
void requestMonitoringCases(const sick::datastructure::CommSettings &settings, std::vector< sick::datastructure::MonitoringCaseData > &monitoring_cases)
Requests the monitoring cases from the sensor.
void requestUserNameInColaSession(sick::datastructure::UserName &user_name)
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
void changeCommSettingsInColaSession(const datastructure::CommSettings &settings)
void requestPersistentConfigInColaSession(sick::datastructure::ConfigData &config_data)
void requestDeviceStatusInColaSession(sick::datastructure::DeviceStatus &device_status)
void requestSerialNumber(const sick::datastructure::CommSettings &settings, sick::datastructure::SerialNumber &serial_number)
SickSafetyscanners(const packetReceivedCallbackFunction &newPacketReceivedCallbackFunction, sick::datastructure::CommSettings *settings, boost::asio::ip::address_v4 interface_ip)
Constructor of the SickSafetyscanners class.
void requestStatusOverview(const datastructure::CommSettings &settings, datastructure::StatusOverview &status_overview)
void processUDPPacket(const sick::datastructure::PacketBuffer &buffer)
Containing the communication settings for the sensor which can be changed on runtime.
Definition: CommSettings.h:48
std::shared_ptr< sick::communication::AsyncUDPClient > m_async_udp_client_ptr
Class containing the firmware version of a laser scanner.
void requestConfigMetadataInColaSession(sick::datastructure::ConfigMetadata &config_metadata)
void changeSensorSettings(const sick::datastructure::CommSettings &settings)
Changes the internal settings of the sensor.
void requestOrderNumberInColaSession(sick::datastructure::OrderNumber &order_number)
void requestFirmwareVersion(const sick::datastructure::CommSettings &settings, sick::datastructure::FirmwareVersion &firmware_version)
Class containing the device name of a laser scanner.
Definition: DeviceName.h:47
void requestFirmwareVersionInColaSession(sick::datastructure::FirmwareVersion &firmware_version)
Class managing the algorithmic part of the package.
void requestProjectNameInColaSession(sick::datastructure::ProjectName &project_name)
void startTCPConnection(const sick::datastructure::CommSettings &settings)
void requestDeviceStatus(const datastructure::CommSettings &settings, datastructure::DeviceStatus &device_status)
void requestApplicationName(const sick::datastructure::CommSettings &settings, sick::datastructure::ApplicationName &application_name)
void FindSensor(const datastructure::CommSettings &settings, uint16_t blink_time)
std::shared_ptr< boost::asio::io_service::work > m_io_work_ptr
bool run()
Start the connection to the sensor and enables output.
void requestSerialNumberInColaSession(sick::datastructure::SerialNumber &serial_number)
std::shared_ptr< sick::cola2::Cola2Session > m_session_ptr
void requestProjectName(const datastructure::CommSettings &settings, datastructure::ProjectName &project_name)
Class containing the device status of a laser scanner.
Definition: DeviceStatus.h:47
Config data for current and persistent sensor config.
Definition: ConfigData.h:50
void requestPersistentConfig(const datastructure::CommSettings &settings, sick::datastructure::ConfigData &config_data)
Requests the persistent configuration from the sensor.
void requestRequiredUserActionInColaSession(sick::datastructure::RequiredUserAction &required_user_action)
Class containing the order number of a laser scanner.
Definition: OrderNumber.h:47
void requestTypeCode(const sick::datastructure::CommSettings &settings, sick::datastructure::TypeCode &type_code)
Requests the typecode of the sensor.
Class containing the serial number of a laser scanner.
void requestConfigMetadata(const datastructure::CommSettings &settings, datastructure::ConfigMetadata &config_metadata)
void requestFieldDataInColaSession(std::vector< sick::datastructure::FieldData > &fields)
Class containing the project name of a laser scanner.
Definition: ProjectName.h:47
packetReceivedCallbackFunction m_newPacketReceivedCallbackFunction
void requestUserName(const datastructure::CommSettings &settings, datastructure::UserName &user_name)
std::shared_ptr< boost::asio::io_service > m_io_service_ptr
virtual ~SickSafetyscanners()
Destructor.
void requestDeviceName(const sick::datastructure::CommSettings &settings, datastructure::DeviceName &device_name)
Requests the name of the device from the sensor.
void requestMonitoringCaseDataInColaSession(std::vector< sick::datastructure::MonitoringCaseData > &monitoring_cases)
void processTCPPacket(const sick::datastructure::PacketBuffer &buffer)
void requestStatusOverviewInColaSession(sick::datastructure::StatusOverview &status_overview)
Class containing the type code of a laser scanner.
Definition: TypeCode.h:62
void requestDeviceNameInColaSession(datastructure::DeviceName &device_name)
boost::scoped_ptr< boost::thread > m_udp_client_thread_ptr
Class containing the serial number of a laser scanner.
Definition: SerialNumber.h:47
void requestRequiredUserAction(const datastructure::CommSettings &settings, datastructure::RequiredUserAction &required_user_action)
std::shared_ptr< sick::data_processing::UDPPacketMerger > m_packet_merger_ptr
Class containing the additional information about the sopas state.
void requestTypeCodeInColaSession(sick::datastructure::TypeCode &type_code)
Class containing the application name of a laser scanner.
std::shared_ptr< sick::communication::AsyncTCPClient > m_async_tcp_client_ptr
boost::function< void(const sick::datastructure::Data &)> packetReceivedCallbackFunction
void requestApplicationNameInColaSession(sick::datastructure::ApplicationName &application_name)


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41