Detect when costmap2DROS is updated
I am using a Costmap2DROS object to access a occupancy grid created with gmapping.
I want to execute some algorithm on the map whenever it gets updated. I figured the easiest way to do this is to have a subscriber to the "/map" topic with a callback that executes the algorithm.
I am worried about the overhead associated with the subscriber. I don't want the "/map" data to be cached in some queue somewhere, since it is being cached by Costmap2DROS.
I guess I would want a queue_size = zero.
I don't want ROS to send the occupancyGrid message to my callback function because I don't need it. I can get the data from Costmap2DROS.