Robotics StackExchange | Archived questions

Slam Toolbox, mapping of open zone

Greetings,

Hello,

I am currently working on a mapping project using a Turtlebot3 equipped with a LiDAR sensor. I am using the SLAM Toolbox for mapping. However, I have encountered a problem where the map does not update when the LiDAR sensor does not detect any obstacles, i.e., it's not mapping free space.

Here are the details of my setup:

Robot: Turtlebot3 Sensor: LiDAR with a maximum range of 6.5 meters Software: SLAM Toolbox (latest version)

Here's my SLAM Toolbox configuration:

 tb3_0/slam_toolbox: 
   ros__parameters:

# Plugin params
solver_plugin: solver_plugins::CeresSolver
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
ceres_preconditioner: SCHUR_JACOBI
ceres_trust_strategy: LEVENBERG_MARQUARDT
ceres_dogleg_type: TRADITIONAL_DOGLEG
ceres_loss_function: None

# ROS Parameters
odom_frame: tb3_0/odom
map_frame: tb3_0/odom
base_frame: tb3_0/base_footprint
scan_topic: /tb3_0/scan_unfiltered 
mode: mapping #localization

# if you'd like to immediately start continuing a map at a given pose
# or at the dock, but they are mutually exclusive, if pose is given
# will use pose
#map_file_name: test_steve
# map_start_pose: [0.0, 0.0, 0.0]
#map_start_at_dock: true

debug_logging: true
throttle_scans: 1
transform_publish_period: 0.00 #if 0 never publishes odometry
map_update_interval: 5.0
resolution: 0.05
max_laser_range: 6.5 #for rastering images
minimum_time_interval: 0.5
transform_timeout: 0.2
tf_buffer_duration: 30.
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps
enable_interactive_mode: true

# General Parameters
use_scan_matching: true
use_scan_barycenter: true
minimum_travel_distance: 0.5
minimum_travel_heading: 0.5
scan_buffer_size: 10
scan_buffer_maximum_scan_distance: 10.0
link_match_minimum_response_fine: 0.1  
link_scan_maximum_distance: 1.5
loop_search_maximum_distance: 3.0
do_loop_closing: true 
loop_match_minimum_chain_size: 10           
loop_match_maximum_variance_coarse: 3.0  
loop_match_minimum_response_coarse: 0.35    
loop_match_minimum_response_fine: 0.45

# Correlation Parameters - Correlation Parameters
correlation_search_space_dimension: 0.5
correlation_search_space_resolution: 0.01
correlation_search_space_smear_deviation: 0.1 

# Correlation Parameters - Loop Closure Parameters
loop_search_space_dimension: 8.0
loop_search_space_resolution: 0.05
loop_search_space_smear_deviation: 0.03

# Scan Matcher Parameters
distance_variance_penalty: 0.5      
angle_variance_penalty: 1.0    

fine_search_angle_offset: 0.00349     
coarse_search_angle_offset: 0.349   
coarse_angle_resolution: 0.0349        
minimum_angle_penalty: 0.9
minimum_distance_penalty: 0.5
use_response_expansion: true

From what I understand, the maxlaserrange parameter in the SLAM configuration is set to match the maximum range of the LiDAR sensor. The problem occurs when the robot is in an open space where there are no obstacles within the LiDAR's range. In this case, the map does not update to reflect the free space.

Is there a specific setting or configuration that needs to be adjusted for the SLAM Toolbox to map free space when the LiDAR sensor does not detect any obstacles? Any help or advice would be greatly appreciated.

Thank you in advance for your time and assistance.

Asked by Mechaick on 2023-07-31 04:23:32 UTC

Comments

Answers

Hi ,

I do not know exactly how this is handled with SLAM toolbox ; But it seems to me that , usually, free space is filled in as free space in the occupancy map only when there is a hit behind the free space;

It is usually considered that this is more reliable than filling in as free space even if there is no hit. As you said, it may make sense to fill in the max_laser_range as free space. But because there is no hit, the library may not integrate that as a reliable observation that the space is free.

It might be for example that you get no hit because your laser diverged from the target;

It seems to me, looking into the OccupancyGrid filling code of slam_toolbox (https://github.com/SteveMacenski/slam_toolbox/blob/912703c43b7a640303b1b5fc62f05d53fae9cf57/lib/karto_sdk/include/karto_sdk/Karto.h#L6167-L6178) that a point is integrated only if there is a hit and this hit is in the range of your sensor :

if (rangeReading <= minRange || rangeReading >= maxRange || std::isnan(rangeReading)) {
    // ignore these readings
    pointIndex++;
    continue;
} else if (rangeReading >= rangeThreshold) {
    // trace up to range reading
    kt_double ratio = rangeThreshold / rangeReading;
    kt_double dx = point.GetX() - scanPosition.GetX();
    kt_double dy = point.GetY() - scanPosition.GetY();
    point.SetX(scanPosition.GetX() + ratio * dx);
    point.SetY(scanPosition.GetY() + ratio * dy);
}

Asked by Jeremy Fix on 2023-08-02 02:32:49 UTC

Comments

I see, thank you for the broader explanation, However I'm wondering if there could be a parameter to allow such possibility. Especially in cases like mines where the robot is expected to explore a large zone with little features.

Asked by Mechaick on 2023-08-02 03:08:07 UTC

It seems to me that slam_toolbox does not allow this.

Asked by Jeremy Fix on 2023-08-02 13:24:23 UTC