Size: 4026
Comment:
|
Size: 4078
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 9: | Line 9: |
## note.0= laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData | ## note.0= [[laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData|Introduction to working with laser scanner data]] |
Note: This tutorial assumes that you have completed the previous tutorials: Introduction to working with laser scanner data Laser filtering using nodes. |
![]() |
How to assemble laser scan lines into a composite point cloud
Description: In this tutorial you will learn how to assemble individual laser scan lines into a composite point cloud. One particular use case is to assemble individual scan lines from a laser on a tilting stage into a single point cloud to form a full 3D laser sweep.Keywords: laser, scan, assemble, aggregate, accumulate, point cloud, cloud, laser scanner, hokuyo, sick
Tutorial Level: INTERMEDIATE
Aggregating Scans
All of the examples above have dealt with a single scan line, one returned scan from the laser. In many cases, however, it would be more useful to have multiple scan lines together as a larger point cloud. For example, if the laser is on a tilting unit, it's useful to group together all of the scans that came from one top-to-bottom tilting cycle. Or it might be useful to accumulate a set of scans over a fixed time period. To aggregate scans we look to the laser_assembler package containing the laser_scan_assembler, and the point_cloud_assembler, or for the PR2 the pr2_laser_snapshotter, which interacts with these in a more intelligent way.
The Laser Scan and Point Cloud Assemblers
The laser_scan_assembler and point_cloud_assembler accumulate laser scans or point clouds, respectively. They simply listen to the appropriate topic and accumulate messages in a ring buffer of a specific size. When the build_cloud service is called, the contents of the current buffer are converted into a single cloud and published.
Here is an example launch file for the point_cloud_assembler operating on the scan topic tilt_scan:
<node type="laser_scan_assembler" pkg="laser_assembler" name="my_assembler" output="screen"> <remap from="scan_in" to="tilt_scan"/> <param name="max_scans" type="int" value="400" /> <param name="fixed_frame" type="string" value="base_link" /> </node>
This launches a laser_scan_assembler that listens on the tilt_scan topic. It keeps a rolling buffer of 400 scans, and transforms incoming scans into the base_link frame. The full set of available parameters is available in the laser_assembler's ROS Interface section.
The PR2 Laser Snapshotter
The pr2_laser_snapshotter is a useful utility that generates a cloud every time the tilting stage holding the laser goes through a single sweep. It does this by listening to the laser scanner signal at the top and bottom of the sweep and calling the build_cloud service at the appropriate times.
An example launch file with the necessary topic remappings:
<node type="pr2_laser_snapshotter" pkg="pr2_laser_snapshotter" name="my_snapshotter" output="screen"> <remap from="laser_scanner_signal" to="laser_tilt_controller/laser_scanner_signal"/> <remap from="full_cloud" to="full_cloud_filtered" /> </node>
Try running an assembler and the snapshotter, and then view the resulting point cloud in rviz. Instead of changing line by line, the whole point cloud should update at once.