Point Cloud Library (PCL)  1.9.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 #include <mutex>
9 
10 /* A simple class for capturing data from an OpenNI camera */
12 {
13  public:
14  OpenNICapture (const std::string& device_id = "");
15  ~OpenNICapture ();
16 
17  void setTriggerMode (bool use_trigger);
18  const PointCloudPtr snap ();
19  const PointCloudPtr snapAndSave (const std::string & filename);
20 
21  protected:
22  void onNewFrame (const PointCloudConstPtr &cloud);
24 
25  void waitForTrigger ();
26 
30  PointCloudPtr most_recent_frame_;
32  std::mutex mutex_;
33 };
pcl::visualization::PCLVisualizer::Ptr preview_
std::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) ...
const PointCloudPtr snap()
void onNewFrame(const PointCloudConstPtr &cloud)
void onKeyboardEvent(const pcl::visualization::KeyboardEvent &event)
boost::shared_ptr< PCLVisualizer > Ptr
OpenNICapture(const std::string &device_id="")
void setTriggerMode(bool use_trigger)
pcl::OpenNIGrabber grabber_
/brief Class representing key hit/release events
void waitForTrigger()