0
$\begingroup$

Rosanswers logo

I have an "algorithm" node, which designs a path for a turtlebot to follow based on a static_map being published by a map_server.

Inside my algorithm node, I instantiate a Costmap2DROS object. Then, I do stuff like map->getCostmap()->getCost(x,y) etc. in order to get the cost values and information about the map.

Is this the correct way to go about reading maps in the ROS system? I just want to make sure I am on the right track so far.


Originally posted by Sebastian on ROS Answers with karma: 363 on 2015-06-11

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It seems like a reasonable thing to do. You basically initialize a global costmap with your static_map from the map server. However, if you don't need specific functions from Costmap2d, you can also just subscribe the map topic in your node and directly work on the nav_msgs::OccupancyGrid data. But especially for planning I think using Costmap2d is the way to go.


Originally posted by Sebastian Kasperski with karma: 1658 on 2015-06-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Sebastian on 2015-06-12:
Ok, thanks. I was confused because there are so few examples using Costmap2D that I wasn't confident about the intended usage.

$\endgroup$

Your Answer

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