How to make ira_laser_tools work with AMCL/GMCL and GMapping ? [closed]
I am currently on ROS Noetic Ubuntu 20.04 LTS. I am not doing this in simulation, although I believe you will run into the same problem if done in simulation. The problem is that GMapping or AMCL/GMCL does not work normally with the merged laser scans produced by ira_laser_tools. Note that I do not meet this issue when simply using one LiDAR. This issue occurs after merging with ira_laser_tools.
I have two hokuyo urg-04lx-ug01 LiDARs. One is attached in front of my robot and the second behind it. Below in the image, the green represents the front LiDAR and the red represents the back LiDAR.
And in the image below, the white represents the merged Laser scan data. I used the ira_laser_tools to this. The name of the merged scan topic is scan_filtered_merged, despite its name, there is no filtering being done to it.
This is what my launch file looks like
<launch>
<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
<param name="destination_frame" value="base_footprint"/>
<param name="scan_destination_topic" value="/scan_filtered_merged"/>
<param name="laserscan_topics" value ="/scan_front /scan_back" />
<param name="angle_min" value="-3.141588"/>
<param name="angle_max" value="3.141588"/>
</node>
</launch>
Now when I start GMapping, the first laser scan seems to work to create the map, but all other subsequent laser scans do not update or extend the map, even after turning or moving the robot for very large distances. This is what it looks like. I also put the log message from GMapping and my launch file.
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://127.0.0.1:39207/
SUMMARY
========
PARAMETERS
* /agv_slam_gmapping/angularUpdate: 0.2
* /agv_slam_gmapping/astep: 0.05
* /agv_slam_gmapping/base_frame: base_footprint
* /agv_slam_gmapping/delta: 0.05
* /agv_slam_gmapping/iterations: 5
* /agv_slam_gmapping/kernelSize: 1
* /agv_slam_gmapping/lasamplerange: 0.005
* /agv_slam_gmapping/lasamplestep: 0.005
* /agv_slam_gmapping/linearUpdate: 1.0
* /agv_slam_gmapping/llsamplerange: 0.01
* /agv_slam_gmapping/llsamplestep: 0.01
* /agv_slam_gmapping/lsigma: 0.075
* /agv_slam_gmapping/lskip: 0
* /agv_slam_gmapping/lstep: 0.05
* /agv_slam_gmapping/map_frame: map
* /agv_slam_gmapping/map_update_interval: 2.0
* /agv_slam_gmapping/maxUrange: 3.0
* /agv_slam_gmapping/minimumScore: 50
* /agv_slam_gmapping/odom_frame: odom
* /agv_slam_gmapping/ogain: 3.0
* /agv_slam_gmapping/particles: 100
* /agv_slam_gmapping/resampleThreshold: 0.5
* /agv_slam_gmapping/sigma: 0.05
* /agv_slam_gmapping/srr: 0.1
* /agv_slam_gmapping/srt: 0.2
* /agv_slam_gmapping/str: 0.1
* /agv_slam_gmapping/stt: 0.2
* /agv_slam_gmapping/temporalUpdate: 0.5
* /agv_slam_gmapping/xmax: 10.0
* /agv_slam_gmapping/xmin: -10.0
* /agv_slam_gmapping/ymax: 10.0
* /agv_slam_gmapping/ymin: -10.0
* /rosdistro: noetic
* /rosversion: 1.15.14
* /use_sim_time: False
NODES
/
agv_slam_gmapping (gmapping/slam_gmapping)
ROS_MASTER_URI=http://localhost:11311
process[agv_slam_gmapping-1]: started with pid [10607]
[ INFO] [1655887974.042633926]: Laser is mounted upwards.
-maxUrange 3 -maxUrange 24.99 -sigma 0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
-srr 0.1 -srt 0.2 -str 0.1 -stt 0.2
-linearUpdate 1 -angularUpdate 0.2 -resampleThreshold 0.5
-xmin -10 -xmax 10 -ymin -10 -ymax 10 -delta 0.05 -particles 100
[ INFO] [1655887974.047152824]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 2.09378e-05 4.02459e-09 -9 ...