ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to get the resolution of a map from the map_server

asked 2014-10-04 07:35:27 -0500

beginner_alex gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-04 08:17:40 -0500

bvbdort gravatar image

You can read resolution with map data.

nav_msgs::OccupancyGrid message has resolution variable inside MapMetaData

edit flag offensive delete link more

answered 2015-12-24 21:40:28 -0500

ratmcu gravatar image

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);
      ROS_INFO("couldn't get map resolution");
edit flag offensive delete link more


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.

ahendrix gravatar image ahendrix  ( 2015-12-24 22:42:56 -0500 )edit

Question Tools

1 follower


Asked: 2014-10-04 07:35:27 -0500

Seen: 583 times

Last updated: Oct 04 '14