ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Using multiple laser scanners

asked 2011-03-05 05:32:29 -0500

aarons gravatar image

updated 2011-08-14 16:54:47 -0500

kwc gravatar image

What is the best way to use multiple laser scanners on a robot? Currently I have two hokuyo scanners, one facing forward, and one facing backwards. I'd like to do slam as efficiently as possible using data from both scanners.

edit retag flag offensive close merge delete

5 Answers

Sort by » oldest newest most voted

answered 2011-03-05 06:00:42 -0500

updated 2011-03-05 06:01:47 -0500

I don't believe the current slam-gmapping implementation in ROS directly supports laser scans coming from lasers with different frames.

A quick solution: You could try to combine your two 180-deg lasers scans into one 360-deg laser scan. Compute the x-y coordinates from both the laser scans, then calculate the distance from each beam endpoint to a virtual laser scanner, and output the result as a LaserScan.

This would work best if you align your sensors well, ie, exactly 180 degrees apart from each other. Also, try to get the optical centers of the lasers as close as possible. The laser scan structure assumes the angular gap between two scan beams is constant, so hacking two laser scans into one might introduce some distortions in the data. Nevertheless, it will probably be minimal, if you are careful with the settings of your scanners.

Now, for a more correct solution: slam-gmapping (as well as other laser tools, such as canonical_scan_matcher) don't algorithmically require that the input data is in polar coordinates. In fact, they take the (r, theta) readings from the laser, and covert them to (x, y) coordinates internally. What would be best is to rewrite the wrappers to accept (x, y) coordinates directly. Then, you would be able to combine any number of laser scans, regardless of their physical configuration. All you would have to do is convert the LaserScans to PointClouds, and then merge the PointClouds together. You would also be able to use non-laser sources of data (like the Kinect) without having to go through a clunky PointCloud-To-LaserScan conversion.

edit flag offensive delete link more


Unfortunately my scanners are at opposite sides of the robot, about 1m apart. I already hacked together a node that merges the LaserScans into one PointCloud, and was planning to look into modifying slam_gmapping to accept a PointCloud. It looks like I'm on the right path then. Thanks.
aarons gravatar image aarons  ( 2011-03-05 06:17:47 -0500 )edit
Looks like we have two discussions going - on the mailing list and here. We can continue with the details of modifying slam_gmapping on the mailing list.
Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2011-03-05 06:27:02 -0500 )edit

Hi there, would you mind sharing which part of slam_gmapping you hacked? I'm having trouble finding the part where it actually converts LaserScans into x-y coordinates. Thanks in advance!

JunTuck gravatar image JunTuck  ( 2016-05-24 07:44:21 -0500 )edit

answered 2014-03-17 23:34:50 -0500

Huibuh gravatar image

updated 2014-03-17 23:36:48 -0500

What is the latest regarding this? Is there really no established way to use more than one laser scanner together with gmapping? There definitely seems to be a demand for this functionality (several people asking independently on ROS answers, including myself).

"@Brian Gerkey": Considering move_base (which I use in conjunction with gmapping) can handle multiple laser scanners for building its costmaps, it would great if gmapping also could be configured to use more than one laser scanner.

edit flag offensive delete link more


have you managed to do a SLAM with 2 lasers? I've got a Pioneer p3-dx robot, with 2 LMS100 lasers facing back-to-back.. I'd like to do the mapping with them (slam) but no luck so far in connecting the two lasers into one "dummy laser". any help? thanks

Gogo_CRO_FER gravatar image Gogo_CRO_FER  ( 2014-06-24 08:08:50 -0500 )edit

No, unfortunately I have not found a solution to employ 2 lasers simultaneously with gmapping.

Huibuh gravatar image Huibuh  ( 2014-06-26 15:46:52 -0500 )edit

answered 2011-08-11 05:42:43 -0500

Anas gravatar image


I want to do the same thing that you propose, in fact I have 3 laser sensor and I want to combine their data, so I would like to change "slam_gmapping" to accepet "point_cloud", I wanted to know before embarking on, did you managed to get some results ?

I work on the control of a wheelchair at the Polytechnic of Montreal, and I have already managed to build a map from a laser sensor.

Thank you,

edit flag offensive delete link more

answered 2012-03-05 07:19:06 -0500

Manuel gravatar image

Hello all, I also have the same problem. Any luck so far? I found the mailing list thread, but it seems inactive. As long as I couldn't found any solution, I'll try on my own and keep you posted. Comments are welcome.

edit flag offensive delete link more



Last version of slam_gmapping can manage laser scans from different sensors. You just have to publish both laserscans into the same topic. Gmapping handles transformations on its own.

I have used a modified version of stage simulator for ros (from Gonçalo Cabrita) and gmapping to test it. Gmapping maps are built using both simulated lasers, so I guess it is ok.

Manuel gravatar image Manuel  ( 2012-03-05 21:56:44 -0500 )edit

Hi Manuel, I have tried to use both scan from kinect (depthimage_to_laserscan) and hokuyo. But the scan points show on rviz are flickering and switching between both of them. Is it normal?

chao gravatar image chao  ( 2013-12-11 02:13:15 -0500 )edit

I did this for a class project. Gmapping won't in fact accept the data from both. It will latch onto the transform used in the first scan it receives, and then will only accept data from the same transform.

Icehawk101 gravatar image Icehawk101  ( 2014-01-06 07:36:08 -0500 )edit

answered 2020-03-11 00:44:35 -0500

Rufus gravatar image

iralabdisco's ira_laser_tools provides a laserscan merger which does what you want.

It is based on converting the scans to pointcloud and merging the pointcloud

edit flag offensive delete link more

Question Tools



Asked: 2011-03-05 05:32:29 -0500

Seen: 7,418 times

Last updated: Mar 11 '20