point_cloud_library / latest / classpcl_1_1_open_n_i_grabber.html

Grabber for OpenNI devices (i.e., Primesense PSDK, Microsoft Kinect, Asus XTion Pro/Live) More...

#include <pcl/io/openni_grabber.h>

Classes

struct modeComp

Public Member Functions

OpenNIGrabber (const std::string &device_id="", const Mode &depth_mode=OpenNI_Default_Mode, const Mode &image_mode=OpenNI_Default_Mode)
Constructor. More...
~OpenNIGrabber () noexcept override
virtual Destructor inherited from the Grabber interface. More...
void start () override
Start the data acquisition. More...
void stop () override
Stop the data acquisition. More...
bool isRunning () const override
Check if the data acquisition is still running. More...
std::string getName () const override
returns the name of the concrete subclass. More...
float getFramesPerSecond () const override
Obtain the number of frames per second (FPS). More...
openni_wrapper::OpenNIDevice::Ptr getDevice () const
Get a pcl::shared pointer to the openni_wrapper::OpenNIDevice object. More...
std::vector< std::pair< int, XnMapOutputMode > > getAvailableDepthModes () const
Obtain a list of the available depth modes that this device supports. More...
std::vector< std::pair< int, XnMapOutputMode > > getAvailableImageModes () const
Obtain a list of the available image modes that this device supports. More...
void setRGBCameraIntrinsics (const double rgb_focal_length_x, const double rgb_focal_length_y, const double rgb_principal_point_x, const double rgb_principal_point_y)
Set the RGB camera parameters (fx, fy, cx, cy) More...
void getRGBCameraIntrinsics (double &rgb_focal_length_x, double &rgb_focal_length_y, double &rgb_principal_point_x, double &rgb_principal_point_y) const
Get the RGB camera parameters (fx, fy, cx, cy) More...
void setRGBFocalLength (const double rgb_focal_length)
Set the RGB image focal length (fx = fy). More...
void setRGBFocalLength (const double rgb_focal_length_x, const double rgb_focal_length_y)
Set the RGB image focal length. More...
void getRGBFocalLength (double &rgb_focal_length_x, double &rgb_focal_length_y) const
Return the RGB focal length parameters (fx, fy) More...
void setDepthCameraIntrinsics (const double depth_focal_length_x, const double depth_focal_length_y, const double depth_principal_point_x, const double depth_principal_point_y)
Set the Depth camera parameters (fx, fy, cx, cy) More...
void getDepthCameraIntrinsics (double &depth_focal_length_x, double &depth_focal_length_y, double &depth_principal_point_x, double &depth_principal_point_y) const
Get the Depth camera parameters (fx, fy, cx, cy) More...
void setDepthFocalLength (const double depth_focal_length)
Set the Depth image focal length (fx = fy). More...
void setDepthFocalLength (const double depth_focal_length_x, const double depth_focal_length_y)
Set the Depth image focal length. More...
void getDepthFocalLength (double &depth_focal_length_x, double &depth_focal_length_y) const
Return the Depth focal length parameters (fx, fy) More...
void convertShiftToDepth (const std::uint16_t *shift_data_ptr, std::uint16_t *depth_data_ptr, std::size_t size) const
Convert vector of raw shift values to depth values. More...
- Public Member Functions inherited from pcl::Grabber
Grabber ()=default
Default ctor. More...
Grabber (const Grabber &)=delete
No copy ctor since Grabber can't be copied. More...
Grabber & operator= (const Grabber &)=delete
No copy assign operator since Grabber can't be copied. More...
Grabber (Grabber &&)=default
Move ctor. More...
Grabber & operator= (Grabber &&)=default
Move assign operator. More...
virtual ~Grabber () noexcept=default
virtual destructor. More...
template<typename T >
boost::signals2::connection registerCallback (const std::function< T > &callback)
registers a callback function/method to a signal with the corresponding signature More...
template<typename T >
bool providesCallback () const noexcept
indicates whether a signal with given parameter-type exists or not More...
bool toggle ()
For devices that are streaming, stopped streams are started and running stream are stopped. More...

Protected Member Functions

