txt转pcd
#include<iostream>
#include<fstream>
#include <string>
#include <vector>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
using namespace std;
int main()
{
fstream modelRead;
pcl::PointCloud<pcl::PointXYZ> cloud;
pcl::PCDWriter writer;
modelRead.open("/home/sr/tunan-github/txt_to_pcd/zhanban_36.txt", std::ios_base::in);
pcl::PointXYZ pclPnt;
while (!modelRead.eof())
{
modelRead >> pclPnt.x >> pclPnt.y >> pclPnt.z;
cloud.push_back(pclPnt);
}
modelRead.close();
writer.write("/home/sr/tunan-github/txt_to_pcd/zhanban_36.pcd", cloud);
cout<<"chenggong"<<endl;
return 0;
}
pcd转txt 在此