ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This seems to work for me:
pcl::PointCloud<pcl::PointXYZ>::Ptr final(new pcl::PointCloud<pcl::PointXYZ>);
...
*do something*
....
sensor_msgs::PointCloud2 output;
pcl::PCLPointCloud2 tmp_cloud;
pcl::toPCLPointCloud2(*final, tmp_cloud);
pcl_conversions::fromPCL(tmp_cloud, output);
icp_pub.publish(output);
2 | No.2 Revision |
This seems to work for me:is what I usually do:
pcl::PointCloud<pcl::PointXYZ>::Ptr final(new pcl::PointCloud<pcl::PointXYZ>);
...
*do something*
....
sensor_msgs::PointCloud2 output;
pcl::PCLPointCloud2 tmp_cloud;
pcl::toPCLPointCloud2(*final, tmp_cloud);
pcl_conversions::fromPCL(tmp_cloud, output);
icp_pub.publish(output);