void onInit (const std::string &device_id, const Mode &depth_mode, const Mode &image_mode)
On initialization processing. More...
void setupDevice (const std::string &device_id, const Mode &depth_mode, const Mode &image_mode)
Sets up an OpenNI device. More...
void updateModeMaps ()
Update mode maps. More...
void startSynchronization ()
Start synchronization. More...
void stopSynchronization ()
Stop synchronization. More...
bool mapConfigMode2XnMode (int mode, XnMapOutputMode &xnmode) const
Map config modes. More...
virtual void imageCallback (openni_wrapper::Image::Ptr image, void *cookie)
RGB image callback. More...
virtual void depthCallback (openni_wrapper::DepthImage::Ptr depth_image, void *cookie)
Depth image callback. More...
virtual void irCallback (openni_wrapper::IRImage::Ptr ir_image, void *cookie)
IR image callback. More...
virtual void imageDepthImageCallback (const openni_wrapper::Image::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image)
RGB + Depth image callback. More...
virtual void irDepthImageCallback (const openni_wrapper::IRImage::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image)
IR + Depth image callback. More...
void signalsChanged () override
Process changed signals. More...
virtual void checkImageAndDepthSynchronizationRequired ()
Check if the RGB and Depth images are required to be synchronized or not. More...
virtual void checkImageStreamRequired ()
Check if the RGB image stream is required or not. More...
virtual void checkDepthStreamRequired ()
Check if the depth stream is required or not. More...
virtual void checkIRStreamRequired ()
Check if the IR image stream is required or not. More...
pcl::PointCloud< pcl::PointXYZ >::Ptr convertToXYZPointCloud (const openni_wrapper::DepthImage::Ptr &depth) const
Convert a Depth image to a pcl::PointCloud<pcl::PointXYZ> More...
template<typename PointT >
pcl::PointCloud< PointT >::Ptr convertToXYZRGBPointCloud (const openni_wrapper::Image::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image) const
Convert a Depth + RGB image pair to a pcl::PointCloud<PointT> More...
pcl::PointCloud< pcl::PointXYZI >::Ptr convertToXYZIPointCloud (const openni_wrapper::IRImage::Ptr &image, const openni_wrapper::DepthImage::Ptr &depth_image) const
Convert a Depth + Intensity image pair to a pcl::PointCloud<pcl::PointXYZI> More...
- Protected Member Functions inherited from pcl::Grabber
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< openni_wrapper::IRImage::Ptr, openni_wrapper::DepthImage::Ptr > ir_sync_
openni_wrapper::OpenNIDevice::Ptr device_
The actual openni device. More...
std::string rgb_frame_id_
std::string depth_frame_id_
unsigned image_width_
unsigned image_height_
unsigned depth_width_
unsigned depth_height_
bool image_required_
bool depth_required_
bool ir_required_
bool sync_required_
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_
std::map< int, XnMapOutputMode > config2xn_map_
openni_wrapper::OpenNIDevice::CallbackHandle depth_callback_handle
openni_wrapper::OpenNIDevice::CallbackHandle image_callback_handle
openni_wrapper::OpenNIDevice::CallbackHandle ir_callback_handle
bool running_
unsigned rgb_array_size_
unsigned depth_buffer_size_
boost::shared_array< unsigned char > rgb_array_
boost::shared_array< unsigned short > depth_buffer_
boost::shared_array< unsigned short > ir_buffer_
double rgb_focal_length_x_
The RGB image focal length (fx). More...
double rgb_focal_length_y_
The RGB image focal length (fy). More...
double rgb_principal_point_x_
The RGB image principal point (cx). More...
double rgb_principal_point_y_
The RGB image principal point (cy). More...
double depth_focal_length_x_
The depth image focal length (fx). More...
double depth_focal_length_y_
The depth image focal length (fy). More...
double depth_principal_point_x_
The depth image principal point (cx). More...
double depth_principal_point_y_
The depth image principal point (cy). More...
- 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

Grabber for OpenNI devices (i.e., Primesense PSDK, Microsoft Kinect, Asus XTion Pro/Live)

Author
Nico Blodow blodo.nosp@m.w@cs.nosp@m..tum..nosp@m.edu, Suat Gedikli gedik.nosp@m.li@w.nosp@m.illow.nosp@m.gara.nosp@m.ge.co.nosp@m.m

Definition at line 69 of file openni_grabber.h.

Member Typedef Documentation

ConstPtr

using pcl::OpenNIGrabber::ConstPtr = shared_ptr<const OpenNIGrabber>

Definition at line 73 of file openni_grabber.h.

Ptr

Definition at line 72 of file openni_grabber.h.

sig_cb_openni_depth_image

sig_cb_openni_image

Definition at line 90 of file openni_grabber.h.

sig_cb_openni_image_depth_image

sig_cb_openni_ir_depth_image

sig_cb_openni_ir_image

sig_cb_openni_point_cloud