Ask Your Question

Revision history [back]

From http://wiki.ros.org/pcl/Overview, for a subscriber that receives pcl::PointCloud<t> objects directly:

// Need to include the pcl ros utilities
#include "pcl_ros/point_cloud.h"

// callback signature, assuming your points are pcl::PointXYZRGB type:
void callback(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&);

// create a templated subscriber
ros::Subscriber sub = nh.subscribe<pcl::PointCloud<pcl::PointXYZRGB> > (topic, queue_size, callback);

I'm guessing it's a setting-up-the-callback problem, if you can post a gist of your full node, I can take a look.

From http://wiki.ros.org/pcl/Overview, for a subscriber that receives pcl::PointCloud<t> objects directly:

// Need to include the pcl ros utilities
#include "pcl_ros/point_cloud.h"

// callback signature, assuming your points are pcl::PointXYZRGB type:
void callback(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&);

// create a templated subscriber
ros::Subscriber sub = nh.subscribe<pcl::PointCloud<pcl::PointXYZRGB> > (topic, queue_size, callback);

I'm guessing it's a setting-up-the-callback problem, if you can post a gist of your full node, I can take a look.

From http://wiki.ros.org/pcl/Overview, for a subscriber that receives pcl::PointCloud<t> objects directly:

// Need to include the pcl ros utilities
#include "pcl_ros/point_cloud.h"

// callback signature, assuming your points are pcl::PointXYZRGB type:
void callback(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&);

// create a templated subscriber
ros::Subscriber sub = nh.subscribe<pcl::PointCloud<pcl::PointXYZRGB> > (topic, queue_size, callback);

I'm guessing it's a setting-up-the-callback problem, if Are you sure you included <pcl_ros/point_cloud.h>, not just <pcl/point_cloud.h>?

If you can post a gist of your full node, I can take a look.