Giter VIP home page Giter VIP logo

libfreenect's Introduction

libfreenect

libfreenect is a userspace driver for the Microsoft Kinect. It runs on Linux, OSX, and Windows and supports

  • RGB and Depth Images
  • Motors
  • Accelerometer
  • LED
  • Audio

Build Instructions

To build libfreenect, you'll need

  • libusb >= 1.0.18
  • CMake >= 2.6
  • python >= 2.7 or >= 3.3 (only if BUILD_PYTHON=ON or BUILD_PYTHON2=ON or BUILD_PYTHON3=ON or BUILD_REDIST_PACKAGE=OFF)

For the examples, you'll need

  • OpenGL (included with OSX)
  • glut (included with OSX)
  • pthreads-win32 (Windows)

Fetch & Build

git clone https://github.com/OpenKinect/libfreenect
cd libfreenect
mkdir build
cd build
cmake -L .. # -L lists all the project options
make

# if you don't have `make` or don't want color output
# cmake --build .

Use CMake options to control what gets built. For example, to build the python wrapper:

cmake .. -DCMAKE_BUILD_PYTHON=ON
make
python2 wrappers/python/python2/test.py
python3 wrappers/python/python3/test.py

You can specify a build with debug symbols:

cmake .. -DCMAKE_BUILD_TYPE=debug
# or with optimizations
# cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo

You can build .deb, .rpm, and/or .tgz packages with cpack:

cmake .. -DBUILD_CPACK_DEB=ON -DBUILD_CPACK_RPM=ON -DBUILD_CPACK_TGZ=ON
cpack

For audio support, you must upload firmware to the device. Newer Kinect models may require audio firmware for motor and LED support. The best method is to insert firmware at runtime just after calling freenect_init().

Alternately, firmware for Kinect model 1414 can be downloaded automatically by specifying:

cmake .. -DBUILD_REDIST_PACKAGE=OFF

Note that firmware may not be legal to redistribute in your jurisdiction!

OSX

If you don't have a package manager, install Homebrew. For a manual build, see the wiki.

Homebrew

brew install libfreenect
# or get the very latest:
# brew install --HEAD libfreenect

MacPorts

sudo port install git-core cmake libusb libtool

Continue with Fetch & Build.

Linux

Remember to install the udev rules. For a manual build, see the wiki.

Ubuntu/Debian/Mint

The version packaged in Ubuntu may be very old. To install newer packaged builds, see the wiki. Continue with this section for a manual build.

sudo apt-get install git cmake build-essential libusb-1.0-0-dev

# only if you are building the examples:
sudo apt-get install freeglut3-dev libxmu-dev libxi-dev

Continue with Fetch & Build.

There is also a debian branch for packaging purposes.

Gentoo Linux

There is a live ebuild for your convenience in platform/linux/portage/dev-libs/libfreenect/.

Arch Linux

There is a libfreenect PKGBUILD in the AUR. Alternately, the libfreenect-git PKGBUILD builds the very latest.

Windows

As of February 2015, libusb still does not support isochronous transfers on Windows. This support may be patched in by performing these steps or their GUI equivalent.

git clone https://github.com/libusb/libusb.git
cd libusb
git remote add jblake https://github.com/JoshBlake/libusbx.git
git fetch jblake
git cherry-pick c5b0af4 1c74211
MSBuild.exe msvc/libusb_2013.sln

Use Zadig to install the libusbK driver for each device you wish to use. Follow Fetch & Build or use Github and CMake GUI tools. Remember to supply paths to CMake so it can find dependencies. For example:

cmake .. -DLIBUSB_1_INCLUDE_DIR="C:\path\to\patched\libusb\include" -DLIBUSB_1_LIBRARY="C:\path\to\patched\libusb\libusb.lib"

Wrappers

Interfaces to various languages are provided in wrappers/. Wrappers are not guaranteed to be API stable or up to date.

  • C (using a synchronous API)
  • C++
  • C#
  • python
  • ruby
  • actionscript
  • Java (JNA)

Code Contributions

In order of importance:

  • Make sure to sign commits: git commit -s
  • Use a feature branch in your own fork and target master with pull requests
  • Tab indentation, no trailing whitespace

Maintainers

Ongoing Development and Maintenance by the OpenKinect Community

http://www.openkinect.org

  • Original Code and Engineering: Hector Martin (marcan)
  • Community Lead: Josh Blake (JoshB)
  • Integration: Kyle Machulis (qDot)

License

The libfreenect project is covered under a dual Apache v2/GPL v2 license. The licensing criteria are listed below, as well as at the top of each source file in the repo.

This file is part of the OpenKinect Project. http://www.openkinect.org

Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB
file for details.

This code is licensed to you under the terms of the Apache License,
version 2.0, or, at your option, the terms of the GNU General Public
License, version 2.0. See the APACHE20 and GPL2 files for the text of
the licenses, or the following URLs:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.txt

If you redistribute this file in source form, modified or unmodified,
you may:

- Leave this header intact and distribute it under the same terms,
  accompanying it with the APACHE20 and GPL2 files, or
- Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
- Delete the GPL v2 clause and accompany it with the APACHE20 file

In all cases you must keep the copyright notice intact and include a
copy of the CONTRIB file.

Binary distributions must follow the binary distribution requirements
of either License.

More Information

Information about the OpenKinect project can be found at http://www.openkinect.org

For questions, support, and discussion, check out the google groups mailing list at http://groups.google.com/group/openkinect

Or the IRC channel at #openkinect on Freenode

We are also on twitter at http://twitter.com/openkinect

libfreenect's People

Contributors

piedar avatar zarvox avatar marcan avatar qdot avatar lostinspacebar avatar slomp avatar qulogic avatar mrenouf avatar nneonneo avatar imekinox avatar amiller avatar joshblake avatar nbourdau avatar kairibu avatar algrs avatar floe avatar oftheo avatar mmwise avatar netpro2k avatar kelvie avatar yarikoptic avatar richmattes avatar edaubert avatar yoda-jm avatar wizgrav avatar tfoote avatar timn avatar stephanemagnenat avatar stevenlovegrove avatar pkropf avatar

Watchers

Oriol Ferrer Mesià avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.