一、ROS与PCL中的点云数据结构
在ROS中表示点云的数据结构有:
第一代:sensor_msgs::PointCloud
第二代:sensor_msgs::PointCloud2
PCL中表示点云的数据结构有:
第一代:ppcl::PointCloud2< pcl::PointXYZ >
第二代:pcl::PCLPointCloud2
二、ROS PointCloud2与PCL pcl::PointXYZ(ROS第二代与PCL第一代)
sensor_msgs::PointCloud2 && pcl::PointCloud2< pcl::PointXYZ >
1. ROS到PCL: sensor_msgs::PCLPointCloud2 —> pcl::PointCloudpcl::PointXYZ
// ROS 点云
sensor_msgs::PointCloud2::ConstPtr& cloud_msg;
// PCL 第一代点云
pcl::PointCloud<pcl::PointXYZ>::Ptr pcl_cloud_msg(new pcl::PointCloud<pcl::PointXYZ>);
// ROS 点云 -> PCL 第一代点云
pcl::fromROSMsg(*cloud_msg, *pcl_cloud_msg);
----------------------

本文详细介绍了ROS中的PointCloud与PCL中的PointCloud2以及PointXYZ数据结构之间的转换过程,包括ROS到PCL的第一代与第二代转换,以及PCL第一代到ROS的转换。通过实例演示了如何在ROS与PCL之间传递和处理点云数据。
最低0.47元/天 解锁文章
1381

被折叠的 条评论
为什么被折叠?



