Page 1 of 1

OSC - Syntax help

Posted: 04 Dec 2012, 17:55
by joschy
Hello,
I've tried to connect OpenTSPS with Ventuz via OSC. Here are the TSPS-OSC Protocol:

http://opentsps.com/docs/tsps-osc-protocol

I have setup a OSCIn Node with the correct port etc and tried this adress:
/TSPS/personEntered /0

and this
/TSPS/personEntered /pid

Error:
17:50 04.12.2012 Error : OSC Purge: Error purging messages: Error purging and dispatching OSC messages: OSC Address part #3 can not be empty / OSC Address part #3 can not be empty


What is wrong?

Re: OSC - Syntax help

Posted: 04 Dec 2012, 23:37
by joschy
Thanks Alex,
I don´t very familiar with the OSC syntax. Is it possible to use only certain arguments, example if I only want the pid data?

I found this:
An OSC message consists of an OSC Address Pattern followed by an OSC Type Tag String followed by zero or more OSC Arguments.

Interpreted to the TSPS protocol:
<OSC Address Pattern> = /TSPS/personEntered
OSC Type Tag String = i for int32 or f for float32

Looks like this:
/TSPS/personEntered ,iiiffff

I will check this tomorrow...

Tia

Re: OSC - Syntax help

Posted: 05 Dec 2012, 11:00
by TobiTobsen
Hi,
you have to parse all incoming data.
Using the OSC In Node in Ventuz, you have to tell the node the order of the incoming data. Otherwise it won't work...

So lets have a look at this message (found here: http://opentsps.com/docs/tsps-osc-protocol)
/TSPS/personEntered
--> This is your OSC Adress Pattern

Messages are:

0: pid;
1: oid;
2: age;
3: centroid.x;
4: centroid.y;
5: velocity.x;
6: velocity.y;
7: depth;
8: boundingRect.x;
9: boundingRect.y;
10: boundingRect.width;
11: boundingRect.height;
12: highest.x
13: highest.y
14: haarRect.x; - will be 0 if hasHaar == false
15: haarRect.y; - will be 0 if hasHaar == false
16: haarRect.width; - will be 0 if hasHaar == false
17: haarRect.height; - will be 0 if hasHaar == false
18: opticalFlowVectorAccumulation.x;
19: opticalFlowVectorAccumulation.y;
20+ : contours (if enabled)

Lets assume countours are disabled: The software will send 20 Values (Starting with 0 the Person ID and ending with opticalFlowVectorAccumulation.y (whatever this is...?)
Now have to figure out which type of data is send (eg: int, float, bool etc).
This seems to be not very well documented in the page. But If you look at the source documenation you should be able to figure out the data format.
For example the Person:
http://labatrockwell.github.com/openTSP ... erson.html

There you can see that PID is an Integer, Age as well.

Cheers,
Tobi

Re: OSC - Syntax help

Posted: 05 Dec 2012, 11:28
by TobiTobsen
Found this here in the vvvv Patch in the examples:

0 - int - blob ID
1 - int - blob age
2 - float - blob center x
3 - float - blob center y
4 - float - blob velocity x
5 - float - blob velocity y
6 - float - blob bounding rectangle x (e.g. the top left corner of the blob)
7 - float - blob bounding rectangle y
8 - float - blob bounding rectangle width
9 - float - blob bounding rectangle height
10 - float - average optical flow at center x
11 - float - average optical flow at center y

if you are sending contours, the rest of the osc message is filled with contour
arguments, starting at message[12] + message[13] and continuing until the end

12 - float - contour[0] x
13 - float - contour[0] y

Re: OSC - Syntax help

Posted: 05 Dec 2012, 11:31
by joschy
Hi Tobi,

thank you for the detailed description. That´s the way it should work, but under win7 it seems that TSPS communication don´t work at all. I´ve had tried the unity3d example under win XP and it worked fine, under win7 not. No incoming data.

Cheers,
joschy

Re: OSC - Syntax help

Posted: 05 Dec 2012, 11:57
by TobiTobsen
Sure!
If I find some time I'll give it a try, I tried it just very quick and struggeled trying to make the libusb work...
:-)

Cheers,
Tobi

Re: OSC - Syntax help

Posted: 05 Dec 2012, 13:13
by joschy
That would be superb :P

TSPS is a cool app and in conjunction with ventuz there are nice realtime installation possible.

Cheers,
joschy

Re: OSC - Syntax help

Posted: 19 Dec 2012, 12:49
by joschy
Me again...

May be I have a error in reasoning. I have to look at the OSC net Framework:
http://www.bespokesoftware.org/wordpress/?page_id=69

There is a sample program with transmitter and receiver, with source code. When I look at the receiver program I understand what is going on and understand the output also, see pic attached.

Is it possible to pick from the message.Data[] list some depositions and catch them with the OSC nodes in Ventuz?

I know the port: 5103
The OSC address: /osctest/test

Re: OSC - Syntax help

Posted: 19 Dec 2012, 14:51
by joschy
Got it get to work :P