How can I convert a PGM map file into a pointcloud format (PCD)?

asked 2022-01-01 06:33:56 -0600

JackFrost67 gravatar image

I'm wondering how I can transform a map file (.pgm) into a point cloud one, such as .pcd. I worked on a simple python script (, but when I publish the resulting .pcd, I find that it is offset on the y-axis about 10 cm. Probably is something related to the casting (like float representation into a int one), but I'm not sure. Is there any advice I can follow, for example, should I use centroids instead of using the index of the cell as a coordinate for the point?

edit retag flag offensive close merge delete