ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.
2 | No.2 Revision |
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.
3 | No.3 Revision |
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.