Slam_toolbox map messy

Hi

I am using slam_toolbox and got it running with ROSbot XL. Now I’m getting the following map. It’s messy. The room is a rectangular one. The map looks like having copies of the room. Can you point me why this is the case although I haven’t investigated further yet.

Here’s my config:

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: odom
    map_frame: map
    base_frame: base_link
    scan_topic: /scan_filtered
    use_map_saver: true
    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: false
    throttle_scans: 1
    transform_publish_period: 0.02 #if 0 never publishes odometry
    map_update_interval: 2.0 #5.0
    resolution: 0.04 #0.05
    max_laser_range: 12.0 #20.0 #for rastering images
    minimum_time_interval: 0.1 #0.5
    transform_timeout: 0.2
    tf_buffer_duration: 20.0 #30.0
    stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps
    enable_interactive_mode: false #true

    # General Parameters
    use_scan_matching: true
    use_scan_barycenter: true
    minimum_travel_distance: 0.3 #0.5
    minimum_travel_heading: 0.5
    scan_buffer_size: 10
    scan_buffer_maximum_scan_distance: 7.0 #10.0
    link_match_minimum_response_fine: 0.1
    link_scan_maximum_distance: 1.0 #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

Here’s my TF.

Hello @Dhon_G,

I can’t diagnose what happened based on the photos.

Map creation is a process that takes time. Evaluating the final result without visualizing the map creation process is incomplete. Furthermore, the current state must be compared with the actual state of the robot.

I’m providing the parameters found in the rosbot-xl-autonomy repository. You can start with this one: rosbot-xl-autonomy/config/nav2_mppi_params.yaml at foxglove · husarion/rosbot-xl-autonomy · GitHub

Additionally, the mapping process is susceptible to irregularities. If the robot hits an obstacle during mapping, or if the mapping is performed on uneven terrain, the algorithm can simply go haywire, as the odometry will diverge from the measurements.

If the robot will be moving in a fixed environment, it’s worth:

  1. Manually map the environment slowly.
  2. Save the map and clean up any artifacts (using a graphics program).
  3. Run nav2 from amcl (without mapping).

Hi @RafalGorecki

Just got it working.

The issue is with the frame_id of the laser scan.
It appears that slam_toolbox is expecting the frame_id to be “laser.” I was using “slamtec_rplidar_link” initially.

Cheers!

1 Like