在图像和点云的融合节点中,做了一个点云格式的转换:
- ROS 点云 sensor_msgs::PointCloud2 -> PCL 第一代点云 pcl::PointCloudpcl::PointXYZ
这里记录下常用的 ROS 和 PCL 之间的转换。
1. sensor_msgs::PCLPointCloud2 <=> pcl::PointCloudpcl::PointXYZ
把 ROS PointCloud2 转为 PCL 第一代 PointCloud,方便用 PCL 库处理:
void pcl::fromROSMsg(const sensor_msgs::PointCloud2 &, pcl::PointCloud<T> &);
比如:
// ROS 点云
sensor_msgs::PointCloud2::ConstPtr& cloud_msg;
// PCL 第一代点云
pcl::PointCloud<pcl::<

本文介绍了如何在ROS和PCL之间进行点云数据类型的转换,包括从ROS的sensor_msgs::PCLPointCloud2转换到PCL的pcl::PointCloud<pcl::PointXYZ>,以及反之的转换过程。此外,还涉及了sensor_msgs::PCLPointCloud2与pcl::PCLPointCloud2之间的转换操作,这些转换在图像和点云融合的节点中非常实用。
最低0.47元/天 解锁文章
745

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



