Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file
CONTRIBUTING
Repository Summary
Checkout URI | https://github.com/SICKAG/sick_safetyscanners_base.git |
VCS Type | git |
VCS Version | ros2 |
Last Updated | 2024-08-20 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
sick_safetyscanners_base | 1.0.3 |
README
Sick_Safetyscanners_Base CPP Driver
Table of contents
A CPP standalone Driver which reads the raw data from the SICK Safety Scanners and takes custom functions to publish the data.
Supported Hardware
Supported are all microScan3, nanoScan3 and outdoorScan3 variants with Ethernet connection.
Getting started
The driver will be released on this github repository, and can then be installed from source.
Prerequisites
- Linux
- Correctly setup SICK Safety Scanner
- Connected SICK Safety Scanner and a correctly setup ethernet network. Both the host and the sensor have to be in the same network.
- Installed libboost
Installation
For installation this github repository has to be cloned and afterwards installed. If a custom install directory is wanted use the -DCMAKE_INSTALL_PREFIX option to specify a path.
git clone https://github.com/SICKAG/sick_safetyscanners_base.git
cd sick_safetyscanners_base
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<path to install folder> ..
make -j8
make install
Usage
To use the library in a driver the path of the installation has to be added to the cmake prefix path of your application. You can achieve this by using, bevor invoking cmake on your application.
export CMAKE_PREFIX_PATH=<path to install folder>
Afterwards the driver and the settings for the driver can be included with:
#include <sick_safetyscanners_base/SickSafetyscanners.h>
#include <sick_safetyscanners_base/Exceptions.h>
#include <sick_safetyscanners_base/Types.h>
#include <sick_safetyscanners_base/datastructure/CommSettings.h>
To get the driver up and running you need first to choose between the synchronous and asynchronous APIs based on your needs.
In the latter case you can also pass an instance of boost::asio::io_service to the constructor of the AsyncSickSafetyScanner.
API
Synchronous Client
In cases where you do not want the driver to spawn internal child threads to asynchronously process incomming sensor data you can use the
``` class.
| Function | Information |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| SyncSickSafetyScanner<br>(sick::types::ip_address_t sensor_ip, <br>sick::types::port_t sensor_port, <br>sick::datastructure::CommSettings comm_settings); | Constructor call. |
| bool isDataAvailable(); | Non-blocking call that indicates wheether sensor data is available to fetch via the receive-function from the internal sensor data receiving buffer. |
| const Data receive<br>(sick::types::time_duration_t timeout = boost::posix_time::pos_infin); | Blocking call to receive one sensor data packet at a time. |
Example
// Sensor IP and Port std::string sensor_ip_str = “192.168.1.11”; sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str); sick::types::port_t tcp_port {2122};
// Prepare the CommSettings for Sensor streaming data sick::datastructure::CommSettings comm_settings; std::string host_ip_str = “192.168.1.9”; comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str); comm_settings.host_udp_port = 0;
// Create a sensor instance auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
// Receive one sensor data packet auto timeout = boost::posix_time::seconds(5); sick::datastructure::Data data = safety_scanner->receive(timeout);
// …
```
Asynchronous Client
File truncated at 100 lines see the full file