Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
doc
tutorials
content
sources
iros2011
include
solution
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 =
""
);
13
~OpenNICapture
();
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);
21
void
onKeyboardEvent
(
const
pcl::visualization::KeyboardEvent
& event);
22
23
void
waitForTrigger
();
24
25
pcl::OpenNIGrabber
grabber_
;
26
pcl::visualization::PCLVisualizer::Ptr
preview_
;
27
int
frame_counter_
;
28
PointCloudPtr
most_recent_frame_
;
29
bool
use_trigger_
,
trigger_
;
30
std::mutex
mutex_
;
31
};
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