GithubHelp home page GithubHelp logo

mkalten / tuio11_cpp Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 29.0 22.66 MB

C++ TUIO 1.1 reference implementation

License: GNU Lesser General Public License v3.0

Makefile 0.17% Objective-C 0.41% C++ 23.55% C 75.87%
tuio c-plus-plus library tuio-tracker tuio-client tuio-simulator

tuio11_cpp's Introduction

TUIO C++ Reference Implementation and Demo Applications

Copyright (c) 2005-2017 Martin Kaltenbrunner. This software is part of reacTIVision, an open source fiducial tracking and multi-touch framework based on computer vision. For further information on the TUIO protocol and framework, please visit TUIO.org

Demo Applications:

This package contains two demo applications which are able to receive TUIO messages from any TUIO enabled multitouch or object tracking application.

  • TuioDump: prints the TUIO events directly to the console
  • TuioDemo: graphically displays the object and cursor states on the screen
  • SimpleSimulator: a simple TUIO simulator that demonstrates the use of the TuioServer class

You can use these TUIO client and server demo applications for debugging purposes, and using them as a starting point for the development of you own open source C++ applications implementing the TUIO protocol.

Pressing F1 will toggle FullScreen mode within the TuioDemo,
pressing ESC or closing the Window will end the application.
Hitting the V key will print the received TUIO events to the console.

Dragging the mouse will generate TUIO cursor events within the SimpleSimulator.
Pressing the SHIFT key while clicking, will produce "sticky" cursors.
Pressing the CTRL key while clicking, will create "joint" cursors.
Hitting the V key will print the generated TUIO events to the console.
Hitting the R key will reset the SimpleSimulator.

Keep in mind to make your graphics scalable for the varying screen and window resolutions. A reasonable TUIO application will run in fullscreen mode, although the windowed mode might be useful for debugging purposes or when working with the Simulator.

Application Programming Interface:

First you need to create an instance of TuioClient. This class is listening to TUIO messages on the specified port and generates higher level messages based on the object events. The method connect(true) will start the TuioClient in a blocking mode, simply calling connect() will start the TuioClient in the background. Call disconnect() in order to stop listening to incoming TUIO messages.

Your application needs to implement the TuioListener interface, and has to be added to the TuioClient in order to receive TUIO callback messages.

A TuioListener needs to implement the following methods:

  • addTuioObject(TuioObject *tobj) this is called when an object becomes visible

  • removeTuioObject(TuioObject *tobj) an object was removed from the surface

  • updateTuioObject(TuioObject *tobj) an object was moved on the table surface

  • addTuioCursor(TuioCursor *tcur) this is called when a new cursor is detected

  • removeTuioCursor(TuioCursor *tcur) a cursor was removed from the surface

  • updateTuioCursor(TuioCursor *tcur) a cursor was moving on the table surface

  • addTuioBlob(TuioBlob *tblb) this is called when a new blob is detected

  • removeTuioBlob(TuioBlob *tblb) a blob was removed from the surface

  • updateTuioBlob(TuioBlob *tblb) a cursor was moving on the table surface

  • refresh(TuioTime bundleTime) this method is called after each bundle, use it to repaint your screen for example

Typically you will need just the following code to start with:

MyTuioListener listener; // defines a TuioListener
TuioClient client(port); // creates the TuioClient
client.addTuioListener(&listener); // registers the TuioListener
client.connect(); // starts the TuioClient

Each object or cursor is identified with aunique session ID, that is maintained over its lifetime. Additionally each object carries fiducial ID that corresponds to its attached fiducial marker number. The finger ID of the cursor object is always a number in the range of all currently detected cursor blobs.

The TuioObject, TuioCursor and TuioBlob references are updated automatically by the TuioClient and are always referencing the same instance over the object lifetime. All the TuioObject, TuioCursor and TuioBlob attributes are encapsulated and can be accessed with methods such as getX(), getY() and getAngle() and so on. TuioObject, TuioCursor and TuioBlob also have some additional convenience methods for the calculation of distances and angles between objects. The getPath() method returns a Vector of TuioPoint representing the movement path of the object.

