Slam Toolbox - How is scan data used to build the map?
Hello together,
I set up a simulation environment with Slam Toolbox and navigation2. This all works fine so far, however I am now wondering about how the map is actually being created.
I recognized, that areas where no object gets hit stay unknown (-1) in the occupancy grid map. Whereas the area between minrange and maxrange should be updated as free (0). The simulated laser is providing 360° readings. Beams that hit no object return a range value of infinity and an intensity of zero. Beams that hit an object return the range and an intensity of 400.
This leads to the following map depicted in the picture. A corridor leads to triangles of unknown area. Is this expected behavior? If yes, why? And if not, what could cause this?
Thanks!
Asked by potentialdiffer on 2021-02-15 16:42:09 UTC
Answers
check your mapping parameters ~maxUrange has to be smaller than ~maxrange in order to clear an area where the laser does not hit an obstacle. Depending on your current settings this is an expected behavior.
Asked by AGV5 on 2021-02-15 17:42:34 UTC
Comments
I set my lidar parameter as range_max: 30.0
and the slam toolbox parameter max_laser_range: 10.0
. This should meet the requirements. However, I still have the same effect.
The extreme case would be, that the robot is located in an open area with no obstacles in its line of sight. In this case, slam-toolbox would not update the map with free space, although this information is available. Again, this is just for my current configuration and probably not the expected behavior but changing the range parameters did not solve the problem for me.
Asked by potentialdiffer on 2021-02-16 04:04:01 UTC
So I can set parameters to achieve that when a laser does not meet any obstacles in the detection range, all relevant cells in the detection range are judged to be unoccupied?
Asked by 54GGB on 2023-07-09 16:12:40 UTC
I encountered the same problem today and solved it in simulation in the following way:
I increased the max range of the gazebo laser scan plugin to a higher distance and then went on to change the slam_toolbox max_laser_range to the max range of the laser scan. This lead to the desired behaviour that every scan up until the specified max_laser_range was used to create the map, especially in front of the robot. Unfortunately, this does not solve the problems on a real robot where we still get "inf" as value when the laser scan does not hit anything instead of the max distance. I think there exists a laser scan filter package which I will look into next.
Asked by levers on 2022-03-09 08:34:24 UTC
Comments
I solved the problem by using the laser_filter package. There I used the RangeFilter to edit out all infinite readings like so:
scan_to_scan_filter_chain:
ros__parameters:
#scan_topic: /scan #does not work like that, has to be done via remappings in the launch file
filter1:
name: box_filter
type: laser_filters/LaserScanRangeFilter
params:
use_message_range_limits: false # if not specified defaults to false
lower_threshold: 0.05 # if not specified defaults to 0.0
upper_threshold: 5.8 # if not specified defaults to 100000.0
lower_replacement_value: 0.05 # if not specified defaults to NaN
upper_replacement_value: 5.9 # if not specified defaults to NaN
Then I set slam_toolbox max_range to something below the upper_threshold of scan_filters. That made it work
Asked by levers on 2022-03-24 05:18:46 UTC
Comments