Structure Core customers: OpenNI does not currently support Structure Core. To start developing with Structure Core download Structure SDK (Cross-Platform) on the Developer Portal.
OpenNI2 homepage: https://structure.io/openni
The latest ongoing development is currently being done in the develop branch. Refer to README and ReleasesNotes in the develop branch for up to date build instructions.
Pull requests that do not apply cleanly on top of the develop
branch head will be rejected.
Other than that, sensible and meaningful contributions are very welcome!
-
Libusb 1.0
First, install Homebrew, if you do not have it already:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Then install libusb with it:
brew install libusb --universal
Run: make
Download and install the following windows software:
-
Please make sure you download the version that matches your exact python version.
-
You must also define an environment variable called
JAVA_HOME
that points to the JDK installation directory. For example:set JAVA_HOME=c:\Program Files (x86)\Java\jdk1.6.0_32
Build the Visual Studio solution OpenNI.sln
.
Download and install the following packages, using apt:
sudo apt-get install \
g++ \
python \
libusb-1.0-0-dev \
libudev-dev \
openjdk-6-jdk \
freeglut3-dev \
doxygen \
graphviz
Download and install the following Linux software:
Run: make
The following environment variables should be defined:
ARM_CXX=<path to cross-compilation g++>
ARM_STAGING=<path to cross-compilation staging dir>
Then, run:
PLATFORM=Arm make
These instructions assume a device running Android KitKat. The samples NiViewer, SimpleRead, and SimpleViewer were tested and found to run succesfully on a Nexus 7 running Android 4.4.4. Please ensure you are using a high quality USB OTG cable!
Please refer to this issue for updated information regarding OpenNI2 on Android Lollipop.
The build instructions presented here focus on Eclipse with the ADT plugin. As of the May 2015 Android Studio's NDK support continues to be reported as incomplete and is therefore not recommended as a build environment.
- Download and install the latest Java JDK.
- Install the Android SDK:
- Download the Android SDK, making sure you download the appropriate SDK Tools Only package for your host platform.
- Follow these instructions for installing the stand-alone Android SDK Tools.
- Follow these instructions for adding Android SDK packages.
- Define the
ANDROID_HOME
environment variable pointing to the SDK installation directory.
- Install the Android NDK:
- Download the lastest Android NDK and follow these instructions for installing it.
- Define the
NDK_HOME
environment variable pointing to the NDK installation directory.
- Install Eclipse:
- Download the latest Eclipse release for your host platform.
- Go to
Eclipse → Preferences → Android → NDK
and set the correct NDK Location.
- Install the Eclipse ADT plugin:
- Follow these instructions for downloading and configuring the Eclipse ADT plugin.
-
Download and install the following Windows software:
-
Define the
JAVA_HOME
environment variable, pointing to the correct JDK installation directory. For example:set JAVA_HOME=c:\Program Files (x86)\Java\jdk1.6.0_32
Download and install the following packages, using apt:
sudo apt-get install \
openjdk-6-jdk \
ant
Download and install the following Linux software:
- Go to
Eclipse -> Import... -> Android -> Existing Android Code Into Workspace
- Select the root directory of OpenNI2.
- Projects found should include:
NiViewer
OpenNIForAndroid
SimpleRead
SimpleViewer
- Set the Project Build Target for all imported projects.
- Go into the directory
Packaging
- Run
ReleaseVersion.py [x86|x64|Arm|Android]
- Installer will be placed in the
Final
directory - Android Specific:
keytool
was used as follows to generate a generic keystore for the Android build products:keytool -genkey -v -keystore ./<appname>.keystore -alias NiVKey -keyalg RSA -keypass android -storepass android -keysize 2048 -validity 10000