ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
![]() | 1 | initial version |
For anyone interested, here is my solution:
#include <pcl/common/common.h>
#include <pcl/common/common_headers.h>
#include <pcl/PCLPointCloud2.h>
#include <pcl/conversions.h>
#include <pcl_conversions/pcl_conversions.h>
#include <ros/ros.h>
#include "sensor_msgs/PointCloud2.h"
typedef pcl::PointXYZRGBA PointXYZRGBA;
typedef pcl::PointCloud <PointXYZRGBA> CloudXYZRGBA;
void pcl::ihs::InHandScanner::grab_pc(const sensor_msgs::PointCloud2 msg)
{
//ros_pcl2 to pcl2
pcl::PCLPointCloud2 pcl_pc;
pcl_conversions::toPCL(msg, pcl_pc);
//pcl2 to pclxyzrgba
pcl::PointCloud<PointXYZRGBA> input_cloud;
pcl::fromPCLPointCloud2(pcl_pc, input_cloud);
}