Point Cloud Library (PCL)  1.14.0-dev
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
openni_wrapper::OpenNIDriver Class Reference

Driver class implemented as Singleton. More...

#include <pcl/io/openni_camera/openni_driver.h>

Classes

struct  DeviceContext
 

Public Member Functions

 ~OpenNIDriver () noexcept
 virtual Destructor that never throws an exception More...
 
unsigned updateDeviceList ()
 enumerates all devices and updates the list of available devices. More...
 
unsigned getNumberDevices () const noexcept
 
OpenNIDevice::Ptr createVirtualDevice (const std::string &path, bool repeat, bool stream) const
 creates a virtual device from an ONI file. More...
 
OpenNIDevice::Ptr getDeviceByIndex (unsigned index) const
 returns the device with a given index, where the index is its position in the device list. More...
 
OpenNIDevice::Ptr getDeviceBySerialNumber (const std::string &serial_number) const
 returns the device with the given serial number. More...
 
const char * getSerialNumber (unsigned index) const noexcept
 method to retrieve the serial number of a device without creating it. More...
 
const char * getConnectionString (unsigned index) const noexcept
 method to retrieve the connection string of a device without creating it. More...
 
const char * getVendorName (unsigned index) const noexcept
 method to retrieve the vendor name of the USB device without creating it. More...
 
const char * getProductName (unsigned index) const noexcept
 method to retrieve the product name of the USB device without creating it. More...
 
unsigned short getVendorID (unsigned index) const noexcept
 method to retrieve the vendor id of the USB device without creating it. More...
 
unsigned short getProductID (unsigned index) const noexcept
 method to retrieve the product id of the USB device without creating it. More...
 
unsigned char getBus (unsigned index) const noexcept
 method to retrieve the bus id of the USB device without creating it. More...
 
unsigned char getAddress (unsigned index) const noexcept
 method to retrieve the vaddress of the USB device without creating it. More...
 
void stopAll ()
 stops all streams from all devices. More...
 

Static Public Member Functions

static OpenNIDrivergetInstance ()
 static access method to the only instance. More...
 
static void getDeviceType (const std::string &connection_string, unsigned short &vendorId, unsigned short &productId)
 decomposes the connection string into vendor id and product id. More...
 

Protected Member Functions

 OpenNIDriver ()
 
OpenNIDevice::Ptr getDevice (unsigned index) const
 

Protected Attributes

std::vector< DeviceContextdevice_context_
 
xn::Context context_
 
std::map< unsigned char, std::map< unsigned char, unsigned > > bus_map_
 
std::map< std::string, unsigned > serial_map_
 
std::map< std::string, unsigned > connection_string_map_
 

Detailed Description

Driver class implemented as Singleton.

This class contains the xn::Context object used by all devices. It \ provides methods for enumerating and accessing devices.

Author
Suat Gedikli
Date
02.january 2011

Definition at line 65 of file openni_driver.h.

Constructor & Destructor Documentation

◆ ~OpenNIDriver()

openni_wrapper::OpenNIDriver::~OpenNIDriver ( )
noexcept

virtual Destructor that never throws an exception

Author
Suat Gedikli

◆ OpenNIDriver()

openni_wrapper::OpenNIDriver::OpenNIDriver ( )
protected

Member Function Documentation

◆ createVirtualDevice()

OpenNIDevice::Ptr openni_wrapper::OpenNIDriver::createVirtualDevice ( const std::string &  path,
bool  repeat,
bool  stream 
) const

creates a virtual device from an ONI file.

Author
Suat Gedikli
Parameters
[in]paththe path to the ONI file
[in]repeatwhether the ONI playback should be repeated in an infinite loop or not.
[in]streamwhether the device should be created as a streaming or trigger-based device.
Returns
the shared_ptr to the newly created virtual device.

◆ getAddress()

unsigned char openni_wrapper::OpenNIDriver::getAddress ( unsigned  index) const
noexcept

method to retrieve the vaddress of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the address of the USB device.

◆ getBus()

unsigned char openni_wrapper::OpenNIDriver::getBus ( unsigned  index) const
noexcept

method to retrieve the bus id of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the bus id of the USB device.

◆ getConnectionString()

const char* openni_wrapper::OpenNIDriver::getConnectionString ( unsigned  index) const
noexcept

