Local Costmap's Obstacle layer not detecting obstacles
I am using RTABMAP along with Nav2 and ROS2 Galactic. The robot uses a RGBD camera and I am using the depthimage_to_laserscan package to transform the images into a laserscan.
First of all it is worth to mention that the local costmap only appears if it is defined with an static_layer, like the global costmap. Otherwise it doesn't appear.
Moreover, you can see here an image of the problem. Once the map is mapped using RTABMAP, I introduce a rock in the middle of the cave, that, as you can see, it is detected by the laserscan and so by the camera. However, the local costmap doesn`t reflect this obstacle in the map.
I attach here the definition of the local costmap plugins.
plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
inflation_layer:
plugin: "nav2_costmap_2d::InflationLayer"
cost_scaling_factor: 3.0
inflation_radius: 0.6
obstacle_layer:
plugin: "nav2_costmap_2d::ObstacleLayer"
enabled: True
observation_sources: scan
scan:
topic: /scan
max_obstacle_height: 5.0
min_obstacle_height: 0.0
obstacle_max_range: 6.0
obstacle_min_range: 0.0
raytrace_max_range: 10.0
raytrace_min_range: 0.0
clearing: True
marking: True
data_type: "LaserScan"
static_layer:
map_subscribe_transient_local: True
always_send_full_costmap: True