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

Why was PGM format selected to save map?

asked 2021-04-19 10:53:24 -0500

parzival gravatar image

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.)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-04-19 18:25:24 -0500

kscottz gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-04-19 10:53:24 -0500

Seen: 1,607 times

Last updated: Apr 19 '21