Forums > MaxMSP

[sharing is the start] OpenNI to Max via OSC

January 12, 2011 | 11:56 pm

Greetings all,

I have just finished getting data into Max from the Kinect via OSC using PrimeSenses NITE.

http://tohmjudson.com/?p=30

This is using OpenNI,NITE, OSCeleton, and a few other softwares (quite a few actually). The Skeletal tracking of NITE is amazing for those that have not seen it yet.

Mac only tutorial, but I am 100% sure that same could be done for PC.

Let me know what you are doing with it… I will share some examples I have made when I have a little more time to play… Let me know if you find any mistakes…

OpenNI info @ openni.org

Special thanks to Tony Gonçalves at Sensebloom for his help with getting the mac version


January 13, 2011 | 6:13 pm

thank you very much for your work tohm !

but i did not get it working …

everything was fine, till i try to start Sample-PointViewer.

the first time the Sample-PointViewer lauched
(i could see the kinect video output)
but in the terminal window i got opengl errors.

then i restarted my machine
now the Sample-PointViewer does not start anymore.
i get the following error:

InitFromXmlFile failed: File not found!

as recommented i copyed the data files before.

perhaps you have a hint for me.
d.


January 13, 2011 | 7:57 pm

@tohm:

really excited about this – so I was trying to follow your runthrough & got up to installing SensorKinect – then here’s what happened:

pseudo-2:~ phober$ cd /Users/phober/Documents/OpenNI/avin2-SensorKinect-0124bd2/Bin/SensorKinect-MacOSX-5.0.0/
pseudo-2:SensorKinect-MacOSX-5.0.0 phober$ sudo ./install.sh
creating config dir /usr/etc/primesense…OK
copying shared libraries…OK
copying executables…OK
registering module ‘libXnDeviceSensorV2.dylib’ with OpenNI…dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /usr/lib/libOpenNI.dylib
Reason: image not found
./install.sh: line 62: 487 Trace/BPT trap niReg -r $INSTALL_LIB/$module $INSTALL_ETC

so I went to:

http://www.libusb.org/wiki/

and downloaded & installed latest version of libusb (1.0).

but then I got:

pseudo-2:~ phober$ cd /Users/phober/Documents/OpenNI/avin2-SensorKinect-0124bd2/Bin/SensorKinect-MacOSX-5.0.0/
pseudo-2:SensorKinect-MacOSX-5.0.0 phober$ sudo ./install.sh
creating config dir /usr/etc/primesense…OK
copying shared libraries…OK
copying executables…OK
registering module ‘libXnDeviceSensorV2.dylib’ with OpenNI…dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /usr/lib/libOpenNI.dylib
Reason: Incompatible library version: libOpenNI.dylib requires version 2.0.0 or later, but libusb-1.0.0.dylib provides version 1.0.0
./install.sh: line 62: 5562 Trace/BPT trap niReg -r $INSTALL_LIB/$module $INSTALL_ETC

so now I’m stuck – is there a 2.0 version of libsusb somewhere out there – any advice?

thanks -


January 13, 2011 | 11:41 pm

@ donkey…

You will need to navigate to the folder using:

cd user/YOURNAME/Documents/OpenNI/Nite…/Sample/Bin

Then Enter

Then type ./Sample-PointViewer

I had the same problem.. can’t just drag since you need the "./" for the executable to run

I think that should fix it… maybe? Let me know…

@ pseudo

Not sure.. did you type

sudo port install libtool

AND

sudo port install libusb-devel +universal

?

You need to do both in the terminal. Its the +Universal part that threw a lot of us off at first. Let me know if that worked… I will delve a little deeper when I have a few…


January 14, 2011 | 4:40 am

@tohm:

I think I might have forgotten to restart every single time between steps (I don’t think it’s optional)

So I did a complete uninstall of MacPorts & then reinstalled – success!

got osceleton-osx going
got the Processing sketch going
got data going into Max

everything works!!

euphoria!!!

huge thanks for your work & your crystal clear instructions!

