0

how can I set a specific device ID to the constructor of the OpenNIGrabber object?

The tutorial example with OpenNIGrabber("#1") or OpenNIGrabber("#2") works well but I need to select a specific device somehow. Is it possible to choose the device connected to a specific USB port?

I'm using some Xtion PRO. I'm on ubuntu 13.04 64bit.

the swine
  • 10,713
  • 7
  • 58
  • 100
Michele mpp Marostica
  • 2,445
  • 4
  • 29
  • 45
  • Hm for me it is not working also with asus xtion pro on ubuntu 14.04: what(): void pcl::OpenNIGrabber::setupDevice(const string&, const pcl::OpenNIGrabber::Mode&, const pcl::OpenNIGrabber::Mode&) in /build/pcl-1.7-K_Z193/pcl-1.7-1.7.1/io/src/openni_grabber.cpp @ 373 : No matching device found Just trying to get http://pointclouds.org/documentation/tutorials/tracking.php to run ..... What is #1 doing anyway???? – sqp_125 Jun 21 '18 at 07:46

1 Answers1

2

You can use bus@address ID where bus number and USB port address (device) can be looked up with lsusb command on Linux. This type of device ID works only on non-Windows systems as you can see in PCL sources (https://github.com/PointCloudLibrary/pcl/blob/master/io/src/openni_grabber.cpp#L352-L361, method pcl::OpenNIGrabber::setupDevice, lines 352-361).

Also you can use ASUS Xtion Pro's serial number as an ID.

More in PCL documentation: http://docs.pointclouds.org/1.7.2/a00897.html#a5753a422ff92067c9065797697d69244

Example

quepas@ubuntu:~$ lsusb
Bus 001 Device 002: ID 1d27:0601 ASUS 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Then:

OpenNIGrabber("1@2")
quepas
  • 956
  • 1
  • 13
  • 30