ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Building on Stephane's work, I made some changes so that you can select the device automatically based on a serial number input as a ros parameter.

Usage looks like this:

rosrun openni_tracker openni_tracker _desired_serial:=B00312327745048B

Notable additions to the code include:

  1. Getting the USB port number by calling deviceNodeInfo.GetCreationInfo() and parsing out the value after the last \.

  2. Calling lsusb via popen (fp = popen("lsusb -v -d 045e:02ae", "r");) and parsing the output to match usb port to serial number. This depends on the system's implementation and formatting of lsusb so it's probably the most fragile part.

  3. Calling ros::param::get("~desired_serial", desiredSerial) to get the user's desired serial number from the ros parameter server.

Code is online here: https://github.com/lrperlmu/openni_tracker/tree/leah-dev . More details can be found in the readme.

Building on Stephane's work, I made some changes so that you can select the device automatically based on a serial number input as a ros parameter.

Usage looks like this:

rosrun openni_tracker openni_tracker _desired_serial:=B00312327745048B

Notable additions to the code include:

  1. Getting the USB port number by calling deviceNodeInfo.GetCreationInfo() and parsing out the value after the last \/.

  2. Calling lsusb via popen (fp = popen("lsusb -v -d 045e:02ae", "r");) and parsing the output to match usb port to serial number. This depends on the system's implementation and formatting of lsusb so it's probably the most fragile part.

  3. Calling ros::param::get("~desired_serial", desiredSerial) to get the user's desired serial number from the ros parameter server.

Code is online here: https://github.com/lrperlmu/openni_tracker/tree/leah-dev . More details can be found in the readme.