ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Can costmap_2d's static_map be updated?

asked 2020-07-06 07:00:38 -0500

JunTuck gravatar image

Dear all,

I am working on implementing the navigation stack on a robot, and was wondering about the update behaviour of costmap_2d.

My global costmap is receiving a 2D SLAM map from Cartographer over the /map topic. Does this map update, and if yes how frequently?

So far this was the only documentation I managed to find, which was written way back in Hydro, so was wondering if the interface has remained the same. I have gone through the official wiki tutorials as well as the tuning guide by Kaiyu Zheng, would much appreciate more of such guides :)


edit retag flag offensive close merge delete



To me it seems (never checked) that the map parameter "static" uses a service instead of a constantly published topic to get the map only once. When using regular published topics the same behaviour seems to be possible with map_topic and first_map_only parameters set. I seem to remember that the parameter subscribe_to_updates means that changes in the map (slam) are transported in the sub-topic updates and added to the map (not a full new map is received). What works for you is dependent on your setup. The usual navigation stack (gmapping, amcl) uses the map_server thus service, thus static map.

Dragonslayer gravatar image Dragonslayer  ( 2020-07-06 10:19:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-06 13:29:03 -0500

The static map will update at any rate as new maps come in (its a callback, not polling) as long as you have subscribe_to_updates parameter set to true.

For ROS2, we have a number of parameter guides

edit flag offensive delete link more

Question Tools



Asked: 2020-07-06 07:00:38 -0500

Seen: 301 times

Last updated: Jul 06 '20