Loading...
Searching...
No Matches
openni_capture.h
#pragma once
#include "typedefs.h"
#include <pcl/io/openni_grabber.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <mutex>
/* A simple class for capturing data from an OpenNI camera */
class OpenNICapture
{
public:
OpenNICapture (const std::string& device_id = "");
~OpenNICapture ();
void setTriggerMode (bool use_trigger);
const PointCloudPtr snap ();
const PointCloudPtr snapAndSave (const std::string & filename);
protected:
void onNewFrame (const PointCloudConstPtr &cloud);
void onKeyboardEvent (const pcl::visualization::KeyboardEvent & event);
void waitForTrigger ();
pcl::OpenNIGrabber grabber_;
pcl::visualization::PCLVisualizer::Ptr preview_;
int frame_counter_;
PointCloudPtr most_recent_frame_;
bool use_trigger_, trigger_;
std::mutex mutex_;
};
OpenNICapture
Definition openni_capture.h:12
OpenNICapture::grabber_
pcl::OpenNIGrabber grabber_
Definition openni_capture.h:27
OpenNICapture::onKeyboardEvent
void onKeyboardEvent(const pcl::visualization::KeyboardEvent &event)
OpenNICapture::preview_
pcl::visualization::PCLVisualizer::Ptr preview_
Definition openni_capture.h:28
OpenNICapture::use_trigger_
bool use_trigger_
Definition openni_capture.h:31
OpenNICapture::~OpenNICapture
~OpenNICapture()
OpenNICapture::snap
const PointCloudPtr snap()
OpenNICapture::frame_counter_
int frame_counter_
Definition openni_capture.h:29
OpenNICapture::waitForTrigger
void waitForTrigger()
OpenNICapture::most_recent_frame_
PointCloudPtr most_recent_frame_
Definition openni_capture.h:30
OpenNICapture::OpenNICapture
OpenNICapture(const std::string &device_id="")
OpenNICapture::setTriggerMode
void setTriggerMode(bool use_trigger)
OpenNICapture::onNewFrame
void onNewFrame(const PointCloudConstPtr &cloud)
OpenNICapture::snapAndSave
const PointCloudPtr snapAndSave(const std::string &filename)
OpenNICapture::trigger_
bool trigger_
Definition openni_capture.h:31
OpenNICapture::mutex_
std::mutex mutex_
Definition openni_capture.h:32
pcl::OpenNIGrabber
Grabber for OpenNI devices (i.e., Primesense PSDK, Microsoft Kinect, Asus XTion Pro/Live)
Definition openni_grabber.h:70
pcl::visualization::KeyboardEvent
/brief Class representing key hit/release events
Definition keyboard_event.h:49
pcl::visualization::PCLVisualizer::Ptr
shared_ptr< PCLVisualizer > Ptr
Definition pcl_visualizer.h:96