I am currently trying to read Tuio signals with ofxOSC which basically works since I can read all the tuio messages in OF. I have a few generall questions though. What I want to do is basically to get the x and y coordinates of all the blobs detected by an infra red camera (I am currently simply using a wii remote).
If I really only want the current messages (positions of the blobs) do I simply delete all of them at the beginning of each frame so that I only use the ones I received at that certain frame?
If I understand TUIO correctly I receive three messages:
set (includeing position and other things about the blob)
alive(the current count/ids of detected blobs)
and fseq(containing a unique frame ID)
So now If I simply want to get the position for each blob detected, I would for example simply create one ofxVec2D for each “set” I received at that frame?
What would I need the “alive” for?
Does anybody have experience with this?
have you look at this http://reactable.iua.upf.edu/?tuio
They give information about the ‘alive’ message.
yes, thats what I read allready. But I don’t really understand what I need it for (or if I need it for my simple purposes) because the set statement gets called for each blob detected allready and also contains the same unique ID as the alive statement does.
it seems to me that the ‘alive’ message offer an easy way to have access to all the uniqueIDs for each frame. Instead of having to go through all the ‘set’ messages.
Hi Moka, are you using the reactivision client API (http://reactable.iua.upf.edu/?software) to receive the tuio? or OSC directly? I’ve not used OSC directly to read TUIO messages, but have used the reactivision client API which is very easy to use. You get an array of blobs every frame numbered with a finger ID (which is the id of the blob 1…current number of blobs), and a session ID (which increments everytime a new blob is introduced, allowing you to differentiate new instances of blobs) - dunno if that was helpful in anyway
I am currently receiving the messages using OSC directly but thats actually harder than I thought. I will try that api even though it would be the best to get it running with ofxOSC only.
Since there’s a c++ TUIO client, it would probably be best to port it to OF and use the ofxOSC. You can use the client code to see the format. Also, we have AS3 TUIO classes that parse TUIO messages if you’d like to see how that’s setup. Here’s the link to our AS3 code: http://code.google.com/p/touchlib/source/browse/#svn/trunk/AS3/int/flash/events. The main function that parses the messages is under processMessage(msg:XML):void although it’s parsing XML (what flash needs) instead of OSC.
We’re about to release a TUIO OF tracker and we will also be needing an OF TUIO client/parser like what you’re doing, so it’ll be great if you get this working.
Okay, I will see what I can do about it in the next days. I downloaded the C++ client but it’s a little bit confusing on the first view.
memo, did you get the c++ client to work within OF using xCode?
Hey Moka, yea the C++ client library is working fine with OF / Xcode. I only just got round to cleaning up my sample and uploading it. You can find it at http://code.google.com/p/ofxmsaof/downloads/list (ofxReactivision)
This is using the reactivision library straight up with their own oscpack (instead of ofxOsc). I didn’t want to edit their code too much to use ofxOsc so if & when they release new versions it’ll be easy to update. I did have to make some very minor alterations to the code though, can’t remember what. The library does the osc message parsing in a separate thread and I remember having to put #ifndef WIN32 and #ifdef WIN32 in a few places… so this code probably won’t work on windows…
Haven’t had a chance to try your ofxTuio yet, but the poco approach is probably more flexible.
hi everybody , congrats for your labor , can somebody upload an example using codeBlocks? or it is imposible use this addon with this compiler
thanks and good luck!!