Point Cloud Library (PCL)  1.14.1-dev
openni_capture.h
1 #pragma once
2 
3 #include "typedefs.h"
4 
5 #include <pcl/io/openni_grabber.h>
6 #include <pcl/visualization/pcl_visualizer.h>
7 
8 /* A simple class for capturing data from an OpenNI camera */
9 class OpenNICapture
10 {
11  public:
12  OpenNICapture (const std::string& device_id = "");
14 
15  void setTriggerMode (bool use_trigger);
16  const PointCloudPtr snap ();
17  const PointCloudPtr snapAndSave (const std::string & filename);
18 
19  protected:
20  void onNewFrame (const PointCloudConstPtr &cloud);
22 
23  void waitForTrigger ();
24 
27  int frame_counter_;
28  PointCloudPtr most_recent_frame_;
29  bool use_trigger_, trigger_;
30  std::mutex mutex_;
31 };
pcl::OpenNIGrabber grabber_
void onKeyboardEvent(const pcl::visualization::KeyboardEvent &event)
pcl::visualization::PCLVisualizer::Ptr preview_
const PointCloudPtr snap()
void waitForTrigger()
PointCloudPtr most_recent_frame_
OpenNICapture(const std::string &device_id="")
void setTriggerMode(bool use_trigger)
void onNewFrame(const PointCloudConstPtr &cloud)
const PointCloudPtr snapAndSave(const std::string &filename)
std::mutex mutex_
Grabber for OpenNI devices (i.e., Primesense PSDK, Microsoft Kinect, Asus XTion Pro/Live)
/brief Class representing key hit/release events
shared_ptr< PCLVisualizer > Ptr