0
votes

**Hi , I just want a point cloud from kinect device. I followed the below link to do so. http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber

But I am getting the following error . Please suggest me , what I am doing wrong ? :(

Your help is highly appreciable !!

#include <pcl/console/parse.h>
#include <pcl\console\time.h>
#include <pcl\io\io.h>
#include <pcl\point_types.h>
#include<pcl\io\pcd_io.h>
#include <pcl\io\openni_grabber.h>
#include <pcl-1.7\pcl\io\openni_grabber.h>

#include <pcl/visualization/cloud_viewer.h>
#include "time.h"
#include <iostream>
#include <string.h>
#include <sstream>
#include <Windows.h>
#include <stdio.h>
#include <mmsystem.h>
#include <pcl\io\grabber.h>
#include<pcl\point_types.h>

#include <OpenNI.h>
#include<pcl\io\boost.h>

using namespace pcl;
using namespace std;

class SimpleOpenNIViewer
 {
   public:
     SimpleOpenNIViewer () : viewer ("PCL OpenNI Viewer") {}

     void cloud_cb_ (const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &cloud)
     {
       if (!viewer.wasStopped())
         viewer.showCloud (cloud);
     }

     void run ()
     {
		  // create a new grabber for OpenNI devices
       pcl::Grabber* interface = new pcl::OpenNIGrabber();
	   
	     // make callback function from member function
       boost::function<void (const pcl::PointCloud<pcl::PointXYZ>::ConstPtr&)> f =
         boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1);

       interface->registerCallback (f);
	     // start receiving point clouds
       interface->start ();

       while (!viewer.wasStopped())
       {
         boost::this_thread::sleep (boost::posix_time::seconds (1));
       }

       interface->stop ();
     }

     pcl::visualization::CloudViewer viewer;
 };

 int main ()
 {
   SimpleOpenNIViewer v;
   v.run ();
   return 0;
 } 

1>------ Build started: Project: Experiment_PCL_Kinect, Configuration: Debug Win32 ------
1>  Experiment_PCL.cpp
1>Experiment_PCL.cpp(92): error C2039: 'OpenNIGrabber' : is not a member of 'pcl'
1>Experiment_PCL.cpp(92): error C2061: syntax error : identifier 'OpenNIGrabber'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Where did you get the PCL library? Make sure that OpenNI support is enabled.taketwo
I downloaded PCL 1.7.2 from the following link as I have Visual Studio 2012 installed in my PC. unanancyowen.com/?p=1255&lang=enMarie
From the page you referenced: "This PCL All-in-one Installer does not include the OpenNI v1.x. For this reason, pcl::OpenNIGrabber is not available."taketwo
Can you please suggest me suitable link to download PCL compatible with Visual studio 2012 (win 32 PC).I have both OpenNI and OpenNI2 installed in my system.Marie
AFAIR this installer included OpenNI2, so you may try using OpenNI2Grabber instead. If it's not available as well, then I'm afraid you'll need to compile from source. (Or you may also search/ask on pcl users mail list, maybe someone knows another installer with OpenNI support included.)taketwo