title: PCL with Kinect (OpenNI Grabber)
body: <p>**Hi , I just want a point cloud from kinect device. I followed the below link to do so.
  <a href="http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber" rel="nofollow">http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber</a></p>
  
  <p>But I am getting the following error .
  Please suggest me , what I am doing wrong ? :(</p>
  
  <p>Your help is highly appreciable !! </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>#include &lt;pcl/console/parse.h&gt;
  #include &lt;pcl\console\time.h&gt;
  #include &lt;pcl\io\io.h&gt;
  #include &lt;pcl\point_types.h&gt;
  #include&lt;pcl\io\pcd_io.h&gt;
  #include &lt;pcl\io\openni_grabber.h&gt;
  #include &lt;pcl-1.7\pcl\io\openni_grabber.h&gt;
  
  #include &lt;pcl/visualization/cloud_viewer.h&gt;
  #include "time.h"
  #include &lt;iostream&gt;
  #include &lt;string.h&gt;
  #include &lt;sstream&gt;
  #include &lt;Windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;mmsystem.h&gt;
  #include &lt;pcl\io\grabber.h&gt;
  #include&lt;pcl\point_types.h&gt;
  
  #include &lt;OpenNI.h&gt;
  #include&lt;pcl\io\boost.h&gt;
  
  using namespace pcl;
  using namespace std;
  
  class SimpleOpenNIViewer
   {
     public:
       SimpleOpenNIViewer () : viewer ("PCL OpenNI Viewer") {}
  
       void cloud_cb_ (const pcl::PointCloud&lt;pcl::PointXYZ&gt;::ConstPtr &amp;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&lt;void (const pcl::PointCloud&lt;pcl::PointXYZ&gt;::ConstPtr&amp;)&gt; f =
           boost::bind (&amp;SimpleOpenNIViewer::cloud_cb_, this, _1);
  
         interface-&gt;registerCallback (f);
        // start receiving point clouds
         interface-&gt;start ();
  
         while (!viewer.wasStopped())
         {
           boost::this_thread::sleep (boost::posix_time::seconds (1));
         }
  
         interface-&gt;stop ();
       }
  
       pcl::visualization::CloudViewer viewer;
   };
  
   int main ()
   {
     SimpleOpenNIViewer v;
     v.run ();
     return 0;
   } </code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>1&gt;------ Build started: Project: Experiment_PCL_Kinect, Configuration: Debug Win32 ------
  1&gt;  Experiment_PCL.cpp
  1&gt;Experiment_PCL.cpp(92): error C2039: 'OpenNIGrabber' : is not a member of 'pcl'
  1&gt;Experiment_PCL.cpp(92): error C2061: syntax error : identifier 'OpenNIGrabber'
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</code></pre>
  </div>
  </div>
  </p>