A Objective-C wrapper and example project to use libfreenect with Cocoa.
Warning to everybody. I no longer have a Kinect and so I am unable to test this code! I am very confident with it from my previous university projects where it worked very well for me.
If you find any problems with please feel free to open a new issue.
You use this you need to install other things first. Here is a really nice and simple way to get started using the super power called Homebrew!
Right, do these things:
- Install Homebrew using the instructions found here
- In a terminal do this
brew update
- Then do this
brew install libfreenect
You should now have a shiny new libfreenect (OpenKinect) install!
If you want you can test the installation by plugging in your Kinect, turning on the mains power and running glview
in the terminal.
This should be pretty simple. Just double click on the .xcodeproj
file and Xcode should open it up. Make sure you're using Xcode 4+ though.
Next, you should just be able to plug in your Kinect, power it on, press Build in Xcode and then press the Start button in the UI.
You can then rotate the point cloud around which is generated by the Kinect.
Are you experiencing errors while trying to compile? Are you very very confused? Well I can help! There is a good chance I have already come across your problem and have a solution.
If you cannot find a solution here then please open an issue.
This is probably due to Xcode not being able to find the headers that were installed by brew
on your system.
To fix this follow these instructions:
- In the Project Navigator open up your project configuration
- Click on the Build Settings tab
- Search for
Header Search Paths
- Create a new path and enter
/usr/local/include
- This is the path that Homebrew and many other installations put the header files that relate to libraries.
This is probably due to the library .dylib
file not being found on your system by Xcode. This is an easy one:
- In the Project Navigator open up your project configuration
- Click on the General tab
- Scroll down to
Linked Frameworks and Libraries
- Click on the add button
- In the pop over, click on Add Other…
- Press on your keyboard cmd+shift+G
- Type in
/usr/local/lib
- This is where Homebrew and many other installs put the actual library.dylib
files. - Then find a file called
libfreenect.dylib
- Select it and press Open
This also works for lots of other libraries that you might use. You can usually determine the library that is missing by looking at the missing symbols and applying a bit of brain power.
This project is covered by the Apache v2 Licence. Please see the LICENSE file included with this project for full information.