0
$\begingroup$

It’s sometimes really frustrating. I used slam for a really big map and suddenly it didn’t scan the map correctly. So I had to start again. Yesterday i spended 30 min (the map is really big) and suddenly it duplicated the corridor 🙄 I reconized that it failed at the same place.

First try (picture): cooridor duplicated https://i.imgur.com/zb6wbuj.jpg

Second try(picture): robot supposed to be at the left not at the right (wrong position) https://i.imgur.com/aXEUqPS.jpg

Loop closure don’t work properly? https://i.imgur.com/zuLt32c.jpg

My Problem:

Everytime i tried to close the loop , the map shifting. I also tried cartographer but its also not working.

Here are my parameters(config file):

  slam_toolbox:
  ros__parameters:

    # Plugin params
    solver_plugin: solver_plugins::CeresSolver # solver_plugins::G2oSolver, solver_plugins::SpaSolver, solver_plugins::CeresSolver
    ceres_linear_solver: SPARSE_NORMAL_CHOLESKY # ITERATIVE_SCHUR, SPARSE_SCHUR, SPARSE_NORMAL_CHOLESKY
    ceres_preconditioner: JACOBI # IDENTITY, JACOBI, SCHUR_JACOBI
    ceres_trust_strategy: DOGLEG # LEVENBERG_MARQUARDT, DOGLEG
    ceres_dogleg_type: SUBSPACE_DOGLEG # TRADITIONAL_DOGLEG, SUBSPACE_DOGLEG
    ceres_loss_function: HuberLoss # None, HuberLoss, CauchyLoss

    # ROS Parameters
    odom_frame: odom
    map_frame: map
    base_frame: base_footprint
    scan_topic: /scan
    mode: mapping # 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.01 #if 0 never publishes odometry
    map_update_interval: 1.0
    resolution: 0.04
    max_laser_range: 10.0 #for rastering images
    minimum_time_interval: 0.01
    transform_timeout: 0.1
    tf_buffer_duration: 10.0
    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.2
    minimum_travel_heading: 0.2
    scan_buffer_size: 25
    scan_buffer_maximum_scan_distance: 5.0
    link_match_minimum_response_fine: 0.1  
    link_scan_maximum_distance: 0.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: 2.7
    correlation_search_space_resolution: 0.0125
    correlation_search_space_smear_deviation: 0.01 

    # 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: 0.01  

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

After these parameters didn't worked out fo me i tried to change some of them but unfortuneately it still not working:

slam_toolbox:
  ros__parameters:

    # Plugin params
    solver_plugin: solver_plugins::CeresSolver # solver_plugins::G2oSolver, solver_plugins::SpaSolver, solver_plugins::CeresSolver
    ceres_linear_solver: SPARSE_NORMAL_CHOLESKY # ITERATIVE_SCHUR, SPARSE_SCHUR, SPARSE_NORMAL_CHOLESKY
    ceres_preconditioner: JACOBI # IDENTITY, JACOBI, SCHUR_JACOBI
    ceres_trust_strategy: DOGLEG # LEVENBERG_MARQUARDT, DOGLEG
    ceres_dogleg_type: SUBSPACE_DOGLEG # TRADITIONAL_DOGLEG, SUBSPACE_DOGLEG
    ceres_loss_function: HuberLoss # None, HuberLoss, CauchyLoss

    # ROS Parameters
    odom_frame: odom
    map_frame: map
    base_frame: base_footprint
    scan_topic: /scan
    mode: mapping # 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.01 #if 0 never publishes odometry
    transform_publish_period: 0.02
    #map_update_interval: 1.0
    map_update_interval: 5.0
    #resolution: 0.04
    resolution: 0.05
    #max_laser_range: 10.0 #for rastering images
    max_laser_range: 45.0
    #minimum_time_interval: 0.01
    minimum_time_interval: 0.5
    #transform_timeout: 0.1
    transform_timeout: 0.2
    #tf_buffer_duration: 10.0
    tf_buffer_duration: 30.0
    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.2
    minimum_travel_heading: 0.2
    #scan_buffer_size: 25
    scan_buffer_size: 10
    #scan_buffer_maximum_scan_distance: 5.0
    scan_buffer_maximum_scan_distance: 10.0
    link_match_minimum_response_fine: 0.1  
    #link_scan_maximum_distance: 0.5
    link_scan_maximum_distance: 1.5
    do_loop_closing: false 
    #loop_match_minimum_chain_size: 10  
    loop_match_minimum_chain_size: 3          
    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: 2.7
    correlation_search_space_dimension: 0.5
    correlation_search_space_resolution: 0.0125
    #correlation_search_space_smear_deviation: 0.01 
    correlation_search_space_smear_deviation: 0.1

    # Correlation Parameters - Loop Closure Parameters
    #loop_search_space_dimension: 8.0
    loop_search_space_dimension: 7.0
    loop_search_space_resolution: 0.05
    loop_search_space_smear_deviation: 0.03
    #loop_search_maximum_distance: 3.0
    loop_search_maximum_distance: 5.0

    # Scan Matcher Parameters
    distance_variance_penalty: 0.5      
    angle_variance_penalty: 0.01  
    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.01
    minimum_angle_penalty: 0.9
    minimum_distance_penalty: 0.5
    use_response_expansion: true

Thank you for you attention and your time !

$\endgroup$
5
  • 1
    $\begingroup$ Welcome to Robotics Rosie, but I'm afraid that it is not clear what you are asking. We prefer practical, answerable questions, so it's a good idea to include details of what you want to understand, what you've researched so far, what you found & what you expected to find. Please take a look at How to Ask & tour for more information on how stack exchange works and work through the Robotics question checklist to edit your question to make it clearer what your question is. $\endgroup$
    – Tully
    Sep 9, 2023 at 17:55
  • $\begingroup$ I presume you use slam on a real life robot or is it simulaties in gazebo? How accurate is your odom source? $\endgroup$
    – Nobel
    Sep 10, 2023 at 17:21
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Sep 10, 2023 at 21:58
  • $\begingroup$ It looks like you may have accidentally created two accounts (Rosie & ChangeNAL). Stack Exchange only allows an individual to actively use one account, so please follow the instructions at I accidentally created two accounts; how do I merge them? Note that moderators can't merge accounts for you, but may delete accounts they believe to be sock puppets. $\endgroup$
    – Chuck
    Sep 12, 2023 at 14:47
  • $\begingroup$ Ups, sorry for the inconvenience :/ . Can you delete this account ? (I’m unregistered with this account. I used it on my phone and didn’t recognise that $\endgroup$
    – Rosie
    Sep 15, 2023 at 20:44

2 Answers 2

0
$\begingroup$

I'm putting it here because I can't comment. These are a few things I'd check.

  1. How much do you trust your odometry? I would check it in Rviz to see whether it's accurate and where the robot and /pose is compared to it.
  2. What is publishing odometry and what is its source (world or encoder)?
  3. Does your robot teleport for any reason?

I see you have tried changing your max laser range between files. As far as I understand that should be the max range of your lidar (which is in the model sdf file).

I hope that helps.

$\endgroup$
0
$\begingroup$

I finally fixed it by increasing some parameters. Thank you so much for your answers ✌️

Edit: I increased the loop search maximum distance: 10000

$\endgroup$
1
  • 1
    $\begingroup$ What parameters? It's great that you found a solution, but some folks who encounter the same problem will likely find this question when they try searching for solutions. By editing this comment to add more detail, we can help those folks out! $\endgroup$
    – cst0
    Sep 12, 2023 at 0:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.