save map coordinates from hector_slam (or any other SLAM)

asked 2022-03-13 16:12:47 -0600

Hi, I am working on a project and my goal is to do a 2d scan with YDLIDAR X2L and create a CAD file. Right now I don't need 3D nor a big scan rate, so I guess this device should work fine. If I could save coordinates of the SLAM map points in a csv, for example, later I can export it to dxf and continue the blueprint (say, drawing doors and windows and identifying ambients manually) in a CAD system.

My 'complete' objective is: walk trough the floor and get the laser readings, get the map coordinates (saving it or using it directly) and create a dxf file with all this points (or with extracted lines, wich would give a lot less data, since it would return just start and end line points). I believe I can reach that with less than $200

I know I can get the map in a pgm or tiff format, but hey, if the system do precision laser readings and SLAM convert it somewhere in points with a given system coordinates, why not use this points coordinates instead a raster image? (don't know if 'raster' is the exact term, but I mean, think that pgm or tiff does not save x y data)

So far my investigation leads that this points coordinates are generated in SLAM (hector, for example, since I don't have odom data, just laser scan), and not in a tf transformation (it would be easier if I could use a tf listener). But I don't know how to read c++ source code (decided to study python first), so I'm stucked.

I just found tutorials and questions related to export robot position or points from /tf, not to the map itself. I'm trying to use some line extractors too, but still it is not what I'm looking for.

So the question is: is there a way to save 2d coordinates of points used by SLAM to generate the map?

I am using Ubuntu 20.04 and ROS noetic

Thanks in advance!

edit retag flag offensive close merge delete