Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
io
depth_sense_grabber.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2014-, Open Perception, Inc.
6
*
7
* All rights reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* * Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials provided
18
* with the distribution.
19
* * Neither the name of the copyright holder(s) nor the names of its
20
* contributors may be used to endorse or promote products derived
21
* from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
*/
37
38
#pragma once
39
40
#include <pcl/io/grabber.h>
41
#include <pcl/point_cloud.h>
42
#include <
pcl/point_types.h
>
43
44
namespace
pcl
45
{
46
47
// Forward declaration of a class that contains actual grabber implementation
48
namespace
io
{
namespace
depth_sense
{
struct
DepthSenseGrabberImpl
; } }
49
50
/** Grabber for DepthSense devices (e.g. Creative Senz3D, SoftKinetic DS325).
51
*
52
* Requires [SoftKinetic DepthSense SDK](http://www.softkinetic.com/Support/Download).
53
*
54
* \author Sergey Alexandrov
55
* \ingroup io */
56
class
PCL_EXPORTS
DepthSenseGrabber
:
public
Grabber
57
{
58
59
public
:
60
61
using
Ptr
= shared_ptr<DepthSenseGrabber>;
62
using
ConstPtr
= shared_ptr<const DepthSenseGrabber>;
63
64
using
sig_cb_depth_sense_point_cloud
= void(
const
pcl::PointCloud<pcl::PointXYZ>::ConstPtr
&);
65
using
sig_cb_depth_sense_point_cloud_rgba
= void(
const
pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr
&);
66
67
enum
Mode
68
{
69
DepthSense_QVGA_30Hz
= 0,
70
};
71
72
enum
TemporalFilteringType
73
{
74
DepthSense_None
= 0,
75
DepthSense_Median
= 1,
76
DepthSense_Average
= 2,
77
};
78
79
/** Create a grabber for a DepthSense device.
80
*
81
* The grabber "captures" the device, making it impossible for other
82
* grabbers to interact with it. The device is "released" when the
83
* grabber is destructed.
84
*
85
* This will throw pcl::IOException if there are no free devices that
86
* match the supplied \a device_id.
87
*
88
* \param[in] device_id device identifier, which might be a serial
89
* number, an index (with '#' prefix), or an empty string (to select the
90
* first available device)
91
*/
92
DepthSenseGrabber
(
const
std::string& device_id =
""
);
93
94
virtual
95
~DepthSenseGrabber
() noexcept;
96
97
virtual
void
98
start
();
99
100
virtual
void
101
stop
();
102
103
virtual
bool
104
isRunning
() const;
105
106
virtual std::
string
107
getName
()
const
108
{
109
return
(std::string (
"DepthSenseGrabber"
));
110
}
111
112
virtual
float
113
getFramesPerSecond
()
const
;
114
115
/** Set the confidence threshold for depth data.
116
*
117
* Each pixel in a depth image output by the device has an associated
118
* confidence value. The higher this value is, the more reliable the
119
* datum is.
120
*
121
* The depth pixels (and their associated 3D points) are filtered based
122
* on the confidence value. Those that are below the threshold are
123
* discarded (i.e. their coordinates are set to NaN). */
124
void
125
setConfidenceThreshold
(
int
threshold);
126
127
/** Enable temporal filtering of the depth data received from the device.
128
*
129
* The window size parameter is not relevant for `DepthSense_None`
130
* filtering type. */
131
void
132
enableTemporalFiltering
(
TemporalFilteringType
type, std::size_t window_size = 1);
133
134
/** Disable temporal filtering. */
135
void
136
disableTemporalFiltering
();
137
138
/** Get the serial number of device captured by the grabber. */
139
std::string
140
getDeviceSerialNumber
()
const
;
141
142
private
:
143
144
pcl::io::depth_sense::DepthSenseGrabberImpl
* p_;
145
friend
struct
pcl::io::depth_sense::DepthSenseGrabberImpl
;
146
147
};
148
149
}
pcl::DepthSenseGrabber::isRunning
virtual bool isRunning() const
Indicates whether the grabber is streaming or not.
pcl::DepthSenseGrabber::enableTemporalFiltering
void enableTemporalFiltering(TemporalFilteringType type, std::size_t window_size=1)
Enable temporal filtering of the depth data received from the device.
pcl::DepthSenseGrabber::~DepthSenseGrabber
virtual ~DepthSenseGrabber() noexcept
pcl::DepthSenseGrabber::stop
virtual void stop()
For devices that are streaming, the streams are stopped.
pcl::DepthSenseGrabber::sig_cb_depth_sense_point_cloud
void(const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &) sig_cb_depth_sense_point_cloud
Definition
depth_sense_grabber.h:64
pcl::DepthSenseGrabber::disableTemporalFiltering
void disableTemporalFiltering()
Disable temporal filtering.
pcl::DepthSenseGrabber::setConfidenceThreshold
void setConfidenceThreshold(int threshold)
Set the confidence threshold for depth data.
pcl::DepthSenseGrabber::start
virtual void start()
For devices that are streaming, the streams are started by calling this method.
pcl::DepthSenseGrabber::Ptr
shared_ptr< DepthSenseGrabber > Ptr
Definition
depth_sense_grabber.h:61
pcl::DepthSenseGrabber::DepthSenseGrabber
DepthSenseGrabber(const std::string &device_id="")
Create a grabber for a DepthSense device.
pcl::DepthSenseGrabber::getFramesPerSecond
virtual float getFramesPerSecond() const
returns fps.
pcl::DepthSenseGrabber::Mode
Mode
Definition
depth_sense_grabber.h:68
pcl::DepthSenseGrabber::DepthSense_QVGA_30Hz
@ DepthSense_QVGA_30Hz
Definition
depth_sense_grabber.h:69
pcl::DepthSenseGrabber::getDeviceSerialNumber
std::string getDeviceSerialNumber() const
Get the serial number of device captured by the grabber.
pcl::DepthSenseGrabber::sig_cb_depth_sense_point_cloud_rgba
void(const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &) sig_cb_depth_sense_point_cloud_rgba
Definition
depth_sense_grabber.h:65
pcl::DepthSenseGrabber::TemporalFilteringType
TemporalFilteringType
Definition
depth_sense_grabber.h:73
pcl::DepthSenseGrabber::DepthSense_Median
@ DepthSense_Median
Definition
depth_sense_grabber.h:75
pcl::DepthSenseGrabber::DepthSense_Average
@ DepthSense_Average
Definition
depth_sense_grabber.h:76
pcl::DepthSenseGrabber::DepthSense_None
@ DepthSense_None
Definition
depth_sense_grabber.h:74
pcl::DepthSenseGrabber::ConstPtr
shared_ptr< const DepthSenseGrabber > ConstPtr
Definition
depth_sense_grabber.h:62
pcl::DepthSenseGrabber::getName
virtual std::string getName() const
returns the name of the concrete subclass.
Definition
depth_sense_grabber.h:107
pcl::Grabber::Grabber
Grabber()=default
Default ctor.
pcl::PointCloud::ConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition
point_cloud.h:415
point_types.h
Defines all the PCL implemented PointT point type structures.
pcl::io::depth_sense
Definition
depth_sense_device_manager.h:56
pcl::io
Definition
io.h:517
pcl
Definition
convolution.h:46
pcl::io::depth_sense::DepthSenseGrabberImpl
Definition
depth_sense_grabber_impl.h:59