Getting up and running with OpenNI and NITE on a Mac
I'm not a c++ developer, but I recently dug into the OpenNI and PrimeSense NITE samples with the ultimate goal of bridging output from the Kinect to Flash. In the end, I found AS3OpenNI and for the time being, don't need to do any additional work in c++, but I found the experience helpful none-the-less. Following the jump, I detail the components and steps for getting an Xcode project set up.
Terminology
- OpenNI is a framework for natural interfaces.
- PrimeSense is a sensor maker.
- PrimeSense NITE is a module for OpenNI. It focuses on seeing hand movement and gestures.
- PrimeSense Sensor (drivers for PrimeSense (but not Kinect?)).
- SensorKinect (drivers for Kinect).
I installed everything per this article from Kinecthesis. Before that, I tried to build the latest unstable builds of OpenNI and Sensor, but was not able to make the OpenNI project following the provided instructions and the Sensor drivers did not work with the OpenNI build mentioned in the Kinecthesis article. So, the simplest thing to do is follow the complete set of instructions provided in that article.
Xcode project setup
If you are unfamiliar with Xcode, you should be able to compile the samples provided in the OpenNI and NITE repositories by completing the following:
- Copy all files from the Samples/SampleName directory into your Xcode project.
- Point the project to the Header files:
- Project > Edit Project Settings
- Scroll to Search Paths > Header Search Paths
- Recursively add /usr/include/ni
- Recursively add /usr/include/nite
- Point the project to the necissary Libraries:
- Project > Edit Project Settings
- Scroll to Linking > Other Linker Flags
- Add /usr/lib/libnimCodecs.dylib, /usr/lib/libnimMockNodes.dylib, /usr/lib/libnimRecorder.dylib, /usr/lib/libOpenNI.dylib, /usr/lib/libXnVFeatures.dylib, /usr/lib/libXnVHandGenerator.dylib
- Set project to 64-bit only. Since I am only interested in 64 bit right now and I only linked the 64 bit libraries above and I set the project away from the default (universal).
- Project > Edit Project Settings
- Scroll to Architectures > Architectures
- Change to 64-bit Intel
- Point the project to additional needed frameworks:
- Right click on project > Add > Existing Frameworks...
- Select OpenGL.framework
- Click add
- Right click on project > Add > Existing Frameworks...
- Click Add Other...
- Add /System/Library/Frameworks/GLUT.framework
That should do the trick. Below is a screen shot of my test.
