ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

costmap_2d clear obstacles after every update

asked 2015-07-15 16:16:40 -0500

Ishani Chatterjee gravatar image

Hi, I am creating costmaps of highly dynamic obstacles and want it to be efficiently cleared just before every update, so that each time only the current point cloud is projected into the map and there is no trace of what was previously projected. Any help is appreciated. Thanks.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2015-07-16 10:35:01 -0500

David Lu gravatar image

I don't believe you can do this with the costmap layers as they are currently structured, but you could write a subclass of the obstacle_layer that clears all information from the map on every iteration.

edit flag offensive delete link more


There is a protected member resetMaps(), I tried to change its scope to public and called it in the layered_costmap function that updates maps. But I can't see any topic published. Even if I reset everything to the original source code pulled from Git, it compiles and runs, but there is no topic

Ishani Chatterjee gravatar image Ishani Chatterjee  ( 2015-07-16 14:53:41 -0500 )edit

answered 2015-07-16 03:17:23 -0500

If you take a look at the costmap_2d documentation (costmap_2d) the parameter update_frequency allows you to increase the frequency at which the costmap is updated. Maybe if you sincronize this frequency with the rate of your laser sensor, you can keep up with a real time visualization in the costmap (with the associated resource consumption).

edit flag offensive delete link more


The update_frequency is already set to the rate at which I publish my point cloud( the costmap takes as input my custom point cloud), but the clearing is done through raytracing, I dont want that to happen, but the costmap to be cleared before each iteration

Ishani Chatterjee gravatar image Ishani Chatterjee  ( 2015-07-16 14:51:03 -0500 )edit

answered 2015-07-17 12:35:22 -0500

daniel_dsouza gravatar image

updated 2015-07-17 12:36:08 -0500

Have you tried

  • ~<name>/<source_name>/observation_persistence (double, default: 0.0)

as described here?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-07-15 16:16:40 -0500

Seen: 721 times

Last updated: Jul 16 '15