ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You'll need to #include the appropriate header for PointCloud2s:

#include "sensor_msgs/PointCloud2.h"

However, let me suggest something better: rather than subscribe to PointCloud2 objects (which are literal translations of the on-the-wire format, and somewhat hard to deal with), take a look at pcl_ros, and subscribe to PointCloud<PointXYZ> (or PointCloud<PointXYZ>, depending on your data); that way, all of the translation to a PCL type (and all the helpful machinery that comes with it) are done for you.