gaoxiang12 / slam_in_autonomous_driving

《自动驾驶中的SLAM技术》对应开源代码
1.91k stars 467 forks source link

Add sad::SaveCloudToFile function #80

Closed BowenBZ closed 1 year ago

BowenBZ commented 1 year ago

Replace functions to save point cloud from pcl::io with SaveCloudToFile function, which firstly set the height and width property of the point cloud, and then save it.

This is to avoid the "No points to read" issue when using pcl_viewer to load the saved pcd file. See #75 for details.

Since pcl_map_viewer.h includes the point_cloud_utils.h file, and the pcl_map_viewer.h is included by several source files in ch7, including direct_ndt_lo.h, incremental_ndt_lo.h and loam_like_odom.h, create a point_cloud_utils.cc file and move the definitions to it to avoid "multiple definition" compile errors.

gaoxiang12 commented 1 year ago

Thanks for PR!