What node connections do I need for GMapping using two LiDARs?

asked 2020-05-11 10:54:35 -0500

Py gravatar image

Hi all,

I am struggling to get a good quality map using gmapping with a simulated robot in ROS Kinetic. I am paranoid that I don't quite have something connected correctly. This RQT graph shows that the slam_gmapping node has everything it needs to produce a map, however the map is not very good quality and suggests the LiDAR units are looking through features in the simulated environment.

image description

Also, I have two simulated LiDAR units publishing to the /lidar_scan topic. Is this bad practice and maybe causing a problem? What is the best method to use a front and rear facing LiDAR unit?

edit retag flag offensive close merge delete


Regarding the part about 2 lidars: you can use ira_laser_tools package to merge scans from 2 different topics into one.

Thazz gravatar image Thazz  ( 2020-05-15 04:45:25 -0500 )edit

Thanks for this. It certainly seems like this was the problem and ira_laser_tools seems to offer a good solution. I've had a few challenges with this (see this question). Would Google Cartographer be a good alternative to gmapping without needing extra tools for merging laser scans?

Py gravatar image Py  ( 2020-05-16 07:29:42 -0500 )edit

Yes, you can use Cartographer with 2 input scan topics. In lua configuration you need to set num_laser_scans=2 and in you launch file for cartographer scan_1 and scan_2 parameters to your topic names, for example:

<node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory $(find cartographer_ros)/configuration_files
          -configuration_basename revo_lds.lua"
    <remap from="scan_1" to="my_robot/front/scan" />
    <remap from="scan_2" to="my_robot/back/scan" />
Thazz gravatar image Thazz  ( 2020-05-18 02:35:22 -0500 )edit

That’s great! I’ve tried this today and it seems to be working well. Thanks for the help!

Py gravatar image Py  ( 2020-05-18 13:25:46 -0500 )edit

However, the next challenge this leads to is trying to use 2 lasers with the AMCL node. See this question.

Py gravatar image Py  ( 2020-05-19 05:39:17 -0500 )edit