Alternatively the TuioClient class contains some methods for the polling of the current object and cursor state. There are methods which return either a list or individual object and cursor objects. The TuioObject, TuioCursor and TuioBlob classes have been added as a container which also can be usedby external classes.

  • getTuioObjects() returns a Vector<TuioObject*> of all currently present TuioObjects

  • getTuioCursors() returns a Vector<TuioCursor*> of all currently present TuioCursors

  • getTuioBlobs() returns a Vector<TuioBlob*> of all currently present TuioCursors

  • getTuioObject(long s_id) returns a TuioObject* or NULL depending on its presence

  • getTuioCursor(long s_id) returns a TuioCursor* or NULL depending on its presence

  • getTuioBlob(long s_id) returns a TuioBlob* or NULL depending on its presence

Building the Examples:

This package includes project files for Visual Studio and XCode as well as a simple Linux Makefile for building the example applications. The Win32 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.5 is recommended. On Mac OS X you need to install the SDL2 Framework to /Library/Frameworks.

License:

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA

References:

This package uses the oscpack OpenSound Control library, and the SDL graphics library.

tuio11_cpp's People

Contributors

justinmrempel avatar mkalten 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tuio11_cpp's Issues

Debug Assertion Failed in Windows 10

I have been trying to run TuioDemo in Windows 10, but as soon as it starts, I get a "Debug Assertion Failed"

I have been able to run TuioDemo in Windows XP, Windows 7 and I believe I was able to run in Windows 8 as well, so this is most likely an issue that is related with the OS.

My question here is whether you think it is worth it trying to fix this issue or if TUIO 1.1 should be marked as deprecated and I should only try to run TUIO 2.0.

Please let me know what you think.

Thanks!

tuio-debug-assertion-failed

Consider updating the link of cpp in tuio.org to this repo

When compiling the contents of the TUIO11_CPP.zip file downloaded from TUIO.org the Makefile was trying to compile files that weren't included in the distribution, namely DevSender.cpp and DevReceiver.cpp, what ends up resulting in a make compilation error. The same problem doesn't seem to exist with this repo in GH. I'm assuming that you are affiliated somehow to the website and hence leaving the issue here.

Cheers and thanks for TUIO! 👍

macOS: sporadic crash in processOSC function

I have compiled this into a dylib on macOS to use in my app, and occasionally I get crash reports when it's processing TUIO packets. Here is the relevant stacktrace from one such crash log:

Thread 18 Crashed:
0   libTuioClient.dylib           	0x00000001093622a0 TUIO::TuioClient::processOSC(osc::ReceivedMessage const&) + 13600
1   libTuioClient.dylib           	0x0000000109369f45 TUIO::OscReceiver::ProcessBundle(osc::ReceivedBundle const&, IpEndpointName const&) + 181
2   libTuioClient.dylib           	0x000000010936a0ba TUIO::OscReceiver::ProcessPacket(char const*, int, IpEndpointName const&) + 74
3   libTuioClient.dylib           	0x0000000109370233 SocketReceiveMultiplexer::Implementation::Run() + 1539
4   libTuioClient.dylib           	0x000000010936b081 ClientThreadFunc(void*) + 17
5   libsystem_pthread.dylib       	0x00007fff6e639109 _pthread_start + 148
6   libsystem_pthread.dylib       	0x00007fff6e634b8b thread_start + 15

Any idea what's going wrong or how to fix this?

Ractiv's TouchPlus 3D Stereo Camera software using TUIO cursor

Hi Martin,

Sorry to pollute your github with our desperate search for technical solution. Here's our story around the TUIO cursor :

I'm Touchhope, a Ractiv's TouchPlus 3D Stereo Camera french buyer at http://gharbi.me/ractiv/ , our community of backers and buyers who have been rolled in flour.

Indeed, first units were sold from august 5th 2014 by Ractiv and I was in the first people to buy on their lovely website http://www.ractiv.com/ but from october 5th 2014, no more communication with customers at http://www.ractiv.com/blog/setting-up-touch/.

