Coder Social home page Coder Social logo

sensebloom / osceleton Goto Github PK

View Code? Open in Web Editor NEW
311.0 24.0 72.0 8.39 MB

OSCeleton is a proxy that sends skeleton information collected from the kinect sensor via OSC, making it easier to use input from the device in any language / framework that supports the OSC protocol.

License: GNU General Public License v3.0

Lua 0.49% C 24.20% C++ 6.03% Shell 69.27%

osceleton's Introduction

OSCeleton

What is this?

As the title says, it's just a small program that takes kinect skeleton data from the OpenNI framework and spits out the coordinates of the skeleton's joints via OSC messages. These can can then be used on your language / framework of choice.

How do I use it?

First you need to install the OpenNI driver, framework, and

middleware

Windows / Linux / Mac OSX

Get avin's hacked Primesense PSDK driver for kinect: https://github.com/avin2/SensorKinect Folow his instructions for installing the OpenNI framwork, the driver, and the NITE middleware.

After OpenNI / NITE is working

Then you can run one of the precompiled binaries in the "bin" directory or compile your own:

on Linux or Mac OSX: make

NOTE FOR MAC USERS: You must run OSCeleton from the terminal or it will not run correctly.

on windows: you can use the precompiled binary in bin\win32 or use the VC++ express .sln file.

If you run the executable without any arguments, it will send the OSC messagens in the default format to localhost on port 7110. To learn about the OSC message format, continue reading below or check out our processing examples at https://github.com/Sensebloom/OSCeleton-examples

Other stuff

Another fun way to test OSCeleton is to use the awesome animata skeletal animation software by the Kitchen Budapest guys. You can get it at: http://animata.kibu.hu/

Animata needs its OSC messages in a very specific format, so you must use the "-k" ("kitchen" mode) option. Multiplying the x and y coordinates and adding some offsets can also be useful to tune the size of the skeleton, try running it like this: OSCeleton.exe -k -mx 640 -my 480 -ox -160

If your animation is going crazy try to play with -mx and -my values, and -ox and -oy values a bit.

To get a complete list of available options run OSCeleton -h.

OSC Message format

New user detected - no skeleton available yet. This is a good time

for you to ask the user to do the calibration pose:

Address pattern: "/new_user"
Type tag: "i"
i: A numeric ID attributed to the new user.

New skeleton detected - The calibration was finished successfully,

joint coordinate messages for this user will be incoming soon ;):

Address pattern: "/new_skel"
Type tag: "i"
i: ID of the user whose skeleton is detected.

Lost user - we have lost the user with the following id:

Address pattern: "/lost_user"
Type tag: "i"
i: The ID of the lost user. (This ID will be free for reuse from now 

on)

Joint message - message with the coordinates of each skeleton joint:

Address pattern: "/joint"
Type tag: "sifff"
s: Joint name, check out the full list of joints below.
i: The ID of the user.
f: X coordinate of joint in interval [0.0, 1.0]
f: Y coordinate of joint in interval [0.0, 1.0]
f: Z coordinate of joint in interval [0.0, 7.0]

NOTE: Kitchen mode

To send OSC messages compatible with the awesome animata skeletal animation software use the "-k" option. The messages will have the following format: Address pattern: "/joint" Type tag: "sff" s: joint name concatenated with user id (ex: "l_shoulder0") f: X coordinate of joint in interval [0.0, 1.0] f: Y coordinate of joint in interval [0.0, 1.0] In this mode new_user, new_skel and lost_user messages will not be sent.

NOTE: Quartz Composer mode

You can enable a message format that is more friendly to Quartz composer with the "-q" option. The messages will have the following format: Address pattern: "/joint/name/id" Type tag: "fff" f: X coordinate of joint in interval [0.0, 1.0] f: Y coordinate of joint in interval [0.0, 1.0] f: Z coordinate of joint in interval [0.0, 7.0] Example (left knee of user 3): /joint/l_knee/3 0.08823146 0.5761504 0.44253197

Full list of joints

  • head

  • neck

  • torso

  • r_collar #not working yet

  • r_shoulder

  • r_elbow

  • r_wrist #not working yet

  • r_hand

  • r_finger #not working yet

  • l_collar #not working yet

  • l_shoulder

  • l_elbow

  • l_wrist #not working yet

  • l_hand

  • l_finger #not working yet

  • r_hip

  • r_knee

  • r_ankle

  • r_foot

  • l_hip

  • l_knee

  • l_ankle

  • l_foot

