simple pointcloud subscriber
I'm new to ROS and I stuck in a beginner problem. I already did the ROS Tutorials where I wrote a subscriber but it doesn't explain my problem. I wanna write a simple subscriber in C++ for the kinect (topic => /camera/depth_registered/points). My code looks like the following:
void pcdCallback(const sensor_msgs::PointCloud2ConstPtr& msg) {
ROS_INFO("pointcloud recieved");
}
int main(int argc, char **argv) {
ros::init(argc, argv, "pcdlistener");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("/camera/depth_registered/points", 1000, pcdCallback);
ros::spin();
return 0;
}
My Problem is now that the compiling produces the following failure:
/home/ronny/ros/pkgs/subscriber_pcd/src/pcdsubscriber.cpp:7: error: ISO C++ forbids declaration of ‘sensor_msgs’ with no type
would be great to get a hint or solution.
regards