Ask Your Question

Revision history [back]

It would help if you also posted your costmaps configurations.

Normally, when you setup your costmap layers, you can also choose the combination method which is how you are going to combine that layer (the laser one in your case) with the "master costmap". Setting this parameter to 0 will make your "obstacle layer" to overwrite the "static_map layer", clearing obstacles that are not detected by the laser scan.

for example:

        - {name: static_map,       type: "costmap_2d::StaticLayer"}
        - {name: obstacles,        type: "costmap_2d::VoxelLayer"}
    publish_frequency: 1.0
        observation_sources: base_scan
        combination_method: 0
        base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link, clearing: true, marking: true, topic: /base_scan}

check slide 16 here for more info on that.