Loading...
Searching...
No Matches
openni_wrapper::OpenNIDriver Class Reference
Module io

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

## Static Public Member Functions

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

## Protected Member Functions

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

## Protected Attributes

std::vector< DeviceContext > | device_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

References getInstance(), and OpenNIDriver().

## OpenNIDriver()

openni_wrapper::OpenNIDriver::OpenNIDriver | ( |  | ) |

protected

Referenced by getInstance(), and ~OpenNIDriver().

## 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] | path | the path to the ONI file
  [in] | repeat | whether the ONI playback should be repeated in an infinite loop or not.
  [in] | stream | whether the device should be created as a streaming or trigger-based device.

Returns
  the shared_ptr to the newly created virtual device.

References createVirtualDevice().

Referenced by createVirtualDevice().

## 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] | index | the 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] | index | the 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] | index | the 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] | index | index of the device to be retrieved.

Returns
  shared_ptr to the device, null if no matching device found.

References getDeviceByIndex().

Referenced by getDeviceByIndex().

## 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_number | the serial number of the device to be retrieved.

Returns
  shared_ptr to the device, null if no matching device found.

References getDeviceBySerialNumber().

Referenced by getDeviceBySerialNumber().

## getDeviceType()

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_string | the string containing the connection information
  [out] | vendorId | the vendor id
  [out] | productId | the product id

## getInstance()

OpenNIDriver & openni_wrapper::OpenNIDriver::getInstance | ( |  | ) |

inline static

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.

References OpenNIDriver().

Referenced by ~OpenNIDriver().

## getNumberDevices()

unsigned openni_wrapper::OpenNIDriver::getNumberDevices | ( |  | ) | const

inline noexcept

Author
  Suat Gedikli

Returns
  the number of available devices.

Definition at line 248 of file openni_driver.h.

References device_context_.

Referenced by updateDeviceList().

## 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] | index | the 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] | index | the 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] | index | the 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] | index | the 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] | index | the 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.

References getNumberDevices(), and updateDeviceList().

Referenced by updateDeviceList().

## 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_

mutable protected

Definition at line 233 of file openni_driver.h.

## device_context_

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

mutable protected

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:

- pcl/io/openni_camera/openni_driver.h