PLC PointCloud subscribing
I'm doing a project on motion detection and and gesture recognition and I have to extract and subscribe to the PointCloud2 sensor messages on the Kinect device using openni but I am new to ROS and have no idea how to do it. I've been reading: Here
However, whenever I try to run the examples, I get the following:
fatal error: pcl/point_cloud.h: No such file or directory
but I have installed the PCL library, so, might it have something to do with my CMake file not including something?
Could someone please link me or try to explain how I would possibly Subscribe to the PointCloud and have a callback function which publishes the data that is being extracted on my own topic?
Thanks
P.S.
I have tried to implement the following:
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
#include <boost/foreach.hpp>
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
void callback(const PointCloud::ConstPtr& msg)
{
printf ("Cloud: width = %d, height = %d\n", msg->width, msg->height);
BOOST_FOREACH (const pcl::PointXYZ& pt, msg->points)
printf ("\t(%f, %f, %f)\n", pt.x, pt.y, pt.z);
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "sub_pcl");
ros::NodeHandle nh;
ros::Subscriber sub = nh.subscribe<PointCloud>("points2", 1, callback);
ros::spin();
}