Installing OpenNI, NITE and SensorKinect for Mac OS XPublished by Jared St. Jean on Thu, 24/11/2011 - 5:30pm
UPDATE: OpenNI has a new site so a lot of the links (and some instruction on how to obtain things) have changed. To download previous versions of OpenNI and NiTE, go to http://www.openni.org/openni-sdk/openni-sdk-history-2/
A lot of applications such as those using Processing and openFrameworks require that your install the OpenNI/NITE middleware packages along with Avin2's SensorKinect Driver mod. Here's what you need to know and do before you can start developing apps which incorporate the Kinect.
The installation of OpenNI and NITE Middleware apps along with the SensorKinect Driver require a few pre-requisites to be installed before we can get under way.
You'll need to have Xcode, MacPorts and CMake installed. It also helps if you know your way around a Terminal app. You don't need to be a wizard, but knowing how to navigate around from one dir to the other and the ability to understand what commands you're entering will go a long way. Once all this criteria is met, we can get the show on the road.
First up, we'll need to downlaod a few libraries in order to get the USB port on your Mac working with the Kinect along with the SensorKinect driver. Open up your Terminal (Applications -> Utilities -> Terminal) and type in the following:
sudo port install libtool
A quick note about the 'sudo' command for those who don't know, it allows you to temporarily issues commands with root level privileges. You'll need to provide the administrative password for the machine each time you use it.
Once that's finished, restart your computer. Next up, install the development version of libusb. It's important to type this in verbatim -- copy/paste is actually best:
sudo port install libusb-devel +universal
Once that has finished installing, restart. Now we can get to the good stuff.
NOTE: It's very important that you install the following things in the order in which they appear. If that wasn't clear enough, that goes:
Let's start off by creating a directory to place all of the applications you'll need to use a Kinect on your Mac. I chose to create a Kinect directory in Home. Upen up a Terminal and type the following in:
Download the latest unstable release of OpenNI from their download section at - http://www.openni.org/Downloads/OpenNIModules.aspx
- Select OpenNI Binaries from the first drop down menu
- Select Unstable from the second drop down menu
- OpenNI Unstable Build for Mac OS X 10.6
- Click Download
-- Alternatively, if you have git installed on your Mac, type in the following command:
sudo git clone https://github.com/OpenNI/OpenNI.git
sudo git checkout unstable
Change your working directory within the OpenNI folder -- OpenNI-Bin-Dev-MacOSX-v220.127.116.11 at the time of this tutorial and perform the following command:
Let that sucker install and then on to the next part.
Download the latest and greatest unstable version of SensorKinect from https://github.com/avin2/SensorKinect and place it in your Kinect directory. Extract the contents and delete the .zip file if you feel so inclined. Change your working directory to the Bin folder. Extract the SensorKinect-Bin-MacOSX-v18.104.22.168.tar.bz2 file, navigate inside of the newly extracted directory and run the following command:
Let er rip and move along...
Install PrimeSense NITE
Download the latest unstable version from http://www.openni.org/Downloads/OpenNIModules.aspx
The steps are similar to the OpenNI download, except this time you'll be selecting the unstable versions of their OpenNI Compliant MIddleware Binaries:
Extract the contents of the file and run the install shell script in the inside of nite-bin-macosx-v22.214.171.124 in a Terminal - note that the version number will most definitely be different depending on what version you downloaded.
You'll promptly be prompted for the PrimeSense License Key, enter the following: 0KOIk2JeIBYClPWVnMoRKn5cdY4=
Once this is done, you should be able to plug your Kinect into your Mac and check to out some of the example demos they've provided. Actually, that's a lie. You need to copy all of the sample-*.xml files from your NITE/Data to SensorKinect/Data.
If you kept the same folder structure as I did, this command will get things done quickly in a Terminal. If not, just copy them and move them over using Finder.
cp *.xml ../../SensorKinect/Data
Once that's been completed, you can now run some of the NITE samples. Go to the Samples/Bin/Release directory and execute one of the samples
If all went according to plan, you should get something like this:
If you ran into any problems, please feel free to paste some of the output or errors you're receiving. I know at times I had to go through thing two or three times before they started working so let me know if you're having difficulties and I'll do my best to help out!