Difference between revisions of "OpenNI2"

From Wiki for iCub and Friends
Jump to: navigation, search
m (Environment variables: installation)
m (Environment variables)
Line 18: Line 18:
  
 
Source the environment files (obtained from the previous step) by copying their content permanently into your .bashrc. From your OpenNI2 directory:
 
Source the environment files (obtained from the previous step) by copying their content permanently into your .bashrc. From your OpenNI2 directory:
 
 
  cat OpenNIDevEnvironment >> ~/.bashrc
 
  cat OpenNIDevEnvironment >> ~/.bashrc
  
 
And from your NiTE2 directory:
 
And from your NiTE2 directory:
 
 
  cat NiTEDevEnvironment >> ~/.bashrc
 
  cat NiTEDevEnvironment >> ~/.bashrc
  
 
Source the variables to make the change effective (or logout and login again):
 
Source the variables to make the change effective (or logout and login again):
 +
source ~/.bashrc
  
  source ~/.bashrc
+
At the end of this process, you should have four new environment variables defined in your system:
 +
  OPENNI2_INCLUDE
 +
OPENNI2_REDIST
 +
NITE2_INCLUDE
 +
NITE2_REDIST64 or NITE2_REDIST
  
 
== YARP driver ==
 
== YARP driver ==

Revision as of 18:30, 15 November 2013

The OpenNI2 device driver for YARP works with PrimeSense compatible RGB-D sensors, including Asus Xtion Pro. Tested on Debian Jessie (testing), Ubuntu 12.04+ and Mac OS X 10.8.4+.

Debian Wheezy (stable) is not supported by OpenNI2, due to glibc version being < 2.14.

Note: Microsoft Kinect sensors are not supported by this driver. However, they are supported by the old Kinect YARP driver, which was based on OpenNI version 1.

Installation

Dependencies

For Debian and Ubuntu, install the following dependencies:

sudo apt-get install g++ python libusb-1.0-0-dev libudev-dev freeglut3-dev doxygen graphviz

Also, you must have installed a Java SDK.

Next, install OpenNI2 and NiTE2 according to the latest official instructions at http://www.openni.org

Environment variables

Source the environment files (obtained from the previous step) by copying their content permanently into your .bashrc. From your OpenNI2 directory:

cat OpenNIDevEnvironment >> ~/.bashrc

And from your NiTE2 directory:

cat NiTEDevEnvironment >> ~/.bashrc

Source the variables to make the change effective (or logout and login again):

source ~/.bashrc

At the end of this process, you should have four new environment variables defined in your system:

OPENNI2_INCLUDE
OPENNI2_REDIST 
NITE2_INCLUDE 
NITE2_REDIST64 or NITE2_REDIST

YARP driver

Enable devices SET OpenNI2DeviceServer to ON set OpenNI2DeviceClient to ON

set INSTALL_WITH_RPATH to ON

Usage

Print a short driver manual:

yarpdev --device OpenNI2DeviceServer --verbose

Available options:

--device

--playback filename.oni

   Playbacks the specified oni file.

--loop

   Forces the playback to loop. If not used, the playback will stop after one run.

--record filename.oni

   records to the specified oni file

--name

   chenge default port prefix (default=/OpenNI2)

--noCameras

   use only user tracker

--noMirror

   disable mirroring

--noUserTracking

--minConfidence x (double)

   set minimum confidence required. Default is 0.6

Doesn't start the user tracker.

--

The driver opens three ports: imageFrame:o depthFrame:o userTracker:o

imageFrame and depthFrame stream YARP images, and if connectd to a yarpview, the video is available. UserTracker outputs bottles in the format:

To use the driver in an application:

tbc