Skip to content

Instantly share code, notes, and snippets.

@Kyungpyo-Kim
Created April 27, 2018 13:34
Show Gist options
  • Save Kyungpyo-Kim/960ecb2715409d1002b2793613546f43 to your computer and use it in GitHub Desktop.
Save Kyungpyo-Kim/960ecb2715409d1002b2793613546f43 to your computer and use it in GitHub Desktop.
[PCL][ROS] savePCDFile
#include <pcl/io/pcd_io.h>
bool Cluster::SaveCluster2Obj(int num)
{
char char_filename[80];
sprintf (char_filename, "/home/kyungpyo/pcd_dataset/PCD%06d.pcd" , num);
std::string str_filename (char_filename);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr ptr_cloud = this->GetCloud();
int a = pcl::io::savePCDFile (str_filename.c_str(), *ptr_cloud);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment