Correct way to use Costmap2DROS
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.