Ask Your Question
0

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
4

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
-1

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

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.

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 383 times

Last updated: Oct 04 '14