method to retrieve the connection string of a device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the connection string of the device.

◆ getDevice()

OpenNIDevice::Ptr openni_wrapper::OpenNIDriver::getDevice ( unsigned  index) const
protected

◆ getDeviceByIndex()

OpenNIDevice::Ptr openni_wrapper::OpenNIDriver::getDeviceByIndex ( unsigned  index) const

returns the device with a given index, where the index is its position in the device list.

Author
Suat Gedikli
Parameters
[in]indexindex of the device to be retrieved.
Returns
shared_ptr to the device, null if no matching device found.

◆ getDeviceBySerialNumber()

OpenNIDevice::Ptr openni_wrapper::OpenNIDriver::getDeviceBySerialNumber ( const std::string &  serial_number) const

returns the device with the given serial number.

Author
Suat Gedikli
Parameters
[in]serial_numberthe serial number of the device to be retrieved.
Returns
shared_ptr to the device, null if no matching device found.

◆ getDeviceType()

static void openni_wrapper::OpenNIDriver::getDeviceType ( const std::string &  connection_string,
unsigned short &  vendorId,
unsigned short &  productId 
)
static

decomposes the connection string into vendor id and product id.

Author
Suat Gedikli
Parameters
[in]connection_stringthe string containing the connection information
[out]vendorIdthe vendor id
[out]productIdthe product id

◆ getInstance()

OpenNIDriver & openni_wrapper::OpenNIDriver::getInstance ( )
inlinestatic

static access method to the only instance.

Author
Suat Gedikli
Returns
the only instance of this class.

Definition at line 241 of file openni_driver.h.

◆ getNumberDevices()

unsigned openni_wrapper::OpenNIDriver::getNumberDevices ( ) const
inlinenoexcept
Author
Suat Gedikli
Returns
the number of available devices.

Definition at line 248 of file openni_driver.h.

References device_context_.

◆ getProductID()

unsigned short openni_wrapper::OpenNIDriver::getProductID ( unsigned  index) const
noexcept

method to retrieve the product id of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the product id of the USB device.

◆ getProductName()

const char* openni_wrapper::OpenNIDriver::getProductName ( unsigned  index) const
noexcept

method to retrieve the product name of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the product name of the USB device.

◆ getSerialNumber()

const char* openni_wrapper::OpenNIDriver::getSerialNumber ( unsigned  index) const
noexcept

method to retrieve the serial number of a device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the serial number of the device.

◆ getVendorID()

unsigned short openni_wrapper::OpenNIDriver::getVendorID ( unsigned  index) const
noexcept

method to retrieve the vendor id of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the vendor id of the USB device.

◆ getVendorName()

const char* openni_wrapper::OpenNIDriver::getVendorName ( unsigned  index) const
noexcept

method to retrieve the vendor name of the USB device without creating it.

Author
Suat Gedikli
Parameters
[in]indexthe index of the device in the device list.
Returns
the vendor name of the USB device.

◆ stopAll()

void openni_wrapper::OpenNIDriver::stopAll ( )

stops all streams from all devices.

Author
Suat Gedikli

◆ updateDeviceList()

unsigned openni_wrapper::OpenNIDriver::updateDeviceList ( )

enumerates all devices and updates the list of available devices.

Author
Suat Gedikli
Returns
the number of devices found.

Member Data Documentation

◆ bus_map_

std::map< unsigned char, std::map<unsigned char, unsigned > > openni_wrapper::OpenNIDriver::bus_map_
protected

Definition at line 235 of file openni_driver.h.

◆ connection_string_map_

std::map< std::string, unsigned > openni_wrapper::OpenNIDriver::connection_string_map_
protected

Definition at line 237 of file openni_driver.h.

◆ context_

xn::Context openni_wrapper::OpenNIDriver::context_
mutableprotected

Definition at line 233 of file openni_driver.h.

◆ device_context_

std::vector<DeviceContext> openni_wrapper::OpenNIDriver::device_context_
mutableprotected

Definition at line 232 of file openni_driver.h.

Referenced by getNumberDevices().

◆ serial_map_

std::map< std::string, unsigned > openni_wrapper::OpenNIDriver::serial_map_
protected

Definition at line 236 of file openni_driver.h.


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