Loading...
Searching...
No Matches
pcl::ONIGrabber Class Reference
Module io

A simple ONI grabber. More...

`#include <pcl/io/oni_grabber.h>`

Inheritance diagram for pcl::ONIGrabber:

## Public Types

using | sig_cb_openni_image = void(const openni_wrapper::Image::Ptr &)
using | sig_cb_openni_depth_image = void(const openni_wrapper::DepthImage::Ptr &)
using | sig_cb_openni_ir_image = void(const openni_wrapper::IRImage::Ptr &)
using | sig_cb_openni_image_depth_image = void(const openni_wrapper::Image::Ptr &, const openni_wrapper::DepthImage::Ptr &, float)
using | sig_cb_openni_ir_depth_image = void(const openni_wrapper::IRImage::Ptr &, const openni_wrapper::DepthImage::Ptr &, float)
using | sig_cb_openni_point_cloud = void(const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &)
using | sig_cb_openni_point_cloud_rgb = void(const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr &)
using | sig_cb_openni_point_cloud_rgba = void(const pcl::PointCloud< pcl::PointXYZRGBA >::ConstPtr &)
using | sig_cb_openni_point_cloud_i = void(const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &)

## Public Member Functions

| ONIGrabber (const std::string &file_name, bool repeat, bool stream)
| constructor
| ~ONIGrabber () noexcept override
| destructor never throws an exception
void | start () override
| For devices that are streaming, the streams are started by calling this method.
void | stop () override
| For devices that are streaming, the streams are stopped.
std::string | getName () const override
| returns the name of the concrete subclass.
bool | isRunning () const override
| Indicates whether the grabber is streaming or not.
float | getFramesPerSecond () const override
| returns the frames pre second.
bool | hasDataLeft ()
| Check if there is any data left in the ONI file to process.
Public Member Functions inherited from pcl::Grabber
| Grabber ()=default
| Default ctor.
| Grabber (const Grabber &)=delete
| No copy ctor since Grabber can't be copied.
Grabber & | operator= (const Grabber &)=delete
| No copy assign operator since Grabber can't be copied.
| Grabber (Grabber &&)=default
| Move ctor.
Grabber & | operator= (Grabber &&)=default
| Move assign operator.
virtual | ~Grabber () noexcept=default
| virtual destructor.
template<typename T >
boost::signals2::connection | registerCallback (const std::function< T > &callback)
| registers a callback function/method to a signal with the corresponding signature
template<typename T >
bool | providesCallback () const noexcept
| indicates whether a signal with given parameter-type exists or not
bool | toggle ()
| For devices that are streaming, stopped streams are started and running stream are stopped.

## Protected Member Functions

void | imageCallback (openni_wrapper::Image::Ptr image, void *cookie)
| internal OpenNI (openni_wrapper) callback that handles image streams
void | depthCallback (openni_wrapper::DepthImage::Ptr depth_image, void *cookie)
| internal OpenNI (openni_wrapper) callback that handles depth streams
void | irCallback (openni_wrapper::IRImage::Ptr ir_image, void *cookie)
| internal OpenNI (openni_wrapper) callback that handles IR streams
void | imageDepthImageCallback (const openni_wrapper::Image::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image)
| internal callback that handles synchronized image + depth streams
void | irDepthImageCallback (const openni_wrapper::IRImage::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image)
| internal callback that handles synchronized IR + depth streams
pcl::PointCloud< pcl::PointXYZ >::Ptr | convertToXYZPointCloud (const openni_wrapper::DepthImage::Ptr &depth) const
| internal method to assemble a point cloud object
pcl::PointCloud< pcl::PointXYZRGB >::Ptr | convertToXYZRGBPointCloud (const openni_wrapper::Image::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image) const
| internal method to assemble a point cloud object
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | convertToXYZRGBAPointCloud (const openni_wrapper::Image::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image) const
| internal method to assemble a point cloud object
pcl::PointCloud< pcl::PointXYZI >::Ptr | convertToXYZIPointCloud (const openni_wrapper::IRImage::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image) const
| internal method to assemble a point cloud object
Protected Member Functions inherited from pcl::Grabber
virtual void | signalsChanged ()
template<typename T >
boost::signals2::signal< T > * | find_signal () const noexcept
template<typename T >
int | num_slots () const noexcept
template<typename T >
void | disconnect_all_slots ()
template<typename T >
void | block_signal ()
template<typename T >
void | unblock_signal ()
void | block_signals ()
void | unblock_signals ()
template<typename T >
boost::signals2::signal< T > * | createSignal ()

