0
$\begingroup$

Rosanswers logo

After implementing SLAM using gmapping, the map was saved using map_server package, as a pgm file and a yaml file, I need to know the dimensions of the objects in the map and the map itself, how do I achieve this?


Originally posted by fiorano10 on ROS Answers with karma: 45 on 2017-12-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Get the dimensions of the pgm (x pixels by y pixels) then examine your yaml file. In the yaml file the resolution of the map is given in meters/pixel. This will allow you to determine the size of your map in meters. You would figure out the size of objects in the map in a similar fashion (i.e., multiply the number of pixels your object takes by the resolution of your map and you'll have the physical size of the object).

Refer to http://wiki.ros.org/map_server#YAML_format


Originally posted by jayess with karma: 6155 on 2017-12-06

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by fiorano10 on 2017-12-06:
What are some ways I could get the x and y pixels for the map and not the pgm file? My pgm file has larger dimensions than the actual map.

Comment by jayess on 2017-12-06:
You can just manually edit the pgm so that it is the size of your map. I've used GIMP to edit maps before.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.