Documentation Status

laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

Package Summary

Released Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Released Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Released Continuous integration Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

  • Maintainer status: maintained
  • Maintainer: Dave Hershberger <dave.hershberger AT sri DOT com>, William Woodall <william AT osrfoundation DOT org>
  • Author: Tully Foote, Radu Bogdan Rusu
  • License: BSD
  • Source: git https://github.com/ros-perception/laser_geometry.git (branch: indigo-devel)
laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Released Continuous integration Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

  • Maintainer status: maintained
  • Maintainer: Dave Hershberger <dave.hershberger AT sri DOT com>, William Woodall <william AT osrfoundation DOT org>
  • Author: Tully Foote, Radu Bogdan Rusu
  • License: BSD
  • Source: git https://github.com/ros-perception/laser_geometry.git (branch: indigo-devel)
laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Released Continuous integration Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

  • Maintainer status: maintained
  • Maintainer: Dave Hershberger <dave.hershberger AT sri DOT com>, William Woodall <william AT osrfoundation DOT org>
  • Author: Tully Foote, Radu Bogdan Rusu
  • License: BSD
  • Source: git https://github.com/ros-perception/laser_geometry.git (branch: indigo-devel)
laser_pipeline: laser_assembler | laser_filters | laser_geometry

Package Summary

Released Continuous integration Documented

This package contains a class for converting from a 2D laser scan as defined by sensor_msgs/LaserScan into a point cloud as defined by sensor_msgs/PointCloud or sensor_msgs/PointCloud2. In particular, it contains functionality to account for the skew resulting from moving robots or tilting laser scanners.

  • Maintainer status: maintained
  • Maintainer: Dave Hershberger <dave.hershberger AT sri DOT com>, William Woodall <william AT osrfoundation DOT org>
  • Author: Tully Foote, Radu Bogdan Rusu
  • License: BSD
  • Source: git https://github.com/ros-perception/laser_geometry.git (branch: indigo-devel)

Overview

The laser_geometry package contains a single C++ class: LaserProjection. There is no ROS API.

This class has two relevant functions for transforming from sensor_msgs/LaserScan to sensor_msgs/PointCloud or sensor_msgs/PointCloud2.

  • projectLaser() is simple and fast. It does not change the frame of your data.

  • transformLaserScanToPointCloud() is slower but more precise. It makes uses of tf and the sensor_msgs/LaserScan time increment to transform each individual ray appropriately. This is the recommended means of transformation for tilting laser scanners or moving robots.

Both of these functions have a final optional argument that augments the sensor_msgs/PointCloud which is created to include extra channels. These channels may include intensities, distances, timestamps, the index or thew viewpoint from the original laser array.

There is a simple Python implementation here (https://github.com/ros-perception/laser_geometry/blob/indigo-devel/src/laser_geometry/laser_geometry.py).

C++ Usage

Simple projection

The method projectLaser() does the simplest possible projection of the laser. Each ray is simply projected out along the appropriate angle according to:

  • \begin{eqnarray*}
\left(\begin{array}{c}x\\y\\z\end{array}\right) & = & \left(\begin{array}{c}r \cos \theta\\r \sin \theta \\ 0\end{array}\right)
\end{eqnarray*}

The appropriate sine and cosine values are cached, making this a very efficient operation. However, the generated sensor_msgs/PointCloud is in the same frame as the original sensor_msgs/LaserScan. While this has the advantage that it does not require an instance of a tf::transformer or message notifier, it does not hold up in situations where the laser is moving and skew needs to be accounted for.

Please consult the API Documentation for full usage details.

Example: To convert a sensor_msgs/LaserScan to a sensor_msgs/PointCloud

  •    1 laser_geometry::LaserProjection projector_;
       2 
       3 void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
       4 {
       5   sensor_msgs::PointCloud cloud;
       6   projector_.projectLaser(*scan_in, cloud);
       7 
       8   // Do something with cloud.
       9 }
    

High fidelity projection

The transformLaserScanToPointCloud() method does a more advanced projection, but requires that you have set up a tf transform listener. (If you are unfamiliar with tf, it is recommended you go through the tf/Tutorials first.)

Since we are gathering data across the time of the scan, it is often important that the chosen target_frame is actually a fixed frame.

Because the stamp of a sensor_msgs/LaserScan is the time of the first measurement, one cannot simply wait for a transform to target_frame at this stamp. Instead one also has to wait for a transform at the last measurement of the scan.

Please consult the API Documentation for full usage details.

Example: To convert a sensor_msgs/LaserScan to a sensor_msgs/PointCloud in the base_link frame, using a high fidelity transform:

  •    1 laser_geometry::LaserProjection projector_;
       2 tf::TransformListener listener_;
       3 
       4 void scanCallback (const sensor_msgs::LaserScan::ConstPtr& scan_in)
       5 {
       6   if(!listener_.waitForTransform(
       7         scan_in->header.frame_id,
       8         "/base_link",
       9         scan_in->header.stamp + ros::Duration().fromSec(scan_in->ranges.size()*scan_in->time_increment),
      10         ros::Duration(1.0))){
      11      return;
      12   }
      13 
      14   sensor_msgs::PointCloud cloud;
      15   projector_.transformLaserScanToPointCloud("/base_link",*scan_in,
      16           cloud,listener_);
      17 
      18   // Do something with cloud.
      19 }
    

Python Usage

Not yet available.

Wiki: laser_geometry (last edited 2015-05-11 10:05:10 by JochenSprickerhof)