What node connections do I need for GMapping using two LiDARs?
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.
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?
Regarding the part about 2 lidars: you can use ira_laser_tools package to merge scans from 2 different topics into one.
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?
Yes, you can use Cartographer with 2 input scan topics. In
lua
configuration you need to setnum_laser_scans=2
and in you launch file for cartographerscan_1
andscan_2
parameters to your topic names, for example:That’s great! I’ve tried this today and it seems to be working well. Thanks for the help!
However, the next challenge this leads to is trying to use 2 lasers with the AMCL node. See this question.