Need PCL conversion help
Can not figure out how to convert with toROSMsg : is there another conversion function?
get error:
/opt/ros/indigo/include/pcl_conversions/pcl_conversions.h:486:8: note: no known conversion for argument 1 from ‘pcl::PointCloud<pcl::PointXYZRGBA>’ to ‘const PointCloud2& {aka const sensor_msgs::PointCloud2_<std::allocator<void> >&}’
/opt/ros/indigo/include/pcl_conversions/pcl_conversions.h:508:8: note: template<class T> void pcl::toROSMsg(const pcl::PointCloud<PointT>&, sensor_msgs::PointCloud2&)
void toROSMsg(const pcl::PointCloud<T> &pcl_cloud, sensor_msgs::PointCloud2 &cloud)
the code is as follows;
sensor_msgs::PointCloud2 pc2;
pcl::toROSMsg(*cloud_pass_downsampled_, &pc2);
pubCloudOut.publish(pc2);
This code compiles:
pcl::PointCloud<pcl::PointXYZ> mycloud;
pcl::copyPointCloud(*cloud_pass_downsampled_, mycloud);
sensor_msgs::PointCloud2 pc2;
pcl::toROSMsg(mycloud, pc2);
pubCloudOut.publish(pc2);