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 #include <mutex>
9 
10 /* A simple class for capturing data from an OpenNI camera */
11 class OpenNICapture
12 {
13 public:
14  OpenNICapture (const std::string& device_id = "");
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 
29  int frame_counter_;
30  PointCloudPtr most_recent_frame_;
31  bool use_trigger_, trigger_;
32  std::mutex mutex_;
33 };
pcl::OpenNIGrabber grabber_
void onKeyboardEvent(const pcl::visualization::KeyboardEvent &event)
pcl::visualization::PCLVisualizer * 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
PCL Visualizer main class.