error when subscribing to /camera/depth/points
Hello, I am currently running ros electric on Ubuntu 10.04, using a Kinect sensor and trying to subscribe to the /camera/depth/points topic published by openni_launch. Doing it the following way works:
cloudsub = n.subscribe <sensor_msgs::PointCloud2> ("/camera/depth/points", 1, cloudcb);
However, when trying to subscribe to it as follows:
cloudsub = n.subscribe <pcl::PointCloud<pcl::PointXYZ> > ("/camera/depth/points", 1, cloudcb);
I get the error message below:
In file included from /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_serialization/include/ros/serialization.h:37,
from /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/publisher.h:34,
from /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/node_handle.h:32,
from /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/ros.h:45,
from /home/rune/ros_workspace/hand_tracker/src/segment.cpp:1:
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<M>::value() [with M = pcl::PointCloud<pcl::PointXYZ>]’:
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:228: instantiated from ‘const char* ros::message_traits::md5sum() [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/subscribe_options.h:110: instantiated from ‘void ros::SubscribeOptions::init(const std::string&, uint32_t, const boost::function<void(const boost::shared_ptr<const M>&)>&, const boost::function<boost::shared_ptr<X>()>&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/node_handle.h:665: instantiated from ‘ros::Subscriber ros::NodeHandle::subscribe(const std::string&, uint32_t, void (*)(const boost::shared_ptr<const M>&), const ros::TransportHints&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/home/rune/ros_workspace/hand_tracker/src/segment.cpp:216: instantiated from here
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:121: error: ‘__s_getMD5Sum’ is not a member of ‘pcl::PointCloud<pcl::PointXYZ>’
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<M>::value() [with M = pcl::PointCloud<pcl::PointXYZ>]’:
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:237: instantiated from ‘const char* ros::message_traits::datatype() [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/subscribe_options.h:111: instantiated from ‘void ros::SubscribeOptions::init(const std::string&, uint32_t, const boost::function<void(const boost::shared_ptr<const M>&)>&, const boost::function<boost::shared_ptr<X>()>&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include/ros/node_handle.h:665: instantiated from ‘ros::Subscriber ros::NodeHandle::subscribe(const std::string&, uint32_t, void (*)(const boost::shared_ptr<const M>&), const ros::TransportHints&) [with M = pcl::PointCloud<pcl::PointXYZ>]’
/home/rune/ros_workspace/hand_tracker/src/segment.cpp:216: instantiated from here
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:138: error: ‘__s_getDataType’ is not a member of ‘pcl::PointCloud<pcl::PointXYZ>’
In file included from /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/include ...