Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Fixes for compiling BlockOpenNISkeleton sample on OSX (10.8) #6

Open
wants to merge 10 commits into
base: multidevices
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions README

This file was deleted.

108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Block OpenNI
============
A C++ wrapper for OpenNI

2011-06-20:
This block is going through heavy remake and so old code/methods are mixed with
new methods for the moment. I will be changing the way things are handled at
the moment when i'm finished. All for better support on multiple devices.

Basic description
=================

Support for several generators as Image, IR, Depth and User.
Skeleton tracking is also supported.

Installation
============

You need to install the sensor drivers, OpenNI and NITE.
Note! PrimeSense drivers do not work with the Kinect.


So here's a step-by-step installationg guide:
(The links you'll find here are the latest unstable at the time of writing)

- OpenNI 1.3.2.3
- Nite 1.4.1.2
- SensorKinect 5.0.3.4

Windows 32bit:
--------------

Download/Install OpenNI:
http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/163-openni-unstable-build-for-windows-x86-32-bit-v1-3-2/download

Download/Install Avin2's SensorKinect:
https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Win-OpenSource32-5.0.3.4.msi

Download/Install NITE:
http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/177-primesense-nite-unstable-build-for-windows-x86-32-bit-v1-4-1/download

At this moment you should now be able to run the samples in OpenNI. Go to
OpenNI's folder and browse to /Samples/Bin/Release. Run NiViewer.exe. You
should now be looking at a window with the RGB and Depth feed coming from the
kinect.

MacOSX 32bit:
-------------

### 1. Install libtool/libusb ###

#### With MacPorts: ####

Download/Install MacPorts
- (Snow Leopard 10.6) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.5-Leopard.dmg
- (Lion 10.7) https://distfiles.macports.org/MacPorts/MacPorts-2.0.0-10.7-Lion.dmg

In the terminal:

sudo port install libtool
sudo port install libusb-devel +universal

#### With Hombrew: ####

Install Homebrew: in the terminal:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Install the libs from the terminal:

brew install libtool
brew install libusb --universal


### 2. Download/Untar OpenNI ###

http://openni.org/downloadfiles/opennimodules/openni-binaries/latest-unstable/162-openni-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-3-2/download

Open the terminal, goto openni's folder you just untar'ed.

sudo ./install.sh

### 3. Download Avin2's SensorKinect ###

https://github.com/avin2/SensorKinect/blob/unstable/Bin/SensorKinect-Bin-MacOSX-v5.0.3.4.tar.bz2

Open the terminal, goto SensorKinect's folder you just untar'ed.

sudo ./install.sh

### 4. Download NITE ###

http://openni.org/downloadfiles/opennimodules/openni-compliant-middleware-binaries/latest-unstable/176-primesense-nite-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-4-1/download

Open the terminal, goto NITE's folder you just untar'ed.

sudo ./install.sh

At this moment you should now be able to run the samples in OpenNI. Go to
OpenNI's folder and browse to /Samples/Bin/Release (use terminal). Run
./NiViewer. You should now be looking at a window with the RGB and Depth feed
coming from the kinect


Linux
-----

Check Avin2's SensorKinect repo (@github) for more information.
3 changes: 3 additions & 0 deletions include/Include/MacOSX/XnPlatformMacOSX.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@

#undef XN_THREAD_STATIC
#define XN_THREAD_STATIC

#undef XN_API_DEPRECATED
#define XN_API_DEPRECATED(msg) __attribute__((deprecated("This function is deprecated: " msg)))

#endif //_XN_PLATFORM_MACOSX_H_
4 changes: 4 additions & 0 deletions samples/BasicKinect/include/Resources.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
#include "cinder/CinderResources.h"

//#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE )
Binary file added samples/BasicKinect/resources/CinderApp.icns
Binary file not shown.
Binary file added samples/BasicKinect/resources/cinder_app_icon.ico
Binary file not shown.
57 changes: 57 additions & 0 deletions samples/BasicKinect/src/BasicKinectApp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"

#include "VKinect.h"

using namespace ci;
using namespace ci::app;
using namespace std;
using namespace V;

class BasicKinectApp : public AppBasic {
public:
void prepareSettings( Settings *settings );
void setup();
void mouseDown( MouseEvent event );
void update();
void draw();

private:
Kinect kinect;
};

void BasicKinectApp::prepareSettings( Settings *settings )
{
}

void BasicKinectApp::setup()
{

try {
kinect.setup();
} catch ( int e ) {
console() << "No kinect. Exit sadface." << endl;
quit();
}

}

void BasicKinectApp::mouseDown( MouseEvent event )
{
}

void BasicKinectApp::update()
{
kinect.update();
}

void BasicKinectApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
kinect.drawSkeletons(Rectf(0, 0, getWindowWidth(), getWindowHeight()));

}


CINDER_APP_BASIC( BasicKinectApp, RendererGl )
19 changes: 19 additions & 0 deletions samples/BasicKinect/vc10/BasicKinect.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicKinect", "BasicKinect.vcxproj", "{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Debug|Win32.ActiveCfg = Debug|Win32
{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Debug|Win32.Build.0 = Debug|Win32
{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Release|Win32.ActiveCfg = Release|Win32
{74202EDD-91D2-4D2A-B0B6-355CEB16E6BE}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading