Point Cloud Library (PCL)  1.7.0
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>

List of all members.

Classes

struct  DeviceContext

Public Member Functions

 ~OpenNIDriver () throw ()
 virtual Destructor that never throws an exception
unsigned updateDeviceList ()
 enumerates all devices and updates the list of available devices.
unsigned getNumberDevices () const throw ()
boost::shared_ptr< OpenNIDevicecreateVirtualDevice (const std::string &path, bool repeat, bool stream) const
 creates a virtual device from an ONI file.
boost::shared_ptr< OpenNIDevicegetDeviceByIndex (unsigned index) const
 returns the device with a given index, where the index is its position in the device list.
boost::shared_ptr< OpenNIDevicegetDeviceBySerialNumber (const std::string &serial_number) const
 returns the device with the given serial number.
boost::shared_ptr< OpenNIDevicegetDeviceByAddress (unsigned char bus, unsigned char address) const
 returns the device that is given by the USB bus/address combination.
const char * getSerialNumber (unsigned index) const throw ()
 method to retrieve the serial number of a device without creating it.
const char * getConnectionString (unsigned index) const throw ()
 method to retrieve the connection string of a device without creating it.
const char * getVendorName (unsigned index) const throw ()
 method to retrieve the vendor name of the USB device without creating it.
const char * getProductName (unsigned index) const throw ()
 method to retrieve the product name of the USB device without creating it.
unsigned short getVendorID (unsigned index) const throw ()
 method to retrieve the vendor id of the USB device without creating it.
unsigned short getProductID (unsigned index) const throw ()
 method to retrieve the product id of the USB device without creating it.
unsigned char getBus (unsigned index) const throw ()
 method to retrieve the bus id of the USB device without creating it.
unsigned char getAddress (unsigned index) const throw ()
 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 OpenNIDrivergetInstance ()
 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 ()
boost::shared_ptr< OpenNIDevicegetDevice (unsigned index) const
void getDeviceInfos () throw ()

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 62 of file openni_driver.h.


Constructor & Destructor Documentation

virtual Destructor that never throws an exception

Author:
Suat Gedikli

Member Function Documentation

boost::shared_ptr<OpenNIDevice> 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.
unsigned char openni_wrapper::OpenNIDriver::getAddress ( unsigned  index) const throw ()

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.
unsigned char openni_wrapper::OpenNIDriver::getBus ( unsigned  index) const throw ()

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.
const char* openni_wrapper::OpenNIDriver::getConnectionString ( unsigned  index) const throw ()

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.
boost::shared_ptr<OpenNIDevice> openni_wrapper::OpenNIDriver::getDevice ( unsigned  index) const [protected]
boost::shared_ptr<OpenNIDevice> openni_wrapper::OpenNIDriver::getDeviceByAddress ( unsigned char  bus,
unsigned char  address 
) const

returns the device that is given by the USB bus/address combination.

Author:
Suat Gedikli
Parameters:
[in]busthe USB bus id
[in]addressthe USB address
Returns:
shared_ptr to the device, null if no matching device found.
boost::shared_ptr<OpenNIDevice> 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.
boost::shared_ptr<OpenNIDevice> 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.
void openni_wrapper::OpenNIDriver::getDeviceInfos ( ) throw () [protected]
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 teh connection information
[out]vendorIdthe vendor id
[out]productIdthe product id

static access method to the only instance.

Author:
Suat Gedikli
Returns:
the only instance of this class.

Definition at line 238 of file openni_driver.h.

unsigned openni_wrapper::OpenNIDriver::getNumberDevices ( ) const throw () [inline]
Author:
Suat Gedikli
Returns:
the number of available devices.

Definition at line 245 of file openni_driver.h.

References device_context_.

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

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.
const char* openni_wrapper::OpenNIDriver::getProductName ( unsigned  index) const throw ()

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.
const char* openni_wrapper::OpenNIDriver::getSerialNumber ( unsigned  index) const throw ()

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.
unsigned short openni_wrapper::OpenNIDriver::getVendorID ( unsigned  index) const throw ()

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.
const char* openni_wrapper::OpenNIDriver::getVendorName ( unsigned  index) const throw ()

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.

stops all streams from all devices.

Author:
Suat Gedikli

enumerates all devices and updates the list of available devices.

Author:
Suat Gedikli
Returns:
the number of devices found.

Member Data Documentation

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

Definition at line 232 of file openni_driver.h.

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

Definition at line 234 of file openni_driver.h.

xn::Context openni_wrapper::OpenNIDriver::context_ [mutable, protected]

Definition at line 230 of file openni_driver.h.

Definition at line 229 of file openni_driver.h.

Referenced by getNumberDevices().

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

Definition at line 233 of file openni_driver.h.


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