Rosanswers logo


A project I am working on involves the use of a mobile robot in an open field using move_base to navigate autonomously and avoiding obstacles.

The obstacles in the costmaps only get cleared with raytracing when an obstacle further away is detected. This is a problem for me since most of the time there is no other obstacle that the sensor can see. For example, if someone were to walk in front of the robot, he would leave a trail in the costmap that never gets cleared because there is nothing behind it.

Does anyone know of a solution to this problem?



Here are my configuration files for the costmaps

Common parameters: obstacle_range: 3.0 raytrace_range: 3.5

robot_base_frame: base_footprint
update_frequency: 4.0
publish_frequency: 4.0
transform_tolerance: 0.5

footprint: [[-0.17, -0.18], [-0.17, 0.22], [0.17, 0.22], [0.17, -0.18]]
footprint_padding: 0.0

resolution: 0.05

   map_topic: /map

    observation_sources: laser
    laser: {data_type: LaserScan, topic: /scan, clearing: true, marking: true, inf_is_valid: false, track_unknown_space: true} 

    cost_scaling_factor: 2
    inflation_radius: 1

Global parameters:

global_frame: map

rolling_window: true

  - {name: static_layer,              type: "costmap_2d::StaticLayer"}
  - {name: inflation_layer,           type: "costmap_2d::InflationLayer"}

Local parameters:

global_frame: odom

rolling_window: true
width: 3
height: 3
  - {name: obstacle_layer,            type: "costmap_2d::ObstacleLayer"}
  - {name: inflation_layer,           type: "costmap_2d::InflationLayer"}

Originally posted by JeremieBourque on ROS Answers with karma: 95 on 2021-11-13

Post score: 0

Original comments

Comment by Dragonslayer on 2021-11-13:
Could you please post the config .yaml files. Is clearing even activated (In obstacle layer marking: true, clearing: true)? Otherwise maybe this

Comment by JeremieBourque on 2021-11-15:
Hi, I have updated my question with my parameters. I will also check the link in your comment, thank you.

Comment by Dragonslayer on 2021-11-15:
In your obstacle_layer "inf_is_valid: false" The docs say "Are infinite returns from laser scanners valid measurements to raycast." Would be worth a try to set it to true.

Comment by JeremieBourque on 2021-11-15:
Yes that worked for me, thank you! Would you post it as an answer so I can mark it as the solution?


1 Answer 1


Rosanswers logo

In your obstacle_layer "inf_is_valid: false" The docs say "Are infinite returns from laser scanners valid measurements to raycast." Set to "true".

Originally posted by Dragonslayer with karma: 574 on 2021-11-15

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

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