【ROS学习】- ROS中PCL数据转换

本文转载自: ROS中PCL数据转换 https://blog.csdn.net/u010284636/article/details/79214841

最近在使用PCL做Velodyne的点云数据分析,在分析的过程中,最开始的就是遇到了PCL的点云数据的各种转换,里面的数据确实有点乱,现总结如下:

ROS转PCL数据格式

  • sensor_msgs::PointCloud2转pcl::PCLPointCloud2 [2]

pcl_conversions::toPCL(sensor_msgs::PointCloud2, pcl::PCLPointCloud2)
  • sensor_msgs::PointCloud2转pcl::PointCloud< pcl::PointXYZ > [1]

pcl::fromROSMsg (sensor_msgs::PointCloud2, pcl::PointCloud<pcl::PointXYZ>);

PCL转ROS数据

  • pcl::PCLPointCloud2转sensor_msgs::PointCloud2[2]

pcl_conversions::fromPCL(pcl::PCLPointCloud2, sensor_msgs::PointCloud2);
  • pcl::PointCloud< pcl::PointXYZ >转 sensor_msgs::PointCloud2[1]

pcl::toROSMsg (pcl::PointCloud<pcl::PointXYZ>,sensor_msgs::PointCloud2);

PCL中数据互转 [3]

  • pcl::PCLPointCloud2转pcl::PointCloud < pcl::PointXYZ >

pcl::fromPCLPointCloud2(pcl::PCLPointCloud2,pcl::PointCloud<pcl::PointXYZ>);
  • pcl::PointCloud< pcl::PointXYZ >转pcl::PCLPointCloud2

pcl::toPCLPointCloud2(pcl::PointCloud<pcl::PointXYZ>, pcl::PCLPointCloud2);

Reference:

[1] http://wiki.ros.org/pcl/Overview
[2] http://wiki.ros.org/pcl/Tutorials
[3] http://docs.pointclouds.org/1.7.0/structpcl_1_1_p_c_l_point_cloud2.html

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值