PCD Lesson3:PCD文件的读取

PCD文件的读取

#include 

#include
#include 

#include 
#include 
#include 

#define random(x1,x2) ((rand()%x2) - x1/2.0)

int main()
{

	pcl::PointCloud::Ptr cloud2(new pcl::PointCloud); //PointXYZ 数据结构
	boost::shared_ptrviewer2 (new pcl::visualization::PCLVisualizer("line Viewer")); //PCLVisualizer 可视化类
	pcl::PointXYZ p;

	pcl::PCDReader reader;
	
	viewer2->addCoordinateSystem(1.0); 

	reader.read("pcdData//test0.pcd", *cloud2); //读取
	viewer2->addPointCloud(cloud2,"c1"); //添加特定的点云
	viewer2->spin(); //可视化
	
	printf("hello world!\n");
	return 0;
}

你可能感兴趣的:(PCL学习系列)