0
$\begingroup$

Rosanswers logo

I was wondering why people at Willow Garage chose .pgm format to save the maps via map_server. I've seen a pull request to let users change format to png but I guess it wasn't accepted and it isn't present in current versions(why?).

I am aware that the map server does load up maps saved in png format, but I'm curious behind this design decision to only let maps be saved as .pgm

Would be great if someone familiar with the matter can answer!

(This is regarding ROS1, as I'm only familiar with ROS1. Would also like to know if ROS2 have or will have this feature.)


Originally posted by parzival on ROS Answers with karma: 463 on 2021-04-19

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

PGM is the "lowest common denominator" image format. You can create, save, and edit a PGM file using simple ASCII text. Since PGM is such a simple format it is easy to debug a map at runtime and doesn't require a library dependency to use. The PGM format is also lossless; meaning saving your map to disk doesn't degrade its quality. This is probably why the authors originally used it. Creating a node or CLI option to do the conversion to your format of choice should be trivially easy.

If you are trouble with PGM files get familiar with the ImageMagick CLI, and the Ubuntu Eye of Gnome (eog) image viewer utility. It will make viewing, editing, and converting PGM files a snap.


Originally posted by kscottz with karma: 209 on 2021-04-19

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.