Ask Your Question

Revision history [back]

I believe you want the example code from http://wiki.ros.org/pcl_ros#Subscribing_to_point_clouds but make the

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

into:

typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;

I believe you want the example code from http://wiki.ros.org/pcl_ros#Subscribing_to_point_clouds but make the

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

into:

typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;

(Or does that only work for sensor_msgs::PointCloud and not PointCloud2?)

I believe you want the example code from http://wiki.ros.org/pcl_ros#Subscribing_to_point_clouds but make the

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

into:

typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud;

(Or does that only work for sensor_msgs::PointCloud http://wiki.ros.org/pcl_ros#ROS_C.2B-.2B-_interface :

pcl_ros extends the ROS C++ client library to support message passing with PCL native data types. Simply add the following include to your ROS node source code:

#include <pcl_ros/point_cloud.h>

This header allows you to publish and subscribe pcl::PointCloud<t> objects as ROS messages. These appear to ROS as sensor_msgs/PointCloud2 messages, offering seamless interoperability with non-PCL-using ROS nodes. For example, you may publish a pcl::PointCloud<t> in one of your nodes and visualize it in rviz using a Point Cloud2 display. It works by hooking into the roscpp serialization infrastructure.

The old format sensor_msgs/PointCloud is not PointCloud2?)

supported in PCL.