conversion from pcl::PointCloud<pcl::PointXYZ> to pcl::PCLPointCloud2
Hello
I try to convert from pcl::PointCloud<pcl::PointXYZ>
to pcl::PCLPointCloud2
But the conversion returns an empty point cloud.
This is my code:
pcl::PCLPointCloud2 cloud_inliers_pcl2;
pcl::toPCLPointCloud2(cloud_inliers, cloud_inliers_pcl2);
I can print out the cloud "cloud_inliers" which is in the pcl::PointCloud<pcl::PointXYZ>
But the pcl::PCLPointCloud2
returns empty fields
Pls take a look at this answer: https://answers.ros.org/question/1369...
Hello, Thank you. I referred that in the beginning of my code to convert from pcl::PCLPointCloud2 to pcl::PointCloud<pcl::pointxyz> And it worked. But now I need to convert back to pcl::PCLPointCloud2 I use the method pcl::toPCLPointCloud2 with 1st argument as cloud_inliers which is pcl::PointCloud<pcl::pointxyz> and second argument as cloud_inliers_pcl2 which is pcl::PointCloud<pcl::pointxyz>
Thank you for the clarification