ROS与PCL中各种点云数据格式之间的转换(大总结)

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)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_45388819/article/details/113794706