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

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

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 (https://github.com/JackFrost67/pgm2pcd), 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