ROS与PCL中各种点云数据格式之间的转换(大总结)
三种常用点云数据格式:
- pcl::PointCloud< PointT>
- pcl::PCLPointCloud2
- snesor_msgs::PointCloud2
1.sensor_msgs::PointCloud2转pcl::PCLPointCloud2
pcl_conversion::toPCl(sensor_msgs::PointCloud2,pcl::PCLPointCloud2)
2.sensor_msgs::PointCloud2转pcl::PointCloud< PointT>
pcl::fromROSMsg(sensor_msgs::PointCloud2,pcl::PointCloud<PointT>)
3.pcl::PCLPointCloud2转sensor_msgs::PointCloud2
pcl_conversion::fromPCL(pcl::PCLPointCloud2,sensor_msgs::PointCloud2)
4.pcl::PCLPointCloud2转pcl::PointCloud< PointT>
pcl::fromPCLPointCloud2(pcl::PCLPointCloud2,pcl::PointCloud<PointT>
5.pcl::PointCloud< PointT>转 snesor_msgs::PointCloud2
pcl::toROSMsg(pcl::PointCloud<PointT>,snesor_msgs::PointCloud2)
6.pcl::PointCloud< PointT>转 pcl::PCLPointCloud2
pcl::toPCLPointCloud2(pcl::PointCloud< PointT>,pcl::PCLPointCloud2)