Only few words sometimes from one of the founders of this Kickstarter project (see : https://www.kickstarter.com/projects/haptix/haptix-multitouch-reinvented/comments ), Lai Schwe from Shanghai, on their github site at https://github.com/Ractiv and a confidential first buggy 0.55b compiled release briefly upload to pan.baidu.com , see https://www.youtube.com/watch?v=ulFTmjiwmAA

Then we had few weeks during august 2015 debugging with Lai Schwe (see : Ractiv/touch_plus_source_code#8).

Then nothing from the end of 2015 october when Lai Schwe announced us on a regular update on gitbub that Ractiv's members were starting to leave the team, including Corey Manders from IEEE and Institute Of Infocomm Research, Singapore.

Corey did communicate with me for a while but he's now too busy at this time. He made the SDK at https://github.com/Ractiv/TouchPlus .

Umar Nizamani from Nerdiacs has hacked (https://medium.com/@Rapchik/hacking-the-ractiv-touch-79a02aa003e#.bv5w7xcaz) last year some codes on Etron's eSP870 who powered the unit, see at https://github.com/umarniz/TouchPlusLib/ and I've communicate with him recently and he said "I did go through the code for a couple of hours a few weeks back and in its current state it has been left in a debug state where the dev was midway through adding some functionality and has lots of testing code splattered across the code. Secondly the code has very few comments which makes it very hard to understand functionality throughout.I think for it to be fully functional and usable it would require a lot of time to work on it."

I also get in contact with Dr. Andrea Tagliasacchi, Assistant Professor, Graphics Laboratory @ University of Victoria, BC Canada, Department of Computer Science, see at http://gfx.uvic.ca/people/ataiya/ but he's working on Intel Realsense SR300 and was asking me for unknown parameters "comparison in terms of variance of z-noise, precision of silhouette images, range of operation and frame rate" to see if he was really interested for testing and adapting with his own algorithm.

Maz (friend of autralian backer Lachlan Pollock from Adelaide at http://gharbi.me/ractiv/) and his team on OpenCV from California will also maybe have a look at the hardware as well as test software.

As I saw your work on TUIO on internet which is used in this project, I was thinking of you to maybe give us some help if our community could provide you with a unit (some members made donation proposals, some bought more than one unit).

The software in its actual state on github at https://github.com/Ractiv/touch_plus_source_code don't send anything to udp channel to win_cursor_plus process, see at Ractiv/touch_plus_source_code#37.

However, I'm currently testing several old commits in VS2015 community, and for now especially commit 9731adc "Finally figured out how SFML UDP works" on Aug 25, 2015 : https://github.com/Ractiv/touch_plus_source_code/tree/9731adcfdc1194c8856be0e3c8137149c95c8406
after downloaded clicking on "Clone or download", I've uncommented all I've found in files and set to true "IsHitTestVisible="True" ShowInTaskbar="True"" in MainWindow.xaml file in C:\touch_plus_source_code\track_plus_visual_studio\win_cursor_plus folder, I've finally got track_plus.exe and win_cursor_plus.exe processes launched as seen in taskmgr. #define SHOW_CONSOLE" is commented in file track_plus_core/daemon_plus/globals.h to avoid console mode and so daemon_plus.exe is unloaded and menu_plus.exe is reduced while running. I obtain a windowed MainWindow in taskbar below, but when right clicking on "win_cursor_plus" I only get an UAC message to relaunch process as administrator. However, I see percent of ressources used by the running process while moving my fingers, so I think udp messages are exchanged.

Unfortunately, I'm not gifted enough to solve it on my own. No man is an island as backer Robert Sweetman said, but I'm actually feeling like Robison Crusoe on his island !

Could it be an evident reason for TUIO cursor (version 1.4) not being properly functionning from csharp "win_cursor_plus" process, as seen on https://www.youtube.com/watch?v=ulFTmjiwmAA ?

Maybe some uncompatibility with windows 10 or simply wrong parameters to get launched or firewall preventing any execution ?

Well, I supposed, as everyone, you don't have too much time to spend on this "sinking" project, as Dr Tagliasacchi said, but I thought it was worth to ask you if we eventually could use a little bit of your knowledge.

Thanks in advance for your response, even if negative, I would obviously understand as I said to Dr Tagliasacchi.

Cheers,

Christian or Touchhope at http://gharbi.me/ractiv/

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.