Point Cloud Library (PCL)  1.7.1
openni_capture.h
1 #ifndef OPENNI_CAPTURE_H
2 #define OPENNI_CAPTURE_H
3 
4 #include "typedefs.h"
5 
6 #include <pcl/io/openni_grabber.h>
7 #include <pcl/visualization/pcl_visualizer.h>
8 
9 /* A simple class for capturing data from an OpenNI camera */
11 {
12  public:
13  OpenNICapture (const std::string& device_id = "");
14  ~OpenNICapture ();
15 
16  void setTriggerMode (bool use_trigger);
17  const PointCloudPtr snap ();
18  const PointCloudPtr snapAndSave (const std::string & filename);
19 
20  protected:
21  void onNewFrame (const PointCloudConstPtr &cloud);
23 
24  void waitForTrigger ();
25 
27  boost::shared_ptr<pcl::visualization::PCLVisualizer> preview_;
29  PointCloudPtr most_recent_frame_;
31  boost::mutex mutex_;
32 };
33 
34 #endif