Point Cloud Library (PCL)  1.8.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 */
10 class OpenNICapture
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 
28  int frame_counter_;
29  PointCloudPtr most_recent_frame_;
30  bool use_trigger_, trigger_;
31  boost::mutex mutex_;
32 };
33 
34 #endif
boost::mutex mutex_
PointCloudPtr most_recent_frame_
const PointCloudPtr snapAndSave(const std::string &filename)
Grabber for OpenNI devices (i.e., Primesense PSDK, Microsoft Kinect, Asus XTion Pro/Live) ...
PCL Visualizer main class.
const PointCloudPtr snap()
void onNewFrame(const PointCloudConstPtr &cloud)
void onKeyboardEvent(const pcl::visualization::KeyboardEvent &event)
OpenNICapture(const std::string &device_id="")
pcl::visualization::PCLVisualizer * preview_
void setTriggerMode(bool use_trigger)
pcl::OpenNIGrabber grabber_
/brief Class representing key hit/release events
void waitForTrigger()