Yishi's Blog

All about my Google Summer of Code project

TUIO in CCV

with 3 comments

TUIO is an open framework that defines a common protocol and API for tangible multitouch surfaces. The TUIO protocol allows the transmission of an abstract description of interactive surfaces, including touch events and tangible object states. This protocol encodes control data from a tracker application (e.g. based on computer vision) and sends it to any client application that is capable of decoding the protocol.

As the above said, we use TUIO for communication with client applications. For doing that, there is a TUIO class in CCV and 2 addons for openFrameworks:

  • ofxOsc (by Damian Stewart, which wraps oscpack to allow you to communicate to and from an openframeworks application using the OSC protocol)
  • ofxNetwrok (by Theo Watson and Ars Electronica Futurelab, which contains cross platform network code for UDP and TCP communication, as well as multicast.)

We can see them in the header file of TUIO class:

#include "ofxOsc.h"
#include "ofxNetwork.h"

And the fields of them:

// TCP Network
ofxTCPServer  m_tcpServer;
// OSC Network
ofxOscSender  TUIOSocket;

Okay, there are three methods of TUIO class:

  • setup() (Set the host-address, OSC port and TCP port)
  • setMode() (Set the modes (bool type): fingers, objects and fiducials)
  • sendTUIO() (Send out the messages)

In the sendTUIO() method, the messages will be sent by three modes:

  • OSC Mode (In this mode, it can sends messages about fingers/objects/fiducials. And it uses the TUIOSocket.sendBundle() method for sending them.)
  • TCP Mode (In this mode, it can sends messages about fingers/objects/fiducials too! And it uses the m_tcpServer.sendToAll() method for sending them by using XML string.)
  • Binary Mode (But in this mode, it can just sends messages about fingers, objects and fiducials are not implemented. And it uses the m_tcpServer.sendRawBytesToAll() method for sending fingers messages.)

That’s all about TUIO. :)

Written by e10101

May 9th, 2011 at 3:54 pm

Posted in Uncategorized

3 Responses to 'TUIO in CCV'

Subscribe to comments with RSS or TrackBack to 'TUIO in CCV'.

  1. can i send from ccv TUIO on more ports? default is set on 3333, can i send it on 3334 in a same time too?
    if yes, how can i do that? here is my settings from config.xml file of ccv:

    127.0.0.1
    0
    3333
    3000

    what i need is send out tuio from ccv to two visual applications in a same time.
    thank you in advance!

      (Quote)  (Reply)

    dan

    8 Nov 11 at 10:28 am

  2. can i send TUIO from ccv on more ports? default is set on 3333, can i send it on 3334 in a same time too? if yes, how can i do that? here is my settings from config.xml file of ccv:

    NETWORK
    LOCALHOST 127.0.0.1 /LOCALHOST
    TUIO 0 /TUIO
    TUIOPORT_OUT 3333 /TUIOPORT_OUT
    TUIOFLASHPORT_OUT 3000 /TUIOFLASHPORT_OUT
    /NETWORK

    what i need is send out tuio from ccv to two visual applications in a same time.
    thank you in advance!

      (Quote)  (Reply)

    dan

    8 Nov 11 at 10:35 am

  3. dan,

    As shown in the ofxNCoreVision.cpp:
    tmpPort = XML.getValue("CONFIG:NETWORK:TUIOPORT_OUT", 3333);
    tmpFlashPort = XML.getValue("CONFIG:NETWORK:TUIOFLASHPORT_OUT", 3000);
    myTUIO.setup(tmpLocalHost.c_str(), tmpPort, tmpFlashPort); //have to convert tmpLocalHost to a const char*

    if you really want to send the info on 3334, maybe you should change the source code. Add another TUIO instance.
    :)

      (Quote)  (Reply)

    admin

    9 Nov 11 at 12:04 am

Leave a Reply