0
$\begingroup$

Rosanswers logo

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.


Originally posted by sterlingm on ROS Answers with karma: 380 on 2016-12-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  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.


Originally posted by David Lu with karma: 10932 on 2016-12-15

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

This site is temporarily in read-only mode and not accepting new answers.