(one little thing that wasn’t entirely clear: exactly how to pose for calibration – it’s arms out sideways, elbows bent up at 90 degrees, hands straight up with palms facing camera)

thanks again!!! time for fun…


January 14, 2011 | 5:34 am

awesome!… glad it worked for you… and glad I could help.

I updated my post for the restarts and the pose…

cheers!


January 14, 2011 | 5:28 pm

@tohm

thanks o lot for your hints !
now i can run the Sample-PointViewer
i can see a white quare with lines, but i still
get many of this errors:
2011-01-14 17:57:16.423 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.458 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.491 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.522 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.559 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.591 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.622 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.660 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.690 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.726 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow
2011-01-14 17:57:16.758 Sample-PointViewer[301:903] GLUT Warning: GL error: stack overflow

any ideas ?
d.


January 15, 2011 | 8:08 pm

Hey, took me a few tries but got it working! thanks!

- you might want to add to your tutorial is that you need to close the NITE hand tracking sample before you start OSCeleton, it’s not immediately obvious that you can’t run both simultaneously.

- pose calibration works best if you hold your pose for as long as possible even if it says it’s failing.

QUESTION: anyone have any idea how to get the rgb data into max at the same time as the OSCeleton stuff? Running OSCeleton makes it impossible to run JM’s freenect.


January 15, 2011 | 10:04 pm

argh, avin2 still doesn’t support multiple apps accessing kinect on mac os x, so no current way it seems to get RGB into max with freenect while running osceleton


January 15, 2011 | 10:24 pm

@tohm – finally had some time at the weekend to give this a try. I really have to give you HUGE thanks for this – I’ve been trying to work out how to get the skeleton tracking running the last few weeks and your super-clear instructions were exactly what I needed – I’d managed to find a lot of these building blocks, but hadn’t quite got everything to work. Now it works a dream – fantastic!

@jeremybailey – boo, that’s exactly what I was going to try to do next!


January 16, 2011 | 4:29 am

@donkey

I am not sure… GLUT is the OpenGL that the apps are running (kinda like a max standalone with runtime in it). Sorry, no idea on that one…

@jeremy

Will add that, thanks… I have heard that the multiple is coming "shortly" but have no idea when.. but it will rule! One things that works great for me so far… resending the OSC… you can change the default send port to max and then send 7110 to Animata… great results…

@ Joseph
Glad it worked for you… have fun with it.

Also, Tony @ Sensebloom is working on the video this weekend… odds are, video will follow shortly…


January 17, 2011 | 1:25 am

@tohm, thanks for the reply, can’t wait!! will be watching closely. Here’s my very first output using osceleton http://www.youtube.com/watch?v=O5-pLktfvMg. It’s surprisingly robust!


January 25, 2011 | 5:44 pm

@tohm, Thank you so much for setting up this tutorial. I got everything working splendidly!
I do however have a question about more rough tracking. In my testing the skeleton sometimes can take a while to find the person, or sometimes not even connect at all (it seems like the kinect is biased against large people). For the project I am currently working on all i need is the spatial position of each user, which the sample programs seem to register almost immediately. is there any way to get general user info (i.e. ID & XYZ pos.) out via OSC as soon as the kinect recognizes them?

Thanks,
DG


January 25, 2011 | 7:28 pm

I found the same thing about being tall… very hard to fit in. But, the OSCeleton folks are working on allowing a small video so we can see what is going on and fi beter I think.

That might fix it as I found if I markled a spot that worked great, and then went to the same spot without seeing it, it worked… also, I noticed some delay as well with the newer version of the software… it might be that, but I am not sure…

One thing I found as well, since I am just "seeing what will sticks"… OpenNI seems to REALLY dislike loose clothing for the time being… even a loose tshirt sent my finding of a person back a few seconds.


January 25, 2011 | 7:33 pm

I’m sure I’m being naive, but is this not just partly a matter of the inclination of the Kinect? When actually connected to an XBox it ‘scans’ to find you (which is quite creepy), and it’s surprising how much it inclines upwards even for a relatively normal 6 footer like myself.. I’ve been using jit.freenect.grab to control the tilt (though of course it can’t be connected to the Kinect at the same time).

