ofxTuio

Thanks a bunch Zach!

Will give it a go right now…

Not to hijack this thread but I am experiencing some errors when I try to compile an alltestexample with all the addons to see if it works with everything. I am using codeBlocks to compile on windows.

Here are the errors:

  1. There seems to be a problem compiling ofxOscReceiver.cpp with this poco release. I have not had this problem with the 0.05 CB release. The error is with this line of code:
  
ofxOscReceiver::ofxOscReceiver()  
{  
#ifdef TARGET_WIN32  
	mutex = CreateMutex( NULL, FALSE, NULL );  
#else  
	pthread_mutex_init( &mutex, NULL );  
#endif  
}  

error: `CreateMutex’ was not declared in this scope

  1. Then I had a bunch of linking errors with ofxVectorGraphics like this:

obj\release\addons\ofxVectorGraphics\src\ofxVectorGraphics.o:ofxVectorGraphics.cpp:(.text+0x7e2)||undefined reference to CreEPS::newFile(char const\*, float, float, float, float, bool, char const\*)'| obj\release\addons\ofxVectorGraphics\src\ofxVectorGraphics.o:ofxVectorGraphics.cpp:(.text+0x89a)||undefined reference toCreEPS::applyTranslation(float, float)’|
obj\release\addons\ofxVectorGraphics\src\ofxVectorGraphics.o:ofxVectorGraphics.cpp:(.text+0x8b7)||undefined reference to `CreEPS::applyScaling(float, float)’|
obj\release\addons\ofxVectorGraphics

Am I doing something wrong here?

can you post a zip of the project you are trying to compile -
about OSC I’m not sure…

I’m happy to take a look -

about ofxVectorMath, looks like you are missing some .cpp files from the library that addon uses (see the install.xml for the complete list)…

take care!
zach

Hi Zach,

Here is the link to the zipped project files:
http://www.progenlabs.com/OF/alltestexample.zip

As for ofxVectorGraphics, I’m sure I’ve added in all the necessary includes.

Thanks again

for the ofxOsc problem, change the #include in ofxOscReciever to

  
#include <deque>  
#include "ofConstants.h"  

instead of

  
#include <deque>  
#include <ofMain.h>  

I’ll investigate this - it’s curious…

about the vectorMath problem, I think you have not included the lib src code from ofxVectorMath (check the 0.05 allTestExamples to see what I mean)…

hope that helps!
zach

Thanks for the help Zach…

It compiles now. Yep you were right I forgot to add the libs src into the workspace.

I’m a complete noob to poco and was wondering how I could add additional received TUIO messages like number of blobs, area, etc. into moka’s current code?

and make sure you have the newes ofxOSC. You can get it here:

http://forum.openframeworks.cc/t/ofxosc-v0.3-now-available/970/0

Thanks for the headsup moka. I noticed that the new ofxosc supports bundles and being a complete newbie to osc, was wondering what are bundles for?

@moka: I’ve recently hooked up ofxtuio with OSCemote and it works great. Right now, would like to be able to receive other data besides the x,y,id that u implemented such as velocity, acceleration, blob area, etc. Are you going to implement them any time soon? Or how would I go about doing it on my own?

Look at the methods in ofxTuioContainer:

  
	virtual float getXSpeed(){  
		return xspeed;  
	};  
	  
	virtual float getYSpeed(){  
		return yspeed;  
	};  
	  
	virtual float getMotionSpeed(){  
		return motion_speed;  
	};  
	  
	virtual float getMotionAccel(){  
		return motion_accel;  
	};  

to have access to the actual cursors and blobs use:

  
	list<ofxTuioObject*> getTuioObjects() {  
		return objectList;  
	};  
	  
	list<ofxTuioCursor*> getTuioCursors() {  
		return cursorList;  
	};  
  

in the ofxTuioClient file.

I might post an example of that. The events are really only to check if a cursor or object updated in any way. if you actually want to work with the data use the above functions.

I did not test it in detail but thex should work. I will upload another example on the weekend.

Looking forward to your examples.

A question: Is it possible to detect the number of blobs or fingers currently on the screen through the session ids?

there are plenty ways to get the number of alive blobs. the easiest way would be to get the length of the list of alive objects or cursors.

hi all,

i have downloaded CB_FAT for linux with all latest addons, but i can’t make ofxTuio work…the problem seems to be at ofxOscReceiver.cpp, as I get several errors like this:

main.cpp:(.text._ZN7testAppC1Ev[testApp::testApp()]+0x366)||undefined reference to `ofxOscReceiver::ofxOscReceiver()’

anyone can shed some light over this?? i’ve been reading the whole forum looking for a possible solution unsuccessfully…thanks!!!

million thanks

Have you added ofxOSC to your project?

and do you have poco installed?

it’s working now…i added ofxOsc to the cb project and no problem…before it was only added in the link section of the xml file

thanks cerupcat :slight_smile:

f.-

Hello!
Playing around with the ofxTuio addon in conjunction with tbeta and the tuio java simulator, I came across an issue (but I don’t even know if it is an issue).
When adding

  
cout<<tuio.getTuioCursors().size();  

to every tuio event in testApp I should get the actual number of cursors (or is this my first mistake?). When pressing down one finger i get one, when moving one finger I get one, but when releasing this one finger I still get one. Shouldn’t this be zero?
If it shouldn’t, well then I’m sorry for this useless post and will take a walk (what I should do anyways)…aaaaand have another question: do I have to remove this one finger in the getTuioCursors manually (by id, I guess) or is there a list with the actual fingers (given the case I have more than one finger down)?

Thanks a lot,
Gestalt

actually it should all happen automatecally. maybe your tracking software does something wrong?

I just tested it again and I get the correct results for all active cursors.

I will rework the addon pretty soon anyways for the new OF OSC version and for the upcoming next version of TUIO in general.

Hello moka and thanks for your reply!

Are you really shure, that it works for you? I tried it with the Tuio Simulator of reactivision and tbeta. both give me the same results.
I read my previous post once again and maybe it didn’t make the point:
at the frame I remove the (one) finger, it should give me zero (I think), but it gives me still one.
Here’s the test I did:
added

  
cout<<tuio.getTuioCursors().size()<<endl;  

to every testApp::tuio…Event
Build and Go
pressed one point with the tuio simulator, got

  
1  
28 Down: X: 713 Y: 339  

release the point, got

  
1  
28 Up: X: 713 Y: 339  

The problem is, that I’m not intrested in where the released point was, but in the remaining (still active) points, which I get the next time I make an tuio.getMessage()…so one frame later. Or I keep track of active/released fingers by myself…maybe it’s one more sth. like the chicken/egg problem.

Thanks for your help,
Gestalt

well I only tested it with tuio simulator and it works fine for me. as soon as I release a cursor it’s gone.

I am sorry but it’s prett hard to tell whats wrong with your setup from my point of view.

The release event is correct. if a cursor is released you get its id and position. the only weird thing is that it always gives you a size of 1 of your cursorList because thats not supposed to happen.