测试效果
测试代码
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
cloud = PCL_Common::K_ReadPcdData("D:\\1_Kita\\peizhun_PCD\\1.pcd");
PCL_Common::K_ShowCloud(cloud, 2);
pcl::PCLPointCloud2 cloud2;
pcl::toPCLPointCloud2(*cloud, cloud2);
std::string str = std::accumulate(std::next(cloud2.fields.begin()), cloud2.fields.end(), cloud2.fields[0].name,
[](const auto& acc, const auto& field) { return acc + " " + field.name; });
cout << "点云数据中所包含的有效字段为: " << str << endl;