## Protected Attributes

Synchronizer< openni_wrapper::Image::Ptr, openni_wrapper::DepthImage::Ptr > | rgb_sync_
| synchronizer object to synchronize image and depth streams
Synchronizer< openni_wrapper::IRImage::Ptr, openni_wrapper::DepthImage::Ptr > | ir_sync_
| synchronizer object to synchronize IR and depth streams
openni_wrapper::DeviceONI::Ptr | device_
| the actual openni device
std::string | rgb_frame_id_
std::string | depth_frame_id_
bool | running_ {false}
unsigned | image_width_ {0}
unsigned | image_height_ {0}
unsigned | depth_width_ {0}
unsigned | depth_height_ {0}
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_ {}
Protected Attributes inherited from pcl::Grabber
std::map< std::string, std::unique_ptr< boost::signals2::signal_base > > | signals_
std::map< std::string, std::vector< boost::signals2::connection > > | connections_
std::map< std::string, std::vector< boost::signals2::shared_connection_block > > | shared_connections_

## Detailed Description

A simple ONI grabber.

Author
  Suat Gedikli

Definition at line 67 of file oni_grabber.h.

## Member Typedef Documentation

## sig_cb_openni_depth_image

using pcl::ONIGrabber::sig_cb_openni_depth_image = void (const openni_wrapper::DepthImage::Ptr &)

Definition at line 72 of file oni_grabber.h.

## sig_cb_openni_image

using pcl::ONIGrabber::sig_cb_openni_image = void (const openni_wrapper::Image::Ptr &)

Definition at line 71 of file oni_grabber.h.

## sig_cb_openni_image_depth_image

using pcl::ONIGrabber::sig_cb_openni_image_depth_image = void (const openni_wrapper::Image::Ptr &, const openni_wrapper::DepthImage::Ptr &, float)

Definition at line 74 of file oni_grabber.h.

## sig_cb_openni_ir_depth_image

using pcl::ONIGrabber::sig_cb_openni_ir_depth_image = void (const openni_wrapper::IRImage::Ptr &, const openni_wrapper::DepthImage::Ptr &, float)

Definition at line 75 of file oni_grabber.h.

## sig_cb_openni_ir_image

using pcl::ONIGrabber::sig_cb_openni_ir_image = void (const openni_wrapper::IRImage::Ptr &)

Definition at line 73 of file oni_grabber.h.

## sig_cb_openni_point_cloud

using pcl::ONIGrabber::sig_cb_openni_point_cloud = void (const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &)

Definition at line 76 of file oni_grabber.h.

## sig_cb_openni_point_cloud_i

using pcl::ONIGrabber::sig_cb_openni_point_cloud_i = void (const pcl::PointCloud<pcl::PointXYZI>::ConstPtr &)

Definition at line 79 of file oni_grabber.h.

## sig_cb_openni_point_cloud_rgb

using pcl::ONIGrabber::sig_cb_openni_point_cloud_rgb = void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr &)

Definition at line 77 of file oni_grabber.h.

## sig_cb_openni_point_cloud_rgba

using pcl::ONIGrabber::sig_cb_openni_point_cloud_rgba = void (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &)

Definition at line 78 of file oni_grabber.h.

## Constructor & Destructor Documentation

## ONIGrabber()

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

constructor

Parameters

  [in] | file_name | the path to the ONI file
  [in] | repeat | whether the play back should be in an infinite loop or not
  [in] | stream | whether the playback should be in streaming mode or in triggered mode.

## ~ONIGrabber()

pcl::ONIGrabber::~ONIGrabber | ( |  | ) |

