SLAMWang / fasterGICP

an improvement of fast_gicp
102 stars 15 forks source link

Save point cloud #7

Open quanfanquanfan opened 1 year ago

quanfanquanfan commented 1 year ago

Hello! I am a student learning about SLAM. Thank you for sharing such a wonderful tool. I want to add pcl::io::savePCDFile( "cloud.pcd", *map, true ); to mapping thread to save point clouds, but I can't find where it is. If you don`t mind, may I ask where I should add the code?? I hope to hear you soon!!

P.S. I`m not familiar with GitHub (and English) yet, so sorry if my way using "Issues" were wrong.

SLAMWang commented 1 year ago

check kitti.cpp line397, there is

voxelgrid_map_.setInputCloud(mapPointCloud_);
voxelgrid_map_.filter(*Map_);
string map_save_path =
        "/home/wjk/Fast_gicp_odometry/fast_gicp-master/tmp/Map" + sequence + "_" + use_sampling + ".pcd";
//pcl::io::savePCDFileASCII(map_save_path, *Map_);
cout << "map size: " << mapPointCloud_->size() << " " << Map_->size() << endl;

You just need to modify the save path on your computer and the map will be saved after running the code.

quanfanquanfan commented 1 year ago

Thank you, I will have a try!