I have found it hard to find the right spot too though – picture in picture would definitely really help!


January 25, 2011 | 8:36 pm

Thanks guys, but I was wondering more about just getting data about the position of the user. I have been experimenting with using a bunch of people in the 'psi pose' and i agree there are positions and clothing that help/hurt, but the environment I will be doing this in will have a lot of different people with a lot of different clothing and body shapes and I will not be able to tell them to take off their jacket or step back or whatever. I do not need specific skeleton data, just the general XYZ of the user. I have seen some of the sample patches lock onto the position of a user immediately, and I was just wondering if anyone knows a way to get this into Max. I have attached a sample pic of what I am talking about.

Thanks,

[attachment=152125,1721]

Attachments:
  1. multipleusers.png

January 25, 2011 | 9:52 pm

Hello,
I get no problem until the "Into OpenNI (finally)" step.

As said I’ve downloaded the unstable version, here:

https://github.com/OpenNI/OpenNI/tree/unstable

I put the folder in a "OpenNI" folder of my own,
gave the path to the terminal, and typed in:

sudo ./install.sh

The terminal tells:
sudo: ./install.sh: command not found

I tryed to do a copy of this install.sh (found in OpenNI/OpenNI-OpenNI-4c9ff97/Platform/Linux-x86/CreateRedist/) because I could not find any "MacOSX" folder in the "Platform" folder …

But without success.
Disappointed …
Can it be a bad openNI unstable version downloaded or … ? Any idea?


January 26, 2011 | 3:25 am

@ Novus
Sorry, not sure on that one.. try the OSCeleton group, Tony might be able to help you

@Kyred
I think you need the mac only version, not the one from github (which is pc and linux only)

http://www.openni.org/downloadfiles/openni-binaries/20-latest-unstable
or

http://www.openni.org/downloadfiles/openni-binaries/latest-unstable/24-openni-unstable-build-for-macosx-10-6-universal-x86x64-3264-bit-v1-0-0/download

and download the mac version at the bottom… that should fix it


January 26, 2011 | 3:15 pm

Okay, many thanks tohm.