override noexcept

destructor never throws an exception

## Member Function Documentation

## convertToXYZIPointCloud()

pcl::PointCloud< pcl::PointXYZI >::Ptr pcl::ONIGrabber::convertToXYZIPointCloud | ( | const openni_wrapper::IRImage::Ptr & | image,
|  | const openni_wrapper::DepthImage::Ptr & | depth_image
| ) |  | const

protected

internal method to assemble a point cloud object

## convertToXYZPointCloud()

pcl::PointCloud< pcl::PointXYZ >::Ptr pcl::ONIGrabber::convertToXYZPointCloud | ( | const openni_wrapper::DepthImage::Ptr & | depth | ) | const

protected

internal method to assemble a point cloud object

## convertToXYZRGBAPointCloud()

pcl::PointCloud< pcl::PointXYZRGBA >::Ptr pcl::ONIGrabber::convertToXYZRGBAPointCloud | ( | const openni_wrapper::Image::Ptr & | image,
|  | const openni_wrapper::DepthImage::Ptr & | depth_image
| ) |  | const

protected

internal method to assemble a point cloud object

## convertToXYZRGBPointCloud()

pcl::PointCloud< pcl::PointXYZRGB >::Ptr pcl::ONIGrabber::convertToXYZRGBPointCloud | ( | const openni_wrapper::Image::Ptr & | image,
|  | const openni_wrapper::DepthImage::Ptr & | depth_image
| ) |  | const

protected

internal method to assemble a point cloud object

## depthCallback()

void pcl::ONIGrabber::depthCallback | ( | openni_wrapper::DepthImage::Ptr | depth_image,
|  | void * | cookie
| ) |  |

protected

internal OpenNI (openni_wrapper) callback that handles depth streams

## getFramesPerSecond()

float pcl::ONIGrabber::getFramesPerSecond | ( |  | ) | const

override virtual

returns the frames pre second.

0 if it is trigger based.

Implements pcl::Grabber.

## getName()

std::string pcl::ONIGrabber::getName | ( |  | ) | const

override virtual

returns the name of the concrete subclass.

Returns
  the name of the concrete driver.

Implements pcl::Grabber.

## hasDataLeft()

bool pcl::ONIGrabber::hasDataLeft | ( |  | ) |

inline

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

Definition at line 121 of file oni_grabber.h.

## imageCallback()

void pcl::ONIGrabber::imageCallback | ( | openni_wrapper::Image::Ptr | image,
|  | void * | cookie
| ) |  |

protected

internal OpenNI (openni_wrapper) callback that handles image streams

## imageDepthImageCallback()

void pcl::ONIGrabber::imageDepthImageCallback | ( | const openni_wrapper::Image::Ptr & | image,
|  | const openni_wrapper::DepthImage::Ptr & | depth_image
| ) |  |

protected

internal callback that handles synchronized image + depth streams

## irCallback()

void pcl::ONIGrabber::irCallback | ( | openni_wrapper::IRImage::Ptr | ir_image,
|  | void * | cookie
| ) |  |

protected

internal OpenNI (openni_wrapper) callback that handles IR streams

## irDepthImageCallback()

void pcl::ONIGrabber::irDepthImageCallback | ( | const openni_wrapper::IRImage::Ptr & | image,
|  | const openni_wrapper::DepthImage::Ptr & | depth_image
| ) |  |

protected

internal callback that handles synchronized IR + depth streams

## isRunning()

bool pcl::ONIGrabber::isRunning | ( |  | ) | const

override 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.

## start()

void pcl::ONIGrabber::start | ( |  | ) |

override 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.

## stop()

void pcl::ONIGrabber::stop | ( |  | ) |

override virtual

For devices that are streaming, the streams are stopped.

This method has no effect for triggered devices.

Implements pcl::Grabber.

## Member Data Documentation

## depth_callback_handle

openni_wrapper::OpenNIDevice::CallbackHandle pcl::ONIGrabber::depth_callback_handle {}

protected

Definition at line 183 of file oni_grabber.h.

## depth_frame_id_

std::string pcl::ONIGrabber::depth_frame_id_

