My team and I are currently working on an autonomous rover. I am using ROS2 iron with Ubuntu 22.04. Our rover is equipped with a RPLIDAR which is publishing on the /scan topic. We use this topic and a git package (https://github.com/dawan0111/Simple-2D-LiDAR-Odometry.git) which is providing us odometry via the /scan_odom topic. All of this as been tested multiple times and is working well. Then we wanted to add the mapping functionalities to our rover. I try using the slam_toolbox package from the great Steve Macenski. I added the mapper_params_online_async.yaml as follow :

    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_footprint
    scan_topic: /scan
    mode: mapping #localization

    # if you'd like to start localizing on bringup in a map and pose
    #map_file_name: test_steve
    #map_start_pose: [5.0, 1.0, 0.0]

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

    # General Parameters
    use_scan_matching: true
    use_scan_barycenter: true
    minimum_travel_distance: 0.5
    minimum_travel_heading: 0.5
    scan_buffer_size: 3
    scan_buffer_maximum_scan_distance: 10.0
    link_match_minimum_response_fine: 0.1  
    link_scan_maximum_distance: 1.5
    do_loop_closing: true 
    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: 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
    loop_search_maximum_distance: 3.0

    # 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

I also added the following node to my launch file in order to launch the slam_toolbox package :

slam = Node(
        parameters=[slam_params_file,{'use_sim_time': use_sim_time}],

When I launch my script it works just as before, the map link and the /map topic have been created but no information is being published on this /map topic (I echoed it), leading Rviz to display "no map received" : Rviz

odometry is still working but I get the error: "[slam_toolbox]: Failed to compute odom pose" : enter image description here

I can provide the tf tree : enter image description here

and also the rqt graph of my nodes : enter image description here

If someone as any idea of how we can overcome this issue we would be very thankfull

  • $\begingroup$ Please paste any code or console output as code formatted text and not as a screenshot. Screenshots are not text searchable, amongst other things... $\endgroup$ Commented Mar 29 at 16:46
  • $\begingroup$ Looking at the source code, that error is generated when trying to tansform odom and baselink. I suspect it has nothing to do with the map. Possible you have two different issues. It is very common for the map issues to be caused by QOS settings and misunderstanding about when the map gets published. I suggest verifying TF names are consistent and evaluation of the source code. github.com/SteveMacenski/slam_toolbox/blob/ros2/include/… $\endgroup$
    – billy
    Commented Mar 31 at 20:16


Your Answer

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

Browse other questions tagged or ask your own question.