File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -525,4 +525,22 @@ void BackEndOptimizer::MultiRegistration(bool OdomRefinement){
525525 );
526526 if (verborse)
527527 std::cout << " Multiway Registration Finished." << std::endl;
528+ }
529+
530+ void BackEndOptimizer::SaveMap (const std::string &filename)
531+ {
532+ std::unique_lock<std::mutex> lock (FramePoseMutex);
533+ open3d::geometry::PointCloud Map;
534+ for (std::size_t i=0 ; i<FramePoses.size (); ++i)
535+ {
536+ Eigen::Isometry3d Pose = FramePoses[i];
537+ open3d::geometry::PointCloud laserCloud = LoadPCD (i);
538+ Map += laserCloud.Transform (Pose.matrix ());
539+ }
540+ auto option = open3d::io::WritePointCloudOption (
541+ false ,false ,true
542+ );
543+ open3d::io::WritePointCloud (filename,*(Map.VoxelDownSample (voxel)),option);
544+ if (verborse)
545+ std::cout << " Map saved to " << filename << std::endl;
528546}
You can’t perform that action at this time.
0 commit comments