Point Cloud Library (PCL)  1.9.1-dev
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 */
57  {
58 
59  public:
60 
61  using Ptr = boost::shared_ptr<DepthSenseGrabber>;
62 
65 
66  enum Mode
67  {
68  DepthSense_QVGA_30Hz = 0,
69  };
70 
72  {
73  DepthSense_None = 0,
74  DepthSense_Median = 1,
75  DepthSense_Average = 2,
76  };
77 
78  /** Create a grabber for a DepthSense device.
79  *
80  * The grabber "captures" the device, making it impossible for other
81  * grabbers to interact with it. The device is "released" when the
82  * grabber is destructed.
83  *
84  * This will throw pcl::IOException if there are no free devices that
85  * match the supplied \a device_id.
86  *
87  * \param[in] device_id device identifier, which might be a serial
88  * number, an index (with '#' prefix), or an empty string (to select the
89  * first available device)
90  */
91  DepthSenseGrabber (const std::string& device_id = "");
92 
93  virtual
94  ~DepthSenseGrabber () throw ();
95 
96  virtual void
97  start ();
98 
99  virtual void
100  stop ();
101 
102  virtual bool
103  isRunning () const;
104 
105  virtual std::string
106  getName () const
107  {
108  return (std::string ("DepthSenseGrabber"));
109  }
110 
111  virtual float
112  getFramesPerSecond () const;
113 
114  /** Set the confidence threshold for depth data.
115  *
116  * Each pixel in a depth image output by the device has an associated
117  * confidence value. The higher this value is, the more reliable the
118  * datum is.
119  *
120  * The depth pixels (and their associated 3D points) are filtered based
121  * on the confidence value. Those that are below the threshold are
122  * discarded (i.e. their coordinates are set to NaN). */
123  void
124  setConfidenceThreshold (int threshold);
125 
126  /** Enable temporal filtering of the depth data received from the device.
127  *
128  * The window size parameter is not relevant for `DepthSense_None`
129  * filtering type. */
130  void
131  enableTemporalFiltering (TemporalFilteringType type, std::size_t window_size = 1);
132 
133  /** Disable temporal filtering. */
134  void
135  disableTemporalFiltering ();
136 
137  /** Get the serial number of device captured by the grabber. */
138  std::string
139  getDeviceSerialNumber () const;
140 
141  private:
142 
145 
146  };
147 
148 }
void(const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &) sig_cb_depth_sense_point_cloud_rgba
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
Grabber for DepthSense devices (e.g.
boost::shared_ptr< DepthSenseGrabber > Ptr
Grabber interface for PCL 1.x device drivers.
Definition: grabber.h:57
Defines all the PCL implemented PointT point type structures.
void(const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &) sig_cb_depth_sense_point_cloud
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:412
#define PCL_EXPORTS
Definition: pcl_macros.h:241