0
$\begingroup$

Rosanswers logo

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.

image description

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.

image description

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.

image description

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.60449e-05
m_count 0
Registering First Scan

---- Launch file---------------

<launch>   
  <arg name="set_base_frame" default="base_footprint"/>
  <arg name="set_odom_frame" default="odom"/>
  <arg name="set_map_frame"  default="map"/>
  <arg name="laser_topic" default="scan_filtered_merged"/>
  <param name="use_sim_time" value="false"/>

  <node pkg="gmapping" type="slam_gmapping" name="agv_slam_gmapping" output="screen">
    <param name="base_frame" value="$(arg set_base_frame)"/>
    <param name="odom_frame" value="$(arg set_odom_frame)"/>
    <param name="map_frame"  value="$(arg set_map_frame)"/>
    <rosparam command="load" file="$(find agv_slam)/config/gmapping_params.yaml" />
    <remap from="scan" to="$(arg laser_topic)"/>
  </node>
</launch>

---- Yaml file---------------

map_update_interval: 2.0
maxUrange: 3.0
sigma: 0.05
kernelSize: 1
lstep: 0.05
astep: 0.05
iterations: 5
lsigma: 0.075
ogain: 3.0
lskip: 0
minimumScore: 50
srr: 0.1
srt: 0.2
str: 0.1
stt: 0.2
linearUpdate: 1.0
angularUpdate: 0.2
temporalUpdate: 0.5
resampleThreshold: 0.5
particles: 100
xmin: -10.0
ymin: -10.0
xmax: 10.0
ymax: 10.0
delta: 0.05
llsamplerange: 0.01
llsamplestep: 0.01
lasamplerange: 0.005
lasamplestep: 0.005

And after moving the robot forward and rotating it in place (as depicted by the red arrows in the images which represent my odometry data) the map just does not update. I added the images below and the gmapping logs.

image description

image description

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.60449e-05
m_count 0
Registering First Scan



update frame 8896
update ld=1.00185 ad=0.0358327
Laser Pose= 1.00149 0.00259294 0.00403892
m_count 1
Average Scan Matching Score=173.695
neff= 99.9925
Registering Scans:Done
update frame 9628
update ld=0.0702066 ad=0.403295
Laser Pose= 1.06788 0.00339194 -0.386777
m_count 2
Average Scan Matching Score=235.891
neff= 94.1993
Registering Scans:Done
update frame 9637
update ld=0.000188488 ad=0.218856
Laser Pose= 1.06782 0.00341401 -0.16792
m_count 3
Average Scan Matching Score=268.64
neff= 93.9851
Registering Scans:Done
update frame 9646
update ld=0.00041867 ad=0.218178
Laser Pose= 1.06802 0.0033838 0.0502573
m_count 4
Average Scan Matching Score=335.142
neff= 93.5213
Registering Scans:Done
update frame 9655
update ld=0.000408412 ad=0.216991
Laser Pose= 1.0681 0.00337042 0.267248
m_count 5
Average Scan Matching Score=341.813
neff= 93.4637
Registering Scans:Done
update frame 9664
update ld=0.000241672 ad=0.218416
Laser Pose= 1.06815 0.00339074 0.485664
m_count 6
Average Scan Matching Score=325.331
neff= 93.4803
Registering Scans:Done
update frame 9673
update ld=0.000230221 ad=0.218762
Laser Pose= 1.06816 0.0034095 0.704426
m_count 7
Average Scan Matching Score=315.016
neff= 93.469
Registering Scans:Done

I did not post any data with regards to AMCL/GMCL because I believe that the issue is probably the same. But please help me find a fix and verify if it can also work with AMCL/GMCL. I would really love to make this work with 2 LiDARs. Thanks so much for your help.


Originally posted by Orl on ROS Answers with karma: 36 on 2022-06-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Here's the solution. Don't use ira_laser_tools package. Use laserscan_merger instead which is over here : https://github.com/robotics-upo/laserscan_merger


Originally posted by Orl with karma: 36 on 2022-06-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.