Point Cloud Library (PCL)  1.10.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 
63 
66 
67  enum Mode
68  {
69  DepthSense_QVGA_30Hz = 0,
70  };
71 
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 
146 
147  };
148 
149 }
void(const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &) sig_cb_depth_sense_point_cloud_rgba
shared_ptr< const DepthSenseGrabber > ConstPtr
Grabber for DepthSense devices (e.g.
Grabber interface for PCL 1.x device drivers.
Definition: grabber.h:59
Defines all the PCL implemented PointT point type structures.
shared_ptr< DepthSenseGrabber > Ptr
void(const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &) sig_cb_depth_sense_point_cloud
shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:415
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
Definition: memory.h:81
#define PCL_EXPORTS
Definition: pcl_macros.h:237