Point Cloud Library (PCL)  1.7.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::ONIGrabber Class Reference

A simple ONI grabber. More...

#include <pcl/io/oni_grabber.h>

+ Inheritance diagram for pcl::ONIGrabber:

List of all members.

Public Types

typedef void( sig_cb_openni_image )(const boost::shared_ptr< openni_wrapper::Image > &)
typedef void( sig_cb_openni_depth_image )(const boost::shared_ptr< openni_wrapper::DepthImage > &)
typedef void( sig_cb_openni_ir_image )(const boost::shared_ptr< openni_wrapper::IRImage > &)
typedef void( sig_cb_openni_image_depth_image )(const boost::shared_ptr< openni_wrapper::Image > &, const boost::shared_ptr< openni_wrapper::DepthImage > &, float constant)
typedef void( sig_cb_openni_ir_depth_image )(const boost::shared_ptr< openni_wrapper::IRImage > &, const boost::shared_ptr< openni_wrapper::DepthImage > &, float constant)
typedef void( sig_cb_openni_point_cloud )(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZ > > &)
typedef void( sig_cb_openni_point_cloud_rgb )(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZRGB > > &)
typedef void( sig_cb_openni_point_cloud_rgba )(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZRGBA > > &)
typedef void( sig_cb_openni_point_cloud_i )(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZI > > &)

Public Member Functions

 ONIGrabber (const std::string &file_name, bool repeat, bool stream)
 constuctor
virtual ~ONIGrabber () throw ()
 destructor never throws an exception
virtual void start ()
 For devices that are streaming, the streams are started by calling this method.
virtual void stop ()
 For devices that are streaming, the streams are stopped.
virtual std::string getName () const
 returns the name of the concrete subclass.
virtual bool isRunning () const
 Indicates whether the grabber is streaming or not.
virtual float getFramesPerSecond () const
 returns the frames pre second.
bool hasDataLeft ()
 Check if there is any data left in the ONI file to process.

Protected Member Functions

void imageCallback (boost::shared_ptr< openni_wrapper::Image > image, void *cookie)
 internal OpenNI (openni_wrapper) callback that handles image streams
void depthCallback (boost::shared_ptr< openni_wrapper::DepthImage > depth_image, void *cookie)
 internal OpenNI (openni_wrapper) callback that handles depth streams
void irCallback (boost::shared_ptr< openni_wrapper::IRImage > ir_image, void *cookie)
 internal OpenNI (openni_wrapper) callback that handles IR streams
void imageDepthImageCallback (const boost::shared_ptr< openni_wrapper::Image > &image, const boost::shared_ptr< openni_wrapper::DepthImage > &depth_image)
 internal callback that handles synchronized image + depth streams
void irDepthImageCallback (const boost::shared_ptr< openni_wrapper::IRImage > &image, const boost::shared_ptr< openni_wrapper::DepthImage > &depth_image)
 internal callback that handles synchronized IR + depth streams
boost::shared_ptr
< pcl::PointCloud
< pcl::PointXYZ > > 
convertToXYZPointCloud (const boost::shared_ptr< openni_wrapper::DepthImage > &depth) const
 internal method to assemble a point cloud object
boost::shared_ptr
< pcl::PointCloud
< pcl::PointXYZRGB > > 
convertToXYZRGBPointCloud (const boost::shared_ptr< openni_wrapper::Image > &image, const boost::shared_ptr< openni_wrapper::DepthImage > &depth_image) const
 internal method to assemble a point cloud object
boost::shared_ptr
< pcl::PointCloud
< pcl::PointXYZRGBA > > 
convertToXYZRGBAPointCloud (const boost::shared_ptr< openni_wrapper::Image > &image, const boost::shared_ptr< openni_wrapper::DepthImage > &depth_image) const
 internal method to assemble a point cloud object
boost::shared_ptr
< pcl::PointCloud
< pcl::PointXYZI > > 
convertToXYZIPointCloud (const boost::shared_ptr< openni_wrapper::IRImage > &image, const boost::shared_ptr< openni_wrapper::DepthImage > &depth_image) const
 internal method to assemble a point cloud object

Protected Attributes

Synchronizer
< boost::shared_ptr
< openni_wrapper::Image >
, boost::shared_ptr
< openni_wrapper::DepthImage > > 
rgb_sync_
 synchronizer object to synchronize image and depth streams
Synchronizer
< boost::shared_ptr
< openni_wrapper::IRImage >
, boost::shared_ptr
< openni_wrapper::DepthImage > > 
ir_sync_
 synchronizer object to synchronize IR and depth streams
boost::shared_ptr
< openni_wrapper::DeviceONI
device_
 the actual openni device