Other

For feature request, reporting bugs, or general osceleton

discussion, come join the fun in our google group!

Have fun!

OSCeleton-Puppet

This is a fork of OSCeleton that adds a number of hacks for a specific project.

Checkout https://github.com/Sensebloom/OSCeleton for more information

New options

OSCeleton-Puppet adds a number of new command line options all starrting with -x.

-xr

This option outputs the X,Y & Z data as "raw" kinect values

-xt

This option outputs the joint rotation data. Address pattern: "/orient" Type tag: "sifffffffff" s: Joint name, check out the full list of joints below. i: The ID of the user. f f f: X axis orientation data f f f : Y axis orientation data f f f : Z axis orientation data

or if in Quartz Composer mode:

Address pattern: "/joint/name/id"
Type tag: "fffffffff"
f f f: X axis orientation data
f f f : Y axis orientation data
f f f : Z axis orientation data

Example (torso of user 4): /orient/torso/4 0.938792 -0.0774589 0.335662 0.0649184 0.996714 0.0484401 -0.338311 -0.0236846 0.940736

-xd

Runs the program with a number of options enabled by default: -xr -xt -p -w -r

osceleton's People

Contributors

drayde avatar mylesborins avatar zpoley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osceleton's Issues

Ubuntu amd64 - segmentation fault on found a user

$ ./osceleton
Configured to send OSC messages to 127.0.0.1:7110
Multipliers (x, y, z): 1.000000, 1.000000, 1.000000
Offsets (x, y, z): 0.000000, 0.000000, 0.000000
OSC Message format: Default OSCeleton format
Initialized Kinect, looking for users...

New User 1
Segmentation fault

Error during install

Hello

After following instructions at https://github.com/avin2/SensorKinect i got everything ok ( working samples )
but when making OSCeleton:

