Giter VIP home page Giter VIP logo

freenect's Introduction

Haskell interface to the Kinect

The following instructions assume you are installing in a Linux environment (specifically, Ubuntu 10.04 32-bit). It also assumes that you already have Haskell/GHC installed.

Dependencies

sudo apt-get update
sudo apt-get install cmake
sudo apt-get install git-core
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libxmu-dev
sudo apt-get install libxi-dev
sudo apt-get install libcv-dev
sudo apt-get install libhighgui-dev

Installing libfreenect

To install the libfreenect library, first checkout the latest version of the source code from their github repository:

git clone https://github.com/OpenKinect/libfreenect.git

Next, move into the source folder and build the library using cmake.

cd libfreenect
mkdir build
cd build
cmake ..

Install it:

sudo make install

Lastly, ensure you never have to run libfreenect code as an administrator by copying the included udev rules:

cd ..
sudo cp platform/linux/udev/51-kinect.rules /etc/udev/rules.d

Installing this library

First check out the code:

git clone [email protected]:kevincon/freenect.git

Next, move into the folder and install using cabal:

cd freenect
cabal install freenect.cabal

Installing the examples

In the freenect source folder:

cd examples
cabal install examples.cabal

If you encounter errors, you may need to install the glut and juicypixels hackage packages:

cabal update
cabal install glut
cabal install juicypixels

You can also run these examples directly. First navigate to the src directory:

cd src

To run the RGB.hs program, which grabs an RGB video frame from the Kinect and saves it as a file called "output.bmp" in the same directory, run:

runhaskell RGB.hs

To run the GlutRGB.hs program, which displays the real-time RGB video stream from the Kinect in a window, run:

runhaskell GlutRGB.hs

TODO

  • Couple parts in the Haskell FFI do some mallocation, must add the necessary free()-equivalent calls.

freenect's People

Contributors

chrisdone avatar bennofs avatar

Stargazers

Jordan Taranto avatar  avatar  avatar AJ avatar Saulo Lordão avatar Tatsuya Hirose avatar Marco Z avatar  avatar Daniel Kahlenberg avatar  avatar Bob Frank avatar Jon Schoning avatar Joanne avatar Sergei Chertkov avatar A.Berckner avatar Rikuo Takahama avatar John P Mayer, Jr avatar Kevin Conley avatar ruicc avatar Alan Zimmerman avatar mikhail lozanov avatar Jonathan Fischoff avatar Dan Hagon avatar Usagi Ito avatar  avatar Makoto Shimabukuro avatar

Watchers

 avatar Bob Frank avatar James Cloos avatar Ivan Perez, PhD avatar Rikuo Takahama avatar  avatar

freenect's Issues

requires BangPatterns

I was unable to build with Ubuntu: haskell platform 2010 because of illegal bang-pattern usage. I added {-# LANGUAGE BangPatterns #-} extension to src/Freenect.hs to get it to build.

undefined reference to `freenect_set_flag' under ghc-8.0.2

I am getting the following error (multiple instances) when installing haskanoid under ghc 8.0.2. The error seems to be related to freenect. I tried a sandbox install too with same result:

madjestic@nu ~/Projects/Haskell/haskanoid $ cabal install
Resolving dependencies...
Configuring haskanoid-0.1.5...
Building haskanoid-0.1.5...
Failed to install haskanoid-0.1.5
Build log ( /home/madjestic/.cabal/logs/haskanoid-0.1.5.log ):
cabal: Entering directory '.'
Configuring haskanoid-0.1.5...
Building haskanoid-0.1.5...
Preprocessing executable 'haskanoid' for haskanoid-0.1.5...
Linking dist/build/haskanoid/haskanoid ...
/home/madjestic/.cabal/lib/x86_64-linux-ghc-8.0.2/freenect-1.2.1-IWHP9yhnEhcEQ0pDPsW6C9/libHSfreenect-1.2.1-IWHP9yhnEhcEQ0pDPsW6C9.a(Freenect.o):(.text+0x13037): undefined reference to `freenect_set_flag'
collect2: error: ld returned 1 exit status
`x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
haskanoid-0.1.5 failed during the building phase. The exception was:
ExitFailure 1

a linked thread

Archlinux

installed libfreenect-git:
https://aur.archlinux.org/packages.php?ID=43763

When doing "cabal install freenect" getting the error:

  • Missing (or bad) header file: libfreenect.h
    This problem can usually be solved by installing the system package that
    provides this library (you may need the "-dev" version). If the library is
    already installed but in a non-standard location then you can use the flags
    --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
    If the header file does exist, it may contain errors that are caught by the C
    compiler at the preprocessing stage. In this case you can re-run configure
    with the verbosity flag -v3 to see the error messages.
    cabal: Error: some packages failed to install:
    freenect-1.0.2 failed during the configure step. The exception was:
    ExitFailure 1

Update version on Hackage

The current version on hackage is very outdated. Several crucial fixes have not been published there, which means that it doesn't even compile.

IMHO the current version on this repo should be published on hackage.

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.