protected

Definition at line 177 of file oni_grabber.h.

## depth_height_

unsigned pcl::ONIGrabber::depth_height_ {0}

protected

Definition at line 182 of file oni_grabber.h.

## depth_image_signal_

boost::signals2::signal<sig_cb_openni_depth_image >* pcl::ONIGrabber::depth_image_signal_ {}

protected

Definition at line 187 of file oni_grabber.h.

## depth_width_

unsigned pcl::ONIGrabber::depth_width_ {0}

protected

Definition at line 181 of file oni_grabber.h.

## device_

openni_wrapper::DeviceONI::Ptr pcl::ONIGrabber::device_

protected

the actual openni device

Definition at line 175 of file oni_grabber.h.

## image_callback_handle

openni_wrapper::OpenNIDevice::CallbackHandle pcl::ONIGrabber::image_callback_handle {}

protected

Definition at line 184 of file oni_grabber.h.

## image_depth_image_signal_

boost::signals2::signal<sig_cb_openni_image_depth_image>* pcl::ONIGrabber::image_depth_image_signal_ {}

protected

Definition at line 189 of file oni_grabber.h.

## image_height_

unsigned pcl::ONIGrabber::image_height_ {0}

protected

Definition at line 180 of file oni_grabber.h.

## image_signal_

boost::signals2::signal<sig_cb_openni_image >* pcl::ONIGrabber::image_signal_ {}

protected

Definition at line 186 of file oni_grabber.h.

## image_width_

unsigned pcl::ONIGrabber::image_width_ {0}

protected

Definition at line 179 of file oni_grabber.h.

## ir_callback_handle

openni_wrapper::OpenNIDevice::CallbackHandle pcl::ONIGrabber::ir_callback_handle {}

protected

Definition at line 185 of file oni_grabber.h.

## ir_depth_image_signal_

boost::signals2::signal<sig_cb_openni_ir_depth_image>* pcl::ONIGrabber::ir_depth_image_signal_ {}

protected

Definition at line 190 of file oni_grabber.h.

## ir_image_signal_

boost::signals2::signal<sig_cb_openni_ir_image >* pcl::ONIGrabber::ir_image_signal_ {}

protected

Definition at line 188 of file oni_grabber.h.

## ir_sync_

Synchronizer<openni_wrapper::IRImage::Ptr, openni_wrapper::DepthImage::Ptr > pcl::ONIGrabber::ir_sync_

protected

synchronizer object to synchronize IR and depth streams

Definition at line 172 of file oni_grabber.h.

## point_cloud_i_signal_

boost::signals2::signal<sig_cb_openni_point_cloud_i >* pcl::ONIGrabber::point_cloud_i_signal_ {}

protected

Definition at line 192 of file oni_grabber.h.

## point_cloud_rgb_signal_

boost::signals2::signal<sig_cb_openni_point_cloud_rgb >* pcl::ONIGrabber::point_cloud_rgb_signal_ {}

protected

Definition at line 193 of file oni_grabber.h.

## point_cloud_rgba_signal_

boost::signals2::signal<sig_cb_openni_point_cloud_rgba >* pcl::ONIGrabber::point_cloud_rgba_signal_ {}

protected

Definition at line 194 of file oni_grabber.h.

## point_cloud_signal_

boost::signals2::signal<sig_cb_openni_point_cloud >* pcl::ONIGrabber::point_cloud_signal_ {}

protected

Definition at line 191 of file oni_grabber.h.

## rgb_frame_id_

std::string pcl::ONIGrabber::rgb_frame_id_

protected

Definition at line 176 of file oni_grabber.h.

## rgb_sync_

Synchronizer<openni_wrapper::Image::Ptr, openni_wrapper::DepthImage::Ptr > pcl::ONIGrabber::rgb_sync_

protected

synchronizer object to synchronize image and depth streams

Definition at line 169 of file oni_grabber.h.

## running_

bool pcl::ONIGrabber::running_ {false}

protected

Definition at line 178 of file oni_grabber.h.

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

- pcl/io/oni_grabber.h