0
$\begingroup$

Rosanswers logo

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


Originally posted by Huibuh on ROS Answers with karma: 399 on 2017-02-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

In the initial formulation of the static layer, the size was presumed to be relatively constant (static you might say).

The semantics of resizing the underlying static map are not so well defined that it defines how to deal with all the previous data in the layers. It's a decent use case, but I don't believe its currently covered in the existing layers.


Originally posted by David Lu with karma: 10932 on 2017-02-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Huibuh on 2017-02-23:
You're right, each time StaticLayer::incomingMap() is executed, Costmap2D::resizeMap() is called on all other layers. In this function, initMaps() and resetMaps() wipes the existing data. Do you have any suggestions how to modify Costmap2D::resizeMap() to preserve the data?

Comment by David Lu on 2017-03-26:
It would involve a substantial amount of changes. The implementation should probably be similar to Costmap2D::updateOrigin which also changes the coordinate system of the map while keeping some of the data.

$\endgroup$

Your Answer

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