Robotics StackExchange | Archived questions

how to get the resolution of a map from the map_server

Hello guys, i am programming a GUI in QT in which i draw points on a widget. I need to get the resolution of a MAP which i run with map_server in order to be able to change the resolution of the points i draw from pixels to meters. Can someone please give me a hint how to that. i'd really apreciate it. thanks in advance

Asked by beginner_alex on 2014-10-04 07:35:27 UTC

Comments

Answers

You can read resolution with map data.

nav_msgs::OccupancyGrid message has resolution variable inside MapMetaData

Asked by bvbdort on 2014-10-04 08:17:40 UTC

Comments

I found this method much easier to get the parameter value from the server

 double map_resolution;
  // **rosparam list** < use this command to see all the parameters
  if (ros::param::get("/move_base/global_costmap/resolution", map_resolution))
  {
    ROS_INFO("map resolution: %f",map_resolution);
  }
  else
      ROS_INFO("couldn't get map resolution");

Asked by ratmcu on 2015-12-24 22:40:28 UTC

Comments

I think retrieving the map resolution from the map data structure is the correct answer here. The move_base parameters may not be set if the OP is only running the map_server.

Asked by ahendrix on 2015-12-24 23:42:56 UTC