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

Questions about costmap_2D

asked 2016-12-12 12:21:38 -0500

sterlingm gravatar image

Hi, I've been reading up on the costmap_2D package and I just can't seem to wrap my head about it. Here are a couple questions that hopefully someone on here can help me understand.

1) What is the difference between the OccupancyGrid published on /map by the Gmapping package and the OccupancyGrid published on /grid by the costmap_2D package? My understanding is that costmap_2D provides a way to update a map at real-time, but when I run the gmapping_demo.launch file in turtlebot_navigation, the map is also updated at real-time. So why is costmap_2D needed if the Gmapping package can build and update a map at real-time?

2) Where is the costmap_2D package actually run? The wiki makes me think that it is run in one of the navigation launch files, and that it is needed by the move_base node. However, when I run the amcl_demo.launch file, I do not see costmap_2D in the results of rosnode list. When I run rqt_graph with the amcl demo running, the only topics I see relevant to costmaps are published by move_base (they are /move_base/global_costmap/costmap, /move_base/global_costmap/costmap_updates, /move_base/local_costmap/costmap, and /move_base/local_costmap/costmap_updates), but they have no subscribers.

If anyone can help me understand, I would be very grateful.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-15 08:43:22 -0500

David Lu gravatar image

1) The model used by costmap_2d is much simpler/faster than gmapping. The costmap relies on localization for accurate position estimates, whereas gmapping keeps track of many more factors to publish a map and a position estimate. The costmap is primarily used when you have already built a static map and want to track your position within it using AMCL, while still performing dynamic obstacle avoidance.

2) Costmap_2d is usually not run by itself (although it can be). It is typically run from within move_base, with its results published as a convenience, not necessarily to be used by other nodes, thus explaining the lack of subscribers.

edit flag offensive delete link more

Question Tools



Asked: 2016-12-12 12:21:38 -0500

Seen: 297 times

Last updated: Dec 15 '16