How to save nav_msgs/GetMap service and pass it into a function?
So, what I'm going for is to rather having a callback function I want to make my node a client to that service and then pass it to the another function.
ros::init(argc, argv, "dijkstra");
ros::NodeHandle n("~");
ros::ServiceClient client = n.serviceClient<nav_msgs::GetMap>("map");
nav_msgs::GetMap srv;
client.call(srv);
nav_msgs::OccupancyGrid = srv.response;
Running the above code gives me the error-
error: expected unqualified-id before ‘=’ token
nav_msgs::OccupancyGrid = srv.response;
I need to pass the map to a function void dijkstra(???)