ros pcl sensor::pointcloud2 转换成pcl::pointcloud

#include 
#include 
#include 
#include 
#include 

 void cloud_cb(const boost::shared_ptr<const sensor_msgs::PointCloud2>& input){

    pcl::PCLPointCloud2 pcl_pc2;
    pcl_conversions::toPCL(*input,pcl_pc2);
    pcl::PointCloud::Ptr temp_cloud(new pcl::PointCloud);
    pcl::fromPCLPointCloud2(pcl_pc2,*temp_cloud);
    //do stuff with temp_cloud here
    }

http://answers.ros.org/question/136916/conversion-from-sensor_msgspointcloud2-to-pclpointcloudt/

转载于:https://www.cnblogs.com/hong2016/p/7091540.html

你可能感兴趣的:(ros pcl sensor::pointcloud2 转换成pcl::pointcloud)