I think the version was for linux. Now it works fine with your link (OSX)
I had to rename the "osceleton" file in "osceleton-osx" and do a "chmod 755 osceleton-osx" in the terminal, because it was giving me a "Permission denied" at the OSCeleton step of your tutorial.
(The link you forgot to mention at this step is: https://github.com/Sensebloom/OSCeleton)

Now I get this:
—————
Initialized Kinect, looking for users…

Warning: USB events thread – failed to set priority. This might cause loss of data…
New User 1
Calibration started for user 1
Calibration failed for user 1
Calibration started for user 1
Calibration failed for user 1
Calibration started for user 1
Calibration failed for user 1
Calibration started for user 1
Calibration failed for user 1
———————–
and so forth … calibration seems terribly unstable.
Is there anything to do? does it come from usblib?
So close to the goal :-(


January 26, 2011 | 3:39 pm

@tohm
Will do, thanks a lot.

@Kyred
They just updated osceleton on the github page, which is supposed to make calibration easier.


February 2, 2011 | 3:36 pm

Okay now it works fine, thanks to all.



div
February 4, 2011 | 4:32 am

Hey all,

I would really like to get this working but the sudo port install libusb-devel +universal gets an error

—> Fetching libusb-devel
Error: Target org.macports.fetch returned: Git clone failed
Error: Status 1 encountered during processing.
To report a bug, see < http://guide.macports.org/#project.tickets>

I can’t seem to find a terminal command to install it.

Any thoughts would be really appreciated.

Best

TIm


February 4, 2011 | 1:39 pm

I have heard Homebrew works cleaner and easier for some, try this:

http://openkinect.org/wiki/Getting_Started#Homebrew


February 25, 2011 | 4:20 am

@tohm
I havent been able to get any data into Max. I followed your instructions (including the restarts) and have gotten far enough where osceleton has seen and configured users..but still nothing into max…

any ideas?

thanks
-Levy

(I tried MacPorts first, but then went for Homebrew instead for ease of use…)

UPDATE: I can get the data in max now, but i keep getting Segmentation Faults from OSCeleton…


February 25, 2011 | 4:44 am

Is there any way to visualize what OSCeleton is tracking? to a jit.pwindow..etc..for example?


February 25, 2011 | 4:04 pm

@shalom2you

the seg faults are being worked on last I heard… I have not had a chance to work with it in a while, so I have not gotten a chance to test the newest version…

most of this is still in alpha, so there will be lots of errors that pop up from time to time… be sure to check in with the OSCeleton group for more info and fixes

http://groups.google.com/group/osceleton



dtr
February 25, 2011 | 9:51 pm

running great here! http://vimeo.com/20059518

@shalom2you: just feed the joint coordinates into jit.gl.sketch vertex points and there’s your visualization…

about seg faults, it seems to happen to me most often when objects are very close to the cam, perhaps within the dead zone where it can’t see very close objects. it happens much less when looking into an open space with objects at a greater distance. i didn’t try but i can imagine it’d crash all the time if the cam was sitting on my desk littered with stuff just in front of it.


February 26, 2011 | 10:20 pm

hmm…not sure I understand…


June 24, 2011 | 5:58 pm

Hi,
I am new to using OSCeleton. I have been working on getting skeletal
information in max (using the popular tohm judson patch as a starting
point) and I have a couple of questions I hope you can help me out
with.
1. How do you access the /user/id x y z message in max?
2. How can the skeletal coordinates be converted into a x,y,z
coordinates of a global coordinate system with the kinect as 0,0,0?
3. Can the orientation or rotational coordinates of a joint be
obtained from the skeletal data (to find what angle/direction the
person is orientated in relation with the kinect)?
Hope you can help me out.
Thanks in advance


July 3, 2011 | 4:47 pm

Hello,
i tried to follow the tohm’s tutorial to get osceleton working, but most of the link are dead there.
Any luck, someone could pack all these files and upload it ?

thanks a lot!

freeka


July 3, 2011 | 5:58 pm

sorry i talk shit, found it….


July 3, 2011 | 9:32 pm

OK, all the installation went good, no error.
But for some reason i got nothing coming out from osceleton, i got the message confirming the tracking is starting but nothing in max… i doubled-checked using Osculator on port 7110, reboot,etc but still nothing
anyone had the same experience ?

10.6.7

New User 1
Calibration started for user 1
Calibration complete, start tracking user 1


July 6, 2011 | 9:25 pm

@freeka i had the same problem, so i change the port in max to 7400 and then start Sensebloom with this

./osceleton -p 7400 -w

working well now


July 7, 2011 | 12:58 am

i will try that, but as we said here :

http://cycling74.com/forums/topic.php?id=31383

version 1.0 works perfect

thank you


September 5, 2011 | 3:39 am

Hello All ::

I’ve got problem for http://tohmjudson.com/?p=30

I think is a different version problem. I download openni for this version "OpenNI Unstable Build for MacOSX 10.6 Universal x86/x64 (32/64-bit) v1.3.2.3" and
"PrimeSense NITE Unstable Build for MacOSX 10.6 Universal x86/x64 (32/64-bit) v1.4.1.2" ,follow the tutorial do , when I use Terminal type sudo ./install.sh , it say no command line. so I can’t type Primesense license key either .

I worked on Mac Snow Leopard 10.6.8 2.26GHz Intel Core 2 Duo , 4G ram

are anybody got same problem ???

thanks.


October 27, 2011 | 11:01 pm

@kdcl (+anyone else) I am having same issue (nite-bin-macosx-v1.4.1.2 5mg3$ sudo ./install.sh
./install.sh: line 27: niReg: command not found)

I was mistaking NITE for OpenNI files.


November 3, 2011 | 8:02 pm

@Tohm – The new NITE bundlehas changed so the "copy 3 files" step is obsolete..I have instead copied the license key into the 3 XML file with NITE>Data but still to no avail! :(

Can you , or anyone assist, please?


November 3, 2011 | 8:16 pm

@5mg3
Have you tried Zigfu installer for the OpenNI bit?


November 3, 2011 | 10:40 pm

No Luke, I havent even heard of this installer?..

How do I go about it this way?


November 3, 2011 | 10:59 pm

http://site.zigfu.com/main/index


November 9, 2011 | 12:53 am

@ Luke – Thanks man I have installed using Zigfu. I am now at OSCeleton part and stuck again. I follow the instruction provided by Tohm but appear to get nothing? Do you know what to do after the Zigfu install instruction on the Zigfu page to then follow through to OSCeleton > Processing > Max?


November 9, 2011 | 10:17 am

Did you install libtool at some point? Have a look here:

http://site2.zigfu.com/en/blog/2011/08/22/install-openni-on-mac/

When you say you get nothing, do you get errors or something? I take it you are running OSCeleton from the terminal? What does it say when you run it?


November 9, 2011 | 10:44 pm

Yeah I installed libtool etc at the start as per Tohm’s instructions.

I am not sure I am doing it correctly as I find the instructions slightly vague..but it doesn’t find the make file when I drag the folder to terminal and type ‘make’.

How exactly do I run it? It is different from the rest as it doesn’t have an ./install.sh file


November 10, 2011 | 9:26 pm

Okay. I may have got that working as it ran a hefty few lines in terminal. However, I am trying the test with processing (the next step) and another issue arises..the pbox2d the instructions direct to is not there..I had to source elsewhere. When I run processing after following the instructions I get the error message in processing "pbox2d does not exist" even though it is in the correct place: Processing > libraries. It has found oscP5 fine.

So in short: I cant test whether everything I have done so far is correct :S


January 14, 2012 | 10:22 am

A bit confused with regard to why I’m not seeing the data in Max with Tohms patch. Have all the necessary s/ware installed correctly. I’m getting data values on all the joints using Jon Bellona’s Kinect via OSC patch here:
(http://deecerecords.com/kinect.html). But there’s no data being received with Tohms patch. Has anyone any ideas why?


January 14, 2012 | 3:45 pm

Tohm

I have been using your thing on PC for awhile – great work! Thanks so much!


May 4, 2012 | 3:53 pm

Hello ,
im having problems with installing OpenNi,
keep getting loads different errors,

i get this for Open NI and Nite:
Referenced from: /Users/rorobafa/lib/libOpenNI.dylib
Reason: Incompatible library version: libOpenNI.dylib requires version 2.0.0 or later, but libusb-1.0.0.dylib provides version 1.0.0

and i get this for sudo port install libusb-devel +universal
Error: Target org.macports.fetch returned: Git clone failed

i quit want to uninstall everything i’ve done and start over!! but i dont know how to so that?
or can anyone tell me what can i do now?
im actually trying to get OSCeleton work but i’ve stuck here to days now!!!!
thanks
ruzhin


May 27, 2012 | 1:41 pm

hey guys….i already have problems with libtool….i get the following:
can anybody help please?

—> Configuring libusb-devel
Error: Please do not install this port since it has been replaced by ‘libusb’.
Error: org.macports.configure for port libusb-devel returned:
Please see the log file for port libusb-devel for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libusb-devel/libusb-devel/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port libusb-devel failed


August 3, 2012 | 12:44 am

Im getting the same error ^^ as jazzisfaction :(


August 21, 2012 | 2:40 am

new-host-6:~ Evan$ cd /Users/Evan/Downloads/NITE-Bin-Dev-MacOSX-v1.5.2.21/Samples/Bin/x64-Release
new-host-6:x64-Release Evan$ ./Sample-PointViewer
1326 INFO New log started on 2012-08-20 22:34:42
1379 INFO OpenNI version is 1.5.4 (Build 0)-MacOSX (May 16 2012 10:22:58)
1408 INFO — Filter Info — Minimum Severity: UNKNOWN
One or more of the following nodes could not be enumerated:

Ideas?


Viewing 50 posts - 1 through 50 (of 50 total)