Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openni_capture.h
Go to the documentation of this file.
1 #ifndef OPENNI_CAPTURE_H
2 #define OPENNI_CAPTURE_H
3 
4 #include "typedefs.h"
5 
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);
22  void onKeyboardEvent (const pcl::visualization::KeyboardEvent & event);
23 
24  void waitForTrigger ();
25 
26  pcl::OpenNIGrabber grabber_;
27  boost::shared_ptr<pcl::visualization::PCLVisualizer> preview_;
28  int frame_counter_;
29  PointCloudPtr most_recent_frame_;
30  bool use_trigger_, trigger_;
31  boost::mutex mutex_;
32 };
33 
34 #endif