How to extract the map matrix after subscribing to /map of map_server?
I need to run Dijkstra's algorithm on this map.
So till now, I've used map_server and got the /map and /map_metadata topics. I'm not quite sure how to proceed further.
This is what I've done so far.
#include < ros/ros.h>
void dijkstra() {
}
int main(int argc, char **argv) {
ros::init(argc, argv, "shortestpath");
ros::Nodehandle n("~");
ros::Subscriber sub = n.subscribe("/map", 1000, dijkstra);
}
/map gives a 1D array so I need to use it and convert it in a 2D matrix.
Why don't you use amcl, and move_base? What is that you want to do exactly?