Getting the Kinect working with Pd under Mac OS X unfortunately seems to be a bigger pain than with Linux or WIndows.
At the moment (May 2011) it appears to only be possible with Snow Leopard (OS X 10.6.x). So the first step is to upgrade to Snow Leopard.
Make sure you have XCode installed. It’s an optional install on the OS upgrade disk, so you have to do it on purpose. It’s also a free download from Apple.
Next, install CMake. Make is installed as part of XCode, but some of the stuff you need is made for CMake.
Next, install MacPorts, a package repository tool. A lot of programs are distributed via MacPorts, so you may have it installed already. If not, this is a good thing to have.
Next, install Git For Mac. Git is a package/code repository tool which is very popular amongst open source software developers. Note that if you had Git installed for Mac OS 10.5 when you upgraded to Snow Leopard, you have to upgrade to the newest version for 10.6. This incompatibility was screwing me up initially.
The other big problem I had was a USB library that was expected by the OpenNI drivers, but wasn’t installed on my system. It probably gets installed by other projects, so is somewhat common. The library is called usblib-1.0.0, but there are at least three libraries with that name, and they are all incompatible.
The best instructions for getting everything installed is at Kinecthesis. Here are the steps:
- git clone git://git.libusb.org/libusb.gitgit clone git://github.com/OpenKinect/libfreenect.git
- cd libusb
- patch -p1 < ../libfreenect/platform/osx/libusb-osx-kinect.diff
- sudo make install
- cd ../libfreenect (note there is a typo at the web site)
- mkdir build
- cd build
- cmake ..
- make && sudo make install
Sudo is like saying “please” to your computer. You may be prompted for your password. If all goes well, you can then test it with this:
Then you can install the OpenNI library. There are instructions here, but there’s some overlap with the above. Simply put, here’s what you do:
Download the latest “unstable” OpenNI binaries for Mac OS X (this is the part that only supports Snow Leopard). For me, this was called OpenNI-Bin-MacOSX-v18.104.22.168.tar.bz2, but they update it all the time and it might vary for you. Put it in a folder called OpenNI (or something like that), then navigate to that folder and do this:
- tar vxf OpenNI-Bin-MacOSX-v22.214.171.124.tar.bz2
- sudo ./install.sh
You should get something like this:
copying shared libraries…OK
copying include files…OK
creating database directory…OK
registering module ‘libnimMockNodes.dylib’…OK
registering module ‘libnimCodecs.dylib’…OK
registering module ‘libnimRecorder.dylib’…OK
*** DONE ***
Now for SensorKinect. Download the source tarball and put it in a SensorKinect folder. My download was called avin2-SensorKinect-28738dc.tar.gz, but they update it all the time and it may vary for you.
- tar vxf avin2-SensorKinect-28738dc.tar.gz
- cd avin2-SensorKinect-28738dc.tar.gz
- cd Bin
- tar vxf SensorKinect-Bin-MacOSX-v126.96.36.199.tar.bz2
- sudo ./install.sh
Again, you should get a DONE message.
I’m not sure you need NITE (the middleware part) but we can install that, too. Download the latest unstable version here. My download was called NITE-Bin-MacOSX-v188.8.131.52.tar.bz2, but they update it all the time, so it might vary for you.. Put it in a NITE folder.
- cd NITE
- tar vxf NITE-Bin-MacOSX-v184.108.40.206.tar.bz2
- cd Nite-220.127.116.11
- sudo ./install.sh
Look familiar? It should. Again, you’re looking for a DONE message.
Finally, we need OSCeleton. Click on the Download button and select the “osceleton-1.0_osx” package. This is the binary we need. It doesn’t matter where you put it, but you need to know where it is because you need it to use the rest of the stuff in Pd. Put it in a folder called osceleton.
- cd osceleton
- chmod a+x osceleton-1.0_osx
Now, if you type:
You’ll start seeing it working. If you don’t have a Kinect plugged, in you’ll get an error telling you to make sure the Kinect is plugged in. By default, the Kinect data will be sent to localhost on port 7110. You’ll need to make Pd listen to that port for the data. You can broadcast the data to another IP address or port, if you want to use it over a network. You can do ./osceleton-1.0_osx –help to see the options.
If all this went well, you should have the hacker-made OpenKinect drivers, and the OpenNI drivers installed, along with the official OpenNI drivers installed.
More information and sample patches coming.