g++ src/OSCeleton.cpp src/viewer.cpp -O3 -Wno-write-strings -Iliblo-0.26-modified -I/usr/X11/include -I/usr/include/ni -lOpenNI -lstdc++ -L/usr/X11/lib -lGL -lGLU -lglut liblo-0.26-modified/src/.libs/*.o -o osceleton
In file included from src/OSCeleton.cpp:24:0:
/usr/include/ni/XnCppWrapper.h: In function ‘void terminate(int)’:
/usr/include/ni/XnCppWrapper.h:5646:27: warning: call to ‘xnShutdown’ declared with attribute warning: This function is deprecated: Use xnContextRelease() instead
/usr/include/ni/XnCppWrapper.h: In function ‘int main(int, char**)’:
/usr/include/ni/XnCppWrapper.h:5553:61: warning: call to ‘xnContextOpenFileRecording’ declared with attribute warning: This function is deprecated: Please use xnContextOpenFileRecordingEx() instead
In function ‘XnStatus xn::SkeletonCapability::_ZN2xn18SkeletonCapability28RegisterCalibrationCallbacksEPFvRS0_jPvEPFvS1_jjS2_ES2_RS2_.clone.21(XnInternalNodeData**, void (*)(xn::SkeletonCapability&, XnUserID, void*), void (*)(xn::SkeletonCapability&, XnUserID, XnBool, void*), void*, void*&)’,
    inlined from ‘int main(int, char**)’ at src/OSCeleton.cpp:693:143:
/usr/include/ni/XnCppWrapper.h:4298:165: warning: call to ‘xnRegisterCalibrationCallbacks’ declared with attribute warning: This function is deprecated: Please use RegisterToCalibrationStart/Complete
In function ‘XnStatus xn::PoseDetectionCapability::_ZN2xn23PoseDetectionCapability23RegisterToPoseCallbacksEPFvRS0_PKcjPvES6_S4_RS4_.clone.23(XnInternalNodeData**, void (*)(xn::PoseDetectionCapability&, const XnChar*, XnUserID, void*), void (*)(xn::PoseDetectionCapability&, const XnChar*, XnUserID, void*), void*, void*&)’,
    inlined from ‘int main(int, char**)’ at src/OSCeleton.cpp:694:117:
/usr/include/ni/XnCppWrapper.h:4597:161: warning: call to ‘xnRegisterToPoseCallbacks’ declared with attribute warning: This function is deprecated: Please use PoseDetected and/or OutOfPose callbacks
g++ osc_tools/osc2file.c -O3 -Wno-write-strings -Iliblo-0.26-modified liblo-0.26-modified/src/.libs/*.o -o osc2file
liblo-0.26-modified/src/.libs/liblo_la-server_thread.o: In function `lo_server_thread_start':
/home/egor/dev/tmp/OSCeleton/liblo-0.26-modified/src/server_thread.c:111: undefined reference to `pthread_create'
liblo-0.26-modified/src/.libs/liblo_la-server_thread.o: In function `lo_server_thread_stop':
/home/egor/dev/tmp/OSCeleton/liblo-0.26-modified/src/server_thread.c:132: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make: *** [osc2file] Error 1

Segmentation fault

latest build has been crashing on OSX with error "Segmentation fault"

Unsure what is causing this issue

Possibility of a preview window?

First of all, thanks so much for your software. It's the first time I've managed to start developing with the Kinect without hacking away at a C++ file (without really knowing what I'm doing!)

I have a request, and I hope this is a suitable place to post it. It would be very useful to have a preview window showing something similar to the Sample-Players example that comes with the Nite middleware. Maybe it could be part of the command line options to turn on/off?

Not sure how easy this would be to implement, but it would be useful for participants to see their Psi calibration pose (and notice when Kinect has trouble capturing their movements).

-k mode not working

OSX 10.6.8, OSCeleton 1.2.1

Thanks for amazing tool, but...

with -k mode you say it should stick the user number on the joint name (eg l_knee1), but I just get no user number. It works fine in normal mode (ie l_knee 1 f f f), but with -k nothing. Here's what I can see using Max to read messages when 2 users are being tracked:

print: /joint head 0.249929 0.207312
print: /joint neck 0.213173 0.286689
print: /joint l_shoulder 0.258474 0.294912
print: /joint l_elbow 0.327878 0.28873
print: /joint l_hand 0.245192 0.200382
print: /joint r_shoulder 0.167873 0.278466
print: /joint r_elbow 0.167873 0.412705
print: /joint r_hand 0.167871 0.546943
print: /joint torso 0.218675 0.384076
print: /joint l_hip 0.253753 0.486832
print: /joint l_knee 0.277243 0.688107
print: /joint l_foot 0.302533 0.882304
print: /joint r_hip 0.1946 0.476095
print: /joint r_knee 0.205924 0.678929
print: /joint head 0.809788 0.305879
print: /joint neck 0.769984 0.401978
print: /joint l_shoulder 0.828214 0.437232
print: /joint l_elbow 0.879691 0.522959
print: /joint l_hand 0.899683 0.549603
print: /joint r_shoulder 0.711754 0.366723
print: /joint r_elbow 0.616282 0.404154
print: /joint r_hand 0.643541 0.477619
print: /joint torso 0.730598 0.503658
print: /joint l_hip 0.729555 0.628553
print: /joint l_knee 0.729555 0.872458
print: /joint l_foot 0.729544 1.106983
print: /joint r_hip 0.652869 0.582124
print: /joint r_knee 0.652962 0.806677
print: /joint r_foot 0.629579 1.027292

Cheers,
Luke
(getting round it with Max router and normal OSC mode to another port for now)

/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

I am trying to install OSCeleton on Ubuntu 13.10. When I run make all is fine until the end of compilation when I get this error:

In function ‘XnStatus xn::Context::ZN2xn7Context17OpenFileRecordingEPKc.isra.15(XnContext, XnBool_, const XnChar_)’,
inlined from ‘int main(int, char__)’ at src/OSCeleton.cpp:564:54:
/usr/include/ni/XnCppWrapper.h:9548:61: warning: call to ‘xnContextOpenFileRecording’ declared with attribute warning: This function is deprecated: Please use xnContextOpenFileRecordingEx() instead [enabled by default]
return xnContextOpenFileRecording(m_pContext, strFileName);
^
In member function ‘XnStatus xn::SkeletonCapability::RegisterCalibrationCallbacks(xn::SkeletonCapability::CalibrationStart, xn::SkeletonCapability::CalibrationEnd, void_, void_&)’,
inlined from ‘int main(int, char__)’ at src/OSCeleton.cpp:695:143:
/usr/include/ni/XnCppWrapper.h:7058:165: warning: call to ‘xnRegisterCalibrationCallbacks’ declared with attribute warning: This function is deprecated: Please use RegisterToCalibrationStart/Complete [enabled by default]
nRetVal = xnRegisterCalibrationCallbacks(GetHandle(), CalibrationStartBundleCallback, CalibrationEndBundleCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
^
In member function ‘XnStatus xn::PoseDetectionCapability::RegisterToPoseCallbacks(xn::PoseDetectionCapability::PoseDetection, xn::PoseDetectionCapability::PoseDetection, void_, void_&)’,
inlined from ‘int main(int, char__)’ at src/OSCeleton.cpp:696:117:
/usr/include/ni/XnCppWrapper.h:7468:161: warning: call to ‘xnRegisterToPoseCallbacks’ declared with attribute warning: This function is deprecated: Please use PoseDetected and/or OutOfPose callbacks [enabled by default]
nRetVal = xnRegisterToPoseCallbacks(GetHandle(), PoseDetectionStartBundleCallback, PoseDetectionStartEndBundleCallback, pPoseCookie, &pPoseCookie->hCallback);
^
/usr/bin/ld: liblo-0.26-modified/src/.libs/liblo_la-server_thread.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *_* [osceleton] Error 1

make failed libpthread

Hello,
On my fedora 15, the make command failed with this output :
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld a retourné 1 code d'état d'exécution

thanks,

Improper Message for Lost User

In the previous builds of osceleton a lost user would send the message "/lost_user [user_number]"

In the most recent build the message being sent is "/new_user [user_number]" which makes the lost user number un-usable

License of application with OSCeleton

Hi.
Please let me know about license of an application with OSCeleton.
In the case I make an application in a PC, that receive OSC params from OSCeleton in another PC, and the application work with the OSC params, Can I make the application as a closed-source software?

Missing argument -lpthread in Makefile (small Issue)

Run 'make' in the main directory fails with
g++ osc_tools/osc2file.c -O3 -Wno-write-strings -Iliblo-0.26-modified liblo-0.26-modified/src/.libs/*.o -o osc2file
liblo-0.26-modified/src/.libs/liblo_la-server_thread.o: In function lo_server_thread_stop' [...]/OSCeleton/liblo-0.26-modified/src/server_thread.c:132: undefined reference topthread_join'

It's suffice to add the option -lpthread for the entries osc2file, osc2text, file2osc in the makefile to fix it.

System: Ubuntu 10.4
OSCeleton version: commit 7307683 (?)

Link against liblo-modified

Hello!
When I compile and try to link aginst the modified version of liblo bundled with OSCeleton, the linkedition fails. But if I pass the parameter -llo to g++, it links fine. Is there any real differente between linking with the original and the modified version?

documentation error: default port

The help from "osceleton -h" says:

-a Address to send OSC packets to (default: localhost).
-p Port to send OSC packets to (default: 7110).

However, if I don't explicitly specify a port and listen to port 7110 I don't get anything. If I specify a port with the -p option (whether it is 7110 or another one) and I listen to that port then I do get data.

So I guess either the default port is NOT 7110, or it doesn't send data at all unless you specify a port.

joint and orientation data mixed

The readme file says:

-xt

This option outputs the joint rotation data.
Address pattern: "/orient"
Type tag: "sifffffffff"

Instead, orientation data is output with the address "/joint", exactly the same as normal joint data, so you can't distinguish them by the address, you have to distinguish them by the number of elements in the message.

For example you get:

/joint l_hip 1 372.283 -86.3652 1311.5
/joint l_hip 1 0.978296 0.12194 0.167531 -0.198848 0.77985 0.593544 -0.0582718 -0.613975 0.787172
/joint l_knee 1 462.281 -439.326 1042.86
/joint l_knee 1 0.978296 0.12194 0.167531 -0.198848 0.77985 0.593544 -0.0582718 -0.613975 0.787172
/joint l_ankle 1 0.978296 0.12194 0.167531 -0.198848 0.77985 0.593544 -0.0582718 -0.613975 0.787172
/joint l_foot 1 548.818 -778.711 784.554
/joint r_hip 1 477.07 -66.1017 1131.94
/joint r_hip 1 0.714734 -0.222359 0.663108 0.0359994 0.958554 0.282628 -0.69847 -0.178132 0.693115
/joint r_knee 1 460.777 -499.95 1004.02
/joint r_knee 1 0.714734 -0.222359 0.663108 0.0359994 0.958554 0.282628 -0.69847 -0.178132 0.693115

Re-add windows binaries?

As OSCeleton seems to still be the only OSC streamer, could you re-add the binaries to github? I tried to recompile, but unfortunately did not succeed. And yes, I know it's already some years old... still seems useful!

Window does not resize properly

Does anybody know how could I make the window really resizable? It doesn´t resize at all at leastin Windows 7 64 bits. I see major differences between viewer.h and other source projects that can properly resize the window. Any help very welcome.

Bad CPU type with osceleton-v1.2.1_OSX

Hello.
I'm new to OSX development.
I downloaded the executable osceleton-v1.2.1._OSX and when I run it in Terminal I get the following error "Bad CPU type in executable".

I have installed all the prerequisites to create an executable from my own mac but not how.

Could someone tell me how to do my own executable or link indicate any where.

I have a MacBookPro1, 2 Intel Core Duo 2.16 GHz with 2 GB RAM

Another could be that someone opccion provide me with an executable that I can work.

Thank you very much.


Hola.
Soy novato en desarrollo OSX.
He descargado el ejecutable osceleton-v1.2.1._OSX y cuando lo ejecuto en Terminal me aparece el siguiente error "Bad CPU type in executable".

Tengo instalados todos los prerequisitos para crear un ejecutable desde mi propio mac pero no se como hacerlo.

Podria alguien informarme como hacer mi propio ejecutable o indicarme algun enlace donde hacerlo.

Tengo un MacBookPro1,2 Intel Core Duo 2,16 GHz con RAM 2 GB

Otra opccion podria ser que alguien me proporcionara un ejecutable que me pueda funcionar.

Muchas Gracias.

While running 'make': src/OSCeleton.cpp:24:10: fatal error: 'XnCppWrapper.h' file not found

I ran make and get this error:

    g++ src/OSCeleton.cpp src/viewer.cpp -O3 -Wno-write-strings -Iliblo-0.26-modified -I/usr/X11/include -I/usr/include/ni -lOpenNI -lstdc++ -L/usr/X11/lib -lGL -lGLU -lglut liblo-0.26-modified/src/.libs/*.o -o osceleton
src/OSCeleton.cpp:24:10: fatal error: 'XnCppWrapper.h' file not found
#include <XnCppWrapper.h>
         ^
1 error generated.
In file included from src/viewer.cpp:1:
src/common.h:5:10: error: 'GL/glut.h' file not found with <angled> include; use "quotes" instead
#include <GL/glut.h>
         ^~~~~~~~~~~
         "GL/glut.h"
In file included from src/viewer.cpp:1:
In file included from src/common.h:5:
src/GL/glut.h:137:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
         ^
2 errors generated.
make: *** [osceleton] Error 1

I' don't see any prerequisites listed.

Initial Center of Mass Tracking broken

In earlier builds of Osceleton a center of mass tracking would begin as soon as a new user was recognized... this feature seems to be broken within the latest builds

error/OSCeleton/Stickmanetic

I keep getting the following error message when trying to run "OSCeleton/Stickmanetic.pde"--any suggestions? I am using your latest box2d buid, latest Processing build, running the OSCeleton from my mac terminal, etc...Thanks!! [email protected]

"Exception in thread "Animation Thread" java.lang.NoSuchMethodError: org.jbox2d.dynamics.World.(Lorg/jbox2d/common/Vec2;)V
at pbox2d.PBox2D.createWorld(PBox2D.java:107)
at pbox2d.PBox2D.createWorld(PBox2D.java:97)
at pbox2d.PBox2D.createWorld(PBox2D.java:91)
at Stickmanetic.setup(Stickmanetic.java:59)
at processing.core.PApplet.handleDraw(PApplet.java:1608)
at processing.core.PApplet.run(PApplet.java:1530)
at java.lang.Thread.run(Thread.java:680)

kitchen mode not working?

on (arch)linux,
after launching osceleton with these arguments:
./osceleton -k -mx 640 -my 480 -ox -160 ,
I get:
terminate called after throwing an instance of 'osc::MalformedBundleException'
what(): packet too short for bundle element
from animata...
That might be something related to kitchen mode.
Tell me if I can help.

OSCeleton

Hello,
I have win8 64 and I have install openNI2 (64b version).
Can you tell me how to have a version from OSCeleton working on my system?

Thanks

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.