StaticLayer map-resize erases all obstacles from ObstacleLayer
Hello @David Lu
I am using Google Cartographer as SLAM component, and move_base for navigation. In the config of the global costmap, I have setup costmap_2d::StaticLayer to subscribe to the /map topic published by cartographer. There is also an ObstacleLayer and an InflationLayer. My problem is that each time cartographer dynamically adjusts the map size, all obstacles which have been added to the global costmap get erased.
Looking at the code of static_layer.cpp I can see that StaticLayer::incomingMap() is executed when a map with new dimensions is received. In this function, there is a section that initializes the costmap with static data.
How can I prevent the StaticLayer from erasing previously discovered obstacles from the ObstacleLayer to get erased from the master costmap (i.e. global costmap)?
Thanks