GithubHelp home page GithubHelp logo

mkalten / tuio20_cpp Goto Github PK

View Code? Open in Web Editor NEW
50.0 12.0 21.0 2.8 MB

C++ TUIO 2.0 reference implementation

License: GNU Lesser General Public License v3.0

C++ 100.00%
tuio c-plus-plus library tuio-client tuio-tracker tuio-simulator tuio2

tuio20_cpp's Introduction

TUIO 2.0 C++ Library

TUIO 2.0 is an open framework that defines a common protocol and API for tangible interactive surfaces. The TUIO protocol allows the encoding and transmission of an abstract description of interactive surfaces and tangible objects, including their geometries and relations as well as multi-pointer input.

http://www.tuio.org/?tuio20

Current Implementation

  • encapsulates the TUIO 2.0 Token, Pointer, Symbol and Bounds components
  • provides Server and Client implementations for TUIO 2.0 encoding/decoding
  • optional TCP and Flash transport layers in addition to the default UDP transport
  • supports the multiplexing of multiple TUIO2 sources

Alpha Code and API

This library currently only implements a subset of the TUIO 2.0 specification, the remaining object geometries and relations will be added subsequently. The current code also defines a general API for the encapsulation of TUIO components. This API is already quite usable, but may still contain several partially or badly implemented sections, which are obviously subject to completion, change and improvements.

Example Projects

Apart from the actual cross-platform TUIO 2.0 implementation, this repository also provides several example projects that serve for the illustration and testing of the overall API functionality. This includes TUIO 2.0 client and server demonstrations with a simple SDL2 GUI as well as some simple console test applications. These examples should equally work on Linux, Mac OS X and Windows operating systems, the according Makefile as well as XCode and Visual Studio project files are included. The Windows project already include the necessary libraries, to build the GUI example on Linux make sure you have the SDL2, OpenGL and GLUT libraries and headers installed on your system, the latest version 2.0.4 is recommended. On Mac OS X you need to install the SDL2 Framework to /Library/Frameworks.

Integration and Testing

Developers are encouraged to integrate this TUIO 2.0 library into their projects, in order to support the development and testing of this common shared code base. The library is licensed under the LGPL in order to facilitate this collaboration.

Feedback and Consultation

Please use the provided Github infrastructure for the discussion related to the design and implementation of this library or the TUIO 2.0 specification in general. Any suggestions for improvements of the API design and code quality are most welcome, and should be submitted and discussed through pull requests.

For any other inquiries please get in touch with Martin Kaltebrunner via martin[at]tuio.org, although you may need to insist to receive a reply on this noisy communication channel.

tuio20_cpp's People

Contributors

floe avatar mkalten avatar payload avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tuio20_cpp's Issues

Duplicate 'add ptr' events being incorrectly generated

When receiving two pointers with the same data, the reference implementation incorrectly generates two 'add ptr' events for the same session ID.

Consider the following 3 TUIO bundles, being processed by the Tuio2Dump demo application:

/tuio2/frm 20668 7089359197171840187 537399850 Ultra 022001000104
/tuio2/alv

/tuio2/frm 20669 7089359197438128160 537399850 Ultra 022001000104
/tuio2/ptr 101027 65536 0 0.409512 0.49871 0 0 0 0.136719
/tuio2/alv 101027

/tuio2/frm 20670 7089359197695826198 537399850 Ultra 022001000104
/tuio2/ptr 101027 65536 0 0.409512 0.49871 0 0 0 0.136719
/tuio2/alv 101027

This will generate two 'add ptr' events for pointer with session ID 101027, although, frame 20669 should generate a 'add ptr' and frame 20670 should generate a 'set ptr' event.

My suspicion, is that here:

if (tptr == NULL) {
tptr = new TuioPointer(frameTime,tobj,t_id,u_id,c_id,xpos,ypos,angle,shear,radius,pressure);
tobj->setTuioPointer(tptr);
} else if ( (tptr->getX()!=xpos) || (tptr->getY()!=ypos) || (tptr->getAngle()!=angle) || (tptr->getShear()!=shear) || (tptr->getRadius()!=radius) || (tptr->getPressure()!=pressure) || (tptr->getXSpeed()!=xspeed) || (tptr->getYSpeed()!=yspeed) || (tptr->getPressureSpeed()!=pspeed) || (tptr->getMotionAccel()!=maccel) || (tptr->getPressureAccel()!=paccel) ) {
tptr->update(frameTime,xpos,ypos,angle,shear,radius,pressure,xspeed,yspeed,pspeed,maccel,paccel);
}

the update event should occur even if the pointer data is the same, as long as the time is different.

Is my interpretation correct, or am I missing something?

Won't build?

1>------ Build started: Project: libTUIO2, Configuration: Release Win32 ------
1> IpEndpointName.cpp
1> NetworkingUtils.cpp
1> UdpSocket.cpp
1> OscOutboundPacketStream.cpp
1> OscPrintReceivedElements.cpp
1> OscReceivedElements.cpp
1> OscTypes.cpp
1> FlashSender.cpp
1> OscReceiver.cpp
1> TcpReceiver.cpp
1>..\TUIO2\TcpReceiver.cpp(30): error C2371: 'int32_t': redefinition; different basic types
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdint.h(19): note: see declaration of 'int32_t'

1> TcpSender.cpp
1> TuioBounds.cpp
1> TuioClient.cpp
1> TuioComponent.cpp
1> TuioDispatcher.cpp
1> TuioManager.cpp
1> TuioObject.cpp
1> TuioPoint.cpp
1> TuioPointer.cpp
1> TuioServer.cpp
1> Compiling...
1> TuioSymbol.cpp
1> TuioTime.cpp
1> TuioToken.cpp
1> UdpReceiver.cpp
1> UdpSender.cpp
1> WebSockSender.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

No limit on TuioComponent path list size

Currently the TuioComponent only adds new points to the list, without limiting its size. This can lead to big memory usage for objects that are tracked for a long time.

PointerId

Hi,

I have a question regarding component IDs of Tuio2 pointers. The specification says:

it defines a Component ID that allows the distinction of individual pointer components during a whole session.

However, in TuioClient, you initialise the pointer like so

new TuioPointer(frameTime,tobj,t_id,u_id,c_id,xpos,ypos,angle,shear,radius,pressure);

where c_id is actually the pointer_id of TuioPointer. So my questions are, is component id the same as pointer id, and what is its actual purpose? I see the explanation, but don't really get it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.