This is the Doxygen documentation of a driver for the Pepperl+Fuchs OMD10M-R2000-B23 laser range finder.
The driver is based upon the widespread boost asio library (http://www.boost.org)
The driver comes as a library, which contains the actual driver, and has additionally a ROS-Node interface to the Robot Operating System (http://www.ros.org), which can optionally be used.
The ROS package consists of the driver library and a node named r2000_node
, which is linked to the library. This is the actual driver node.
scan
(sensor_msgs/Laserscan) A standard ROS Laserscan message containing the measured data. The message rate per second depends on the scan_frequency
parameter.frame_id
The frame-ID in the Header of the published sensor_msgs/Laserscan2
messagesscanner_ip
IP or hostname of the laserscannerscan_frequency
The scan frequency (rotation speed of scanner head) in Hz in the range [10;50]samples_per_scan
The number of distances measured per scan/rotation in the range [72;25200]. Only certain values are allowed (see Manual). Examples are 72, 360, 720, 1440, 1800, 3600, 7200, 10080, 25200.Set the IP-Address of the scanner in launch/gui_example.launch
and run the following command:
roslaunch pepperl_fuchs_r2000 gui_example.launch
This starts RViz
(http://wiki.ros.org/rviz) and the driver and you should see the measuring output of the scanner.
The basic usage of the driver library code (C++11 style) is as follows:
#include <pepperl_fuchs_r2000/r2000_driver.h> int main(int argc, char **argv) { bool success; pepperl_fuchs::R2000Driver driver; success = driver.connect("192.168.0.100"); // Replace IP success = driver.setScanFrequency(35); // Set scanner frequency in the range [10;50] success = driver.setSamplesPerScan(3600); // Set samples per scan in the range [72,25200] (valid values are listed in manual) auto params = driver.getParameters(); // Get all parameter values as std::map<string, string> for( auto key_value : params ) { Do something with the parameter values } success = driver.startCapturingUDP(); // Notice: startCapturingTCP() also exists while(true) { pepperl_fuchs::ScanData scandata = driver.getFullScan(); // Do something with: scandata.headers; // headers, scandata.distance_data; // distances and scandata.amplitude_data; // amplitudes } driver.stopCapturing(); driver.disconnect(); }