Point Cloud Library (PCL)
1.7.1
Main Page
Modules
Namespaces
Classes
doc
tutorials
content
sources
iros2011
include
solution
openni_capture.h
1
#ifndef OPENNI_CAPTURE_H
2
#define OPENNI_CAPTURE_H
3
4
#include "typedefs.h"
5
6
#include <pcl/io/openni_grabber.h>
7
#include <pcl/visualization/pcl_visualizer.h>
8
9
/* A simple class for capturing data from an OpenNI camera */
10
class
OpenNICapture
11
{
12
public
:
13
OpenNICapture
(
const
std::string& device_id =
""
);
14
~OpenNICapture
();
15
16
void
setTriggerMode
(
bool
use_trigger);
17
const
PointCloudPtr
snap
();
18
const
PointCloudPtr
snapAndSave
(
const
std::string & filename);
19
20
protected
:
21
void
onNewFrame
(
const
PointCloudConstPtr &cloud);
22
void
onKeyboardEvent
(
const
pcl::visualization::KeyboardEvent
& event);
23
24
void
waitForTrigger
();
25
26
pcl::OpenNIGrabber
grabber_
;
27
boost::shared_ptr<pcl::visualization::PCLVisualizer>
preview_
;
28
int
frame_counter_
;
29
PointCloudPtr
most_recent_frame_
;
30
bool
use_trigger_
,
trigger_
;
31
boost::mutex
mutex_
;
32
};
33
34
#endif