Skip to content

dillenberger/pepperl_fuchs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pepperl+Fuchs R2000 Driver

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:https://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:https://www.ros.org), which can be used optionally.

Usage with ROS

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.

Published Topics

  • scan (sensor_msgs/Laserscan) A standard ROS Laserscan message containing the measured data. The message rate per second depends on the scan_frequency parameter.

Parameters

  • frame_id The frame-ID in the Header of the published sensor_msgs/Laserscan2 messages
  • scanner_ip IP or hostname of the laserscanner
  • scan_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.

Quick Start

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:https://wiki.ros.org/rviz) and the driver and you should see the measuring output of the scanner.

Basic usage without ROS

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();
}