Convert pcl::PointCloud<pcl::PointCloudXYZI> to pcl::PCLPointCloud2
I am very confused by the online documentation re this topic. I have a node with this publisher:
pointcloud_pub_ = nh_.advertise<pcl::PointCloud<pcl::PointXYZI> > ("/cloud", 1, false);
In the callback, this vector is populated, then published.
pcl::PointCloud<pcl::PointXYZI> cloud_xyzi_;
How can I simply convert cloud_xyzi_
to PointCloud2
at the final stage before publishing?