std::string rgb_frame_id_
std::string depth_frame_id_
bool running_
unsigned image_width_
unsigned image_height_
unsigned depth_width_
unsigned depth_height_
openni_wrapper::OpenNIDevice::CallbackHandle depth_callback_handle
openni_wrapper::OpenNIDevice::CallbackHandle image_callback_handle
openni_wrapper::OpenNIDevice::CallbackHandle ir_callback_handle
boost::signals2::signal
< sig_cb_openni_image > * 
image_signal_
boost::signals2::signal
< sig_cb_openni_depth_image > * 
depth_image_signal_
boost::signals2::signal
< sig_cb_openni_ir_image > * 
ir_image_signal_
boost::signals2::signal
< sig_cb_openni_image_depth_image > * 
image_depth_image_signal_
boost::signals2::signal
< sig_cb_openni_ir_depth_image > * 
ir_depth_image_signal_
boost::signals2::signal
< sig_cb_openni_point_cloud > * 
point_cloud_signal_
boost::signals2::signal
< sig_cb_openni_point_cloud_i > * 
point_cloud_i_signal_
boost::signals2::signal
< sig_cb_openni_point_cloud_rgb > * 
point_cloud_rgb_signal_
boost::signals2::signal
< sig_cb_openni_point_cloud_rgba > * 
point_cloud_rgba_signal_

Detailed Description

A simple ONI grabber.

Author:
Suat Gedikli

Definition at line 73 of file oni_grabber.h.


Member Typedef Documentation

typedef void( pcl::ONIGrabber::sig_cb_openni_depth_image)(const boost::shared_ptr< openni_wrapper::DepthImage > &)

Definition at line 78 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_image)(const boost::shared_ptr< openni_wrapper::Image > &)

Definition at line 77 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_image_depth_image)(const boost::shared_ptr< openni_wrapper::Image > &, const boost::shared_ptr< openni_wrapper::DepthImage > &, float constant)

Definition at line 80 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_ir_depth_image)(const boost::shared_ptr< openni_wrapper::IRImage > &, const boost::shared_ptr< openni_wrapper::DepthImage > &, float constant)

Definition at line 81 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_ir_image)(const boost::shared_ptr< openni_wrapper::IRImage > &)

Definition at line 79 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_point_cloud)(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZ > > &)

Definition at line 82 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_point_cloud_i)(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZI > > &)

Definition at line 85 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_point_cloud_rgb)(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZRGB > > &)

Definition at line 83 of file oni_grabber.h.

typedef void( pcl::ONIGrabber::sig_cb_openni_point_cloud_rgba)(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZRGBA > > &)

Definition at line 84 of file oni_grabber.h.


Constructor & Destructor Documentation

pcl::ONIGrabber::ONIGrabber ( const std::string &  file_name,
bool  repeat,
bool  stream 
)

constuctor

Parameters:
[in]file_namethe path to the ONI file
[in]repeatwhether the play back should be in an infinite loop or not
[in]streamwhether the playback should be in streaming mode or in triggered mode.
virtual pcl::ONIGrabber::~ONIGrabber ( ) throw () [virtual]

destructor never throws an exception


Member Function Documentation

boost::shared_ptr<pcl::PointCloud<pcl::PointXYZI> > pcl::ONIGrabber::convertToXYZIPointCloud ( const boost::shared_ptr< openni_wrapper::IRImage > &  image,
const boost::shared_ptr< openni_wrapper::DepthImage > &  depth_image 
) const [protected]

internal method to assemble a point cloud object

boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> > pcl::ONIGrabber::convertToXYZPointCloud ( const boost::shared_ptr< openni_wrapper::DepthImage > &  depth) const [protected]

internal method to assemble a point cloud object

boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBA> > pcl::ONIGrabber::convertToXYZRGBAPointCloud ( const boost::shared_ptr< openni_wrapper::Image > &  image,
const boost::shared_ptr< openni_wrapper::DepthImage > &  depth_image 
) const [protected]

internal method to assemble a point cloud object

boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > pcl::ONIGrabber::convertToXYZRGBPointCloud ( const boost::shared_ptr< openni_wrapper::Image > &  image,
const boost::shared_ptr< openni_wrapper::DepthImage > &  depth_image 
) const [protected]

internal method to assemble a point cloud object

void pcl::ONIGrabber::depthCallback ( boost::shared_ptr< openni_wrapper::DepthImage depth_image,
void *  cookie 
) [protected]

internal OpenNI (openni_wrapper) callback that handles depth streams

virtual float pcl::ONIGrabber::getFramesPerSecond ( ) const [virtual]

returns the frames pre second.

0 if it is trigger based.

Implements pcl::Grabber.

virtual std::string pcl::ONIGrabber::getName ( ) const [virtual]

returns the name of the concrete subclass.

Returns:
the name of the concrete driver.

Implements pcl::Grabber.

bool pcl::ONIGrabber::hasDataLeft ( ) [inline]

Check if there is any data left in the ONI file to process.

Definition at line 127 of file oni_grabber.h.

void pcl::ONIGrabber::imageCallback ( boost::shared_ptr< openni_wrapper::Image image,
void *  cookie 
) [protected]

internal OpenNI (openni_wrapper) callback that handles image streams

void pcl::ONIGrabber::imageDepthImageCallback ( const boost::shared_ptr< openni_wrapper::Image > &  image,
const boost::shared_ptr< openni_wrapper::DepthImage > &  depth_image 
) [protected]

internal callback that handles synchronized image + depth streams

void pcl::ONIGrabber::irCallback ( boost::shared_ptr< openni_wrapper::IRImage ir_image,
void *  cookie 
) [protected]

internal OpenNI (openni_wrapper) callback that handles IR streams

void pcl::ONIGrabber::irDepthImageCallback ( const boost::shared_ptr< openni_wrapper::IRImage > &  image,
const boost::shared_ptr< openni_wrapper::DepthImage > &  depth_image 
) [protected]

internal callback that handles synchronized IR + depth streams

virtual bool pcl::ONIGrabber::isRunning ( ) const [virtual]

Indicates whether the grabber is streaming or not.

This value is not defined for triggered devices.

Returns:
true if grabber is running / streaming. False otherwise.

Implements pcl::Grabber.

virtual void pcl::ONIGrabber::start ( ) [virtual]

For devices that are streaming, the streams are started by calling this method.

Trigger-based devices, just trigger the device once for each call of start.

Implements pcl::Grabber.

virtual void pcl::ONIGrabber::stop ( ) [virtual]

For devices that are streaming, the streams are stopped.

This method has no effect for triggered devices.

Implements pcl::Grabber.


Member Data Documentation

Definition at line 189 of file oni_grabber.h.

std::string pcl::ONIGrabber::depth_frame_id_ [protected]

Definition at line 183 of file oni_grabber.h.

unsigned pcl::ONIGrabber::depth_height_ [protected]

Definition at line 188 of file oni_grabber.h.

boost::signals2::signal<sig_cb_openni_depth_image >* pcl::ONIGrabber::depth_image_signal_ [protected]

Definition at line 193 of file oni_grabber.h.

unsigned pcl::ONIGrabber::depth_width_ [protected]

Definition at line 187 of file oni_grabber.h.

boost::shared_ptr<openni_wrapper::DeviceONI> pcl::ONIGrabber::device_ [protected]

the actual openni device

Definition at line 181 of file oni_grabber.h.

Definition at line 190 of file oni_grabber.h.

Definition at line 195 of file oni_grabber.h.

unsigned pcl::ONIGrabber::image_height_ [protected]

Definition at line 186 of file oni_grabber.h.

boost::signals2::signal<sig_cb_openni_image >* pcl::ONIGrabber::image_signal_ [protected]

Definition at line 192 of file oni_grabber.h.

unsigned pcl::ONIGrabber::image_width_ [protected]

Definition at line 185 of file oni_grabber.h.

Definition at line 191 of file oni_grabber.h.

Definition at line 196 of file oni_grabber.h.

boost::signals2::signal<sig_cb_openni_ir_image >* pcl::ONIGrabber::ir_image_signal_ [protected]

Definition at line 194 of file oni_grabber.h.

Synchronizer<boost::shared_ptr<openni_wrapper::IRImage>, boost::shared_ptr<openni_wrapper::DepthImage> > pcl::ONIGrabber::ir_sync_ [protected]

synchronizer object to synchronize IR and depth streams

Definition at line 178 of file oni_grabber.h.

Definition at line 198 of file oni_grabber.h.

Definition at line 199 of file oni_grabber.h.

Definition at line 200 of file oni_grabber.h.

boost::signals2::signal<sig_cb_openni_point_cloud >* pcl::ONIGrabber::point_cloud_signal_ [protected]

Definition at line 197 of file oni_grabber.h.

std::string pcl::ONIGrabber::rgb_frame_id_ [protected]

Definition at line 182 of file oni_grabber.h.

Synchronizer<boost::shared_ptr<openni_wrapper::Image>, boost::shared_ptr<openni_wrapper::DepthImage> > pcl::ONIGrabber::rgb_sync_ [protected]

synchronizer object to synchronize image and depth streams

Definition at line 175 of file oni_grabber.h.

bool pcl::ONIGrabber::running_ [protected]

Definition at line 184 of file oni_grabber.h.


The documentation for this class was generated from the following file: