Rosanswers logo


I am trying to get an instantaneous occupancy grid by using laser scanner (in stageros) and get the locations and dimensions of the obstacles. With the help of costmap_2d package, I am able to generate the occupancy grid but there is an issue with the moving obstacles. When only the main vehicle is moving and there are no dynamic obstacles, clearing is happening properly. But when there is a moving obstacle, the moving obstacle's occupancy information is not being updated and hence the traces are left behind.

Please refer to this video

I have set marking and clearing values to be true, and observation_persistence is also 0.0. I can't think of anything beyond these three parameters. Are there any other parameters I need to set? What could be the solution?

Please, help.

Thank you.

Originally posted by vishnu on ROS Answers with karma: 25 on 2017-11-17

Post score: 0


1 Answer 1


Rosanswers logo

Probably your problem is that you don't have anything beyond the dynamic obstacle, so costmap doesn't get any valid laser reading to "clear" the previously perceived obstacle. Remember that costmap needs to raytrace something beyond an occupied cell to clean it. Try adding some wall to your world.

Originally posted by IvanV with karma: 329 on 2017-11-20

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by vishnu on 2017-12-11:
@IvanV Thanks for the response. Adding a wall behind the obstacles certainly worked, but in this scenario, I cannot have it all the time. I found a workaround that I created a service to clear costmap (equivalent to the sevice clearCostmaps in move_base).

Comment by CHIN on 2019-02-01:
@vishnu how u solved it? can you give some details. I'm quite new to this and facing almost the same problem


Your Answer

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