43 boost::asio::ip::address_v4 interface_ip)
44 : m_newPacketReceivedCallbackFunction(newPacketReceivedCallbackFunction)
46 ROS_INFO(
"Starting SickSafetyscanners");
50 ROS_INFO(
"Multicast Host Ip configured");
70 ROS_INFO(
"Started SickSafetyscanners");
136 std::vector<sick::datastructure::FieldData>& field_data)
145 std::vector<sick::datastructure::MonitoringCaseData>& monitoring_cases)
242 std::shared_ptr<sick::communication::AsyncTCPClient> async_tcp_client =
243 std::make_shared<sick::communication::AsyncTCPClient>(
248 async_tcp_client->doConnect();
251 m_session_ptr = std::make_shared<sick::cola2::Cola2Session>(async_tcp_client);
260 std::make_shared<sick::cola2::ChangeCommSettingsCommand>(boost::ref(*
m_session_ptr), settings);
265 std::vector<sick::datastructure::FieldData>& fields)
269 for (
int i = 0; i < 128; i++)
273 command_ptr = std::make_shared<sick::cola2::FieldHeaderVariableCommand>(
277 if (field_data.getIsValid())
279 command_ptr = std::make_shared<sick::cola2::FieldGeometryVariableCommand>(
283 fields.push_back(field_data);
293 std::vector<sick::datastructure::MonitoringCaseData>& monitoring_cases)
296 for (
int i = 0; i < 254; i++)
300 command_ptr = std::make_shared<sick::cola2::MonitoringCaseVariableCommand>(
303 if (monitoring_case_data.getIsValid())
305 monitoring_cases.push_back(monitoring_case_data);
317 std::make_shared<sick::cola2::FindMeCommand>(boost::ref(*
m_session_ptr), blink_time);
324 std::make_shared<sick::cola2::DeviceNameVariableCommand>(boost::ref(*
m_session_ptr),
335 std::make_shared<sick::cola2::ApplicationNameVariableCommand>(boost::ref(*
m_session_ptr),
345 std::make_shared<sick::cola2::SerialNumberVariableCommand>(boost::ref(*
m_session_ptr),
355 std::make_shared<sick::cola2::FirmwareVersionVariableCommand>(boost::ref(*
m_session_ptr),
364 std::make_shared<sick::cola2::TypeCodeVariableCommand>(boost::ref(*
m_session_ptr), type_code);
373 std::make_shared<sick::cola2::OrderNumberVariableCommand>(boost::ref(*
m_session_ptr),
383 std::make_shared<sick::cola2::ProjectNameVariableCommand>(boost::ref(*
m_session_ptr),
392 std::make_shared<sick::cola2::UserNameVariableCommand>(boost::ref(*
m_session_ptr), user_name);
401 std::make_shared<sick::cola2::ConfigMetadataVariableCommand>(boost::ref(*
m_session_ptr),
410 std::make_shared<sick::cola2::StatusOverviewVariableCommand>(boost::ref(*
m_session_ptr),
419 std::make_shared<sick::cola2::DeviceStatusVariableCommand>(boost::ref(*
m_session_ptr),
428 std::make_shared<sick::cola2::RequiredUserActionVariableCommand>(boost::ref(*
m_session_ptr),
429 required_user_action);
437 std::make_shared<sick::cola2::MeasurementPersistentConfigVariableCommand>(
void requestOrderNumber(const datastructure::CommSettings &settings, datastructure::OrderNumber &order_number)
void FindSensorInColaSession(uint16_t blink_time)
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.
boost::asio::ip::address_v4 getHostIp() const
Gets the IP-address of the host.
Class containing the user name of a laser scanner.
std::string getProjectName() const
Gets the project name for the scanner.
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.
std::shared_ptr< sick::cola2::Command > CommandPtr
Typedef for a pointer containing a command to be executed.
void changeCommSettingsInColaSession(const datastructure::CommSettings &settings)
void requestPersistentConfigInColaSession(sick::datastructure::ConfigData &config_data)
void requestDeviceStatusInColaSession(sick::datastructure::DeviceStatus &device_status)
std::string getSerialNumber() const
Gets the serial number for the scanner.
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)
Field data for warning and protective fields.
Containing the communication settings for the sensor which can be changed on runtime.
std::shared_ptr< sick::communication::AsyncUDPClient > m_async_udp_client_ptr
The data class containing all data blocks of a measurement.
sick::datastructure::Data parseUDPSequence(const sick::datastructure::PacketBuffer &buffer) const
Parses the udp data transferred in the packet buffer. It will be parsed into the data reference...
Class containing the firmware version of a laser scanner.
void requestConfigMetadataInColaSession(sick::datastructure::ConfigMetadata &config_metadata)
std::string getOrderNumber() const
Gets the order number for the scanner.
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)
std::string getUserName() const
Gets the user name for the scanner.
Parses the udp data packets depending on which data will be received.
Class containing the device name of a laser scanner.
std::string getDeviceName() const
Gets the device name for the scanner.
void requestFirmwareVersionInColaSession(sick::datastructure::FirmwareVersion &firmware_version)
std::string getTypeCode() const
Gets the type code for the scanner.
void requestProjectNameInColaSession(sick::datastructure::ProjectName &project_name)
void startTCPConnection(const sick::datastructure::CommSettings &settings)
void requestDeviceStatus(const datastructure::CommSettings &settings, datastructure::DeviceStatus &device_status)
std::string getApplicationName() const
Gets the application name for the scanner.
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
uint16_t getSensorTcpPort() const
Gets the sensor tcp port.
boost::asio::ip::address_v4 getSensorIp() const
Gets the sensor IP-address.
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.
Config data for current and persistent sensor config.
void setHostUdpPort(const uint16_t &host_udp_port)
Sets the host udp port.
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)
Stores the data for the different monitoring cases.
Class containing the order number of a laser scanner.
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.
packetReceivedCallbackFunction m_newPacketReceivedCallbackFunction
void requestUserName(const datastructure::CommSettings &settings, datastructure::UserName &user_name)
virtual ~SickSafetyscanners()
Destructor.
std::shared_ptr< boost::asio::io_service > m_io_service_ptr
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.
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.
uint16_t getHostUdpPort() const
Gets the host udp port.
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.
std::string getFirmwareVersion() const
Gets the firmware version for the scanner.
void requestTypeCodeInColaSession(sick::datastructure::TypeCode &type_code)
Class containing the application name of a laser scanner.
boost::function< void(const sick::datastructure::Data &)> packetReceivedCallbackFunction
void requestApplicationNameInColaSession(sick::datastructure::ApplicationName &application_name)