Extracting narf keypoints from kinect depth image problem [closed]
Hi, I'm trying get NARF keypoints using depth images from a kinect with the following code but I keep getting the errors at the bottom of the post when I try to compile, the problem seems to occur when I try to publish the keypoints, I just need to publish the keypoints so I can see them in Rviz. Could anyone shed some light onto what I'm doing wrong?
typedef pcl::PointCloud<pcl::pointcloud<int> > PointCloud;
ros::Publisher pub;
pcl::PointCloud<int> keypointsout;
float angular_resolution_; float support_size_ =0.2f;
void depthimage_cb(const sensor_msgs::ImageConstPtr &depth_msg) { const uint16_t* depthImage = reinterpret_cast<const uint16_t*>(&depth_msg-="">data[0]);
pcl::RangeImagePlanar range_image_;
pcl::RangeImageBorderExtractor range_image_border_extractor_;
// convert the depth-image to a pcl::rangeImage
angular_resolution_ = (float)(-1);
range_image_.setDepthImage(depthImage,depth_msg->width, depth_msg->height, (depth_msg->width)/2, (depth_msg->height)/2, 600.0, 600.0, angular_resolution_);
range_image_.setUnseenToMaxRange();
pcl::NarfKeypoint keypoint_det;
keypoint_det.getParameters ().support_size = support_size_;
keypoint_det.setRangeImageBorderExtractor (&range_image_border_extractor_);
keypoint_det.setRangeImage (&range_image_);
keypoint_det.compute (keypointsout); pub.publish (keypointsout); }
int main (int argc, char** argv) { // Initialize ROS ros::init (argc, argv, "keypointsplanar"); ros::NodeHandle nh2; //pub = nh2.advertise< PointCloud > ("keypointsout", 1);
ros::Subscriber sub2 = nh1.subscribe ("/camera/depth/image", 1, depthimage_cb);
pub = nh2.advertise<pcl::pointcloud<int> keypointsout> ("keypointsout", 1);
// Spin ros::spin (); }
ERRORS:
from /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:1: /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<m>::value(const M&) [with M = pcl::PointCloud<int>]’: /opt/ros/fuerte/include/ros/message_traits.h:255:104: instantiated from ‘const char* ros::message_traits::md5sum(const M&) [with M = pcl::PointCloud<int>]’ /opt/ros/fuerte/include/ros/publisher.h:112:7: instantiated from ‘void ros::Publisher::publish(const M&) const [with M = pcl::PointCloud<int>]’ /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:49:30: instantiated from here /opt/ros/fuerte/include/ros/message_traits.h:126:34: error: ‘const class pcl::PointCloud<int>’ has no member named ‘__getMD5Sum’ /opt/ros/fuerte/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<m>::value(const M&) [with M = pcl::PointCloud<int>]’: /opt/ros/fuerte/include/ros/message_traits.h:264:106: instantiated from ‘const char* ros::message_traits::datatype(const M&) [with M = pcl::PointCloud<int>]’ /opt/ros/fuerte/include/ros/publisher.h:112:7: instantiated from ‘void ros::Publisher::publish(const M&) const [with M = pcl::PointCloud<int>]’ /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:49:30: instantiated from here /opt/ros/fuerte/include/ros/message_traits.h:143:36: error: ‘const class pcl::PointCloud<int>’ has no member named ‘__getDataType’ In file included from /opt/ros/fuerte/include/ros/publisher.h:34:0, from /opt/ros/fuerte/include/ros/node_handle.h:32, from /opt/ros/fuerte/include/ros/ros.h:45, from /home/jumpei/fuerte_workspace/tesis/src/keypointsplanar.cpp:1: /opt/ros/fuerte/include/ros/serialization.h: In static member function ‘static uint32_t ros::serialization::Serializer<t>::serializedLength(typename boost::call_traits<t>::param_type) [with T = pcl::PointCloud<int>, uint32_t = unsigned int, typename boost::call_traits<t ...