koide3 / hdl_localization

Real-time 3D localization using a (velodyne) 3D LIDAR
BSD 2-Clause "Simplified" License
775 stars 309 forks source link

Offset map points by UTM reference coordinates if a .utm file exists #54

Closed robustify closed 3 years ago

robustify commented 3 years ago

When hdl_graph_slam is run with GPS inputs, the map point cloud is saved along with a .utm file that stores the UTM coordinates of the map reference point.

This PR updates the global map server to check for the existence of this file in the same directory as the .pcd file, and uses it to offset each point in the map when it is loaded from the pcd file. This way, the map point cloud has the same relative coordinates it did when it was built.

koide3 commented 3 years ago

Thanks for the PR. Can you make this conversion selective with a rosparam like:

if (utm_file.is_open() && private_nh.param<bool>("convert_utm_to_local", true) {
robustify commented 3 years ago

Done!

koide3 commented 3 years ago

Great! I merge it :+1: