//Convert pcl/pointcloud object(cloud1) to sensor_msgs/PointCloud2(cloud2) with toROSMsg()
const sensor_msgs::PointCloudConstPtr &cloud1;
sensor_msgs::PointCloud2 cloud2;
pcl::toROSMsg(*cloud1, cloud2);
// Convert the sensor_msgs/PointCloud2(cloud2) object to pcl/pointcloud(cloud1) object with fromROSMsg()
sensor_msgs::PointCloud2ConstPtr& cloud2
pcl::PointCloud<pcl::PointXYZRGB> cloud1;
pcl::fromROSMsg (*cloud2, cloud1);
More than 5 years have passed since last update.
converting PCL point cloud type between pcl::PointCloud<PointT> (pcl pointcloud) and pcl::PointCloud2 (ROS pointcloud)
Last updated at Posted at 2012-12-26
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme