40 #ifndef __PCL_IO_ONI_PLAYER__
41 #define __PCL_IO_ONI_PLAYER__
52 #include <boost/thread/mutex.hpp>
71 typedef void (sig_cb_openni_image) (
const boost::shared_ptr<openni_wrapper::Image>&);
72 typedef void (sig_cb_openni_depth_image) (
const boost::shared_ptr<openni_wrapper::DepthImage>&);
73 typedef void (sig_cb_openni_ir_image) (
const boost::shared_ptr<openni_wrapper::IRImage>&);
74 typedef void (sig_cb_openni_image_depth_image) (
const boost::shared_ptr<openni_wrapper::Image>&,
const boost::shared_ptr<openni_wrapper::DepthImage>&,
float constant) ;
75 typedef void (sig_cb_openni_ir_depth_image) (
const boost::shared_ptr<openni_wrapper::IRImage>&,
const boost::shared_ptr<openni_wrapper::DepthImage>&,
float constant) ;
76 typedef void (sig_cb_openni_point_cloud) (
const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&);
77 typedef void (sig_cb_openni_point_cloud_rgb) (
const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGB> >&);
78 typedef void (sig_cb_openni_point_cloud_rgba) (
const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZRGBA> >&);
79 typedef void (sig_cb_openni_point_cloud_i) (
const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZI> >&);
86 ONIGrabber (
const std::string& file_name,
bool repeat,
bool stream);
89 virtual ~ONIGrabber () throw ();
117 getFramesPerSecond () const;
122 imageCallback (boost::shared_ptr<openni_wrapper::Image> image,
void* cookie);
126 depthCallback (boost::shared_ptr<openni_wrapper::DepthImage> depth_image,
void* cookie);
130 irCallback (boost::shared_ptr<openni_wrapper::IRImage> ir_image,
void* cookie);
134 imageDepthImageCallback (const boost::shared_ptr<openni_wrapper::Image> &image,
135 const boost::shared_ptr<openni_wrapper::DepthImage> &depth_image);
139 irDepthImageCallback (const boost::shared_ptr<openni_wrapper::IRImage> &image,
140 const boost::shared_ptr<openni_wrapper::DepthImage> &depth_image);
143 boost::shared_ptr<pcl::
PointCloud<pcl::PointXYZ> >
144 convertToXYZPointCloud (const boost::shared_ptr<openni_wrapper::DepthImage> &depth) const;
147 boost::shared_ptr<pcl::
PointCloud<pcl::PointXYZRGB> >
148 convertToXYZRGBPointCloud (const boost::shared_ptr<openni_wrapper::Image> &image,
149 const boost::shared_ptr<openni_wrapper::DepthImage> &depth_image) const;
152 boost::shared_ptr<pcl::
PointCloud<pcl::PointXYZRGBA> >
153 convertToXYZRGBAPointCloud (const boost::shared_ptr<openni_wrapper::Image> &image,
154 const boost::shared_ptr<openni_wrapper::DepthImage> &depth_image) const;
157 boost::shared_ptr<pcl::
PointCloud<pcl::PointXYZI> >
158 convertToXYZIPointCloud (const boost::shared_ptr<openni_wrapper::IRImage> &image,
159 const boost::shared_ptr<openni_wrapper::DepthImage> &depth_image) const;
162 Synchronizer<boost::shared_ptr<openni_wrapper::Image>, boost::shared_ptr<openni_wrapper::DepthImage> > rgb_sync_;
165 Synchronizer<boost::shared_ptr<openni_wrapper::IRImage>, boost::shared_ptr<openni_wrapper::DepthImage> > ir_sync_;
168 boost::shared_ptr<openni_wrapper::DeviceONI> device_;
169 std::
string rgb_frame_id_;
170 std::
string depth_frame_id_;
172 unsigned image_width_;
173 unsigned image_height_;
174 unsigned depth_width_;
175 unsigned depth_height_;
176 openni_wrapper::OpenNIDevice::CallbackHandle depth_callback_handle;
177 openni_wrapper::OpenNIDevice::CallbackHandle image_callback_handle;
178 openni_wrapper::OpenNIDevice::CallbackHandle ir_callback_handle;
179 boost::signals2::signal<sig_cb_openni_image >* image_signal_;
180 boost::signals2::signal<sig_cb_openni_depth_image >* depth_image_signal_;
181 boost::signals2::signal<sig_cb_openni_ir_image >* ir_image_signal_;
182 boost::signals2::signal<sig_cb_openni_image_depth_image>* image_depth_image_signal_;
183 boost::signals2::signal<sig_cb_openni_ir_depth_image>* ir_depth_image_signal_;
184 boost::signals2::signal<sig_cb_openni_point_cloud >* point_cloud_signal_;
185 boost::signals2::signal<sig_cb_openni_point_cloud_i >* point_cloud_i_signal_;
186 boost::signals2::signal<sig_cb_openni_point_cloud_rgb >* point_cloud_rgb_signal_;
187 boost::signals2::signal<sig_cb_openni_point_cloud_rgba >* point_cloud_rgba_signal_;
190 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
195 #endif // __PCL_IO_ONI_PLAYER__
196 #endif // HAVE_OPENNI