Using several python packages I’ve been able to bridge from TUIO to UTouch; the touch framework becoming more common amongst linux-based systems. UTouch enables apps built using it to utilise multi-touch gestures and simple cursor control in most linux systems.
While not as visually stunning as the Compiz TUIO plugin it offers a method of controlling more recent Linux distributions with TUIO outputting devices or software. The video below shows it in action. The use of an open protocol like TUIO allows for a wide range of input technologies to be used. In the video we see a direct touch input being provided in the form of one of our multi-touch tables used in the SynergyNet project, an indirect touch input provided through TUIOdroid and a hand tracking input provided through the Kinect.
This bridge from TUIO to UTouch is a simple script written in python. The script was originally written by ENAC – Interactive Computing Laboratory. The script however fell foul of a change in API of one of its dependencies which stopped it working. However, I have been able to update the script accordingly to get it to function.
Before the script can be run several dependencies must be installed. The first is libudev-dev which can be easily installed on ubuntu distributions through:
sudo apt-get install libudev-dev
This is needed for installing Python-uinput, the script’s first dependency. To install this package download archive for version 0.9 from the following page and unpack it:
Navigate to the unpacked directory and from python-uinput-0.9 run the following command to install the package:
sudo python setup.py install –prefix=/usr/local
The script’s second dependency is pytuio. To install this package download the archive for version 0.1 from the following page and unpack it:
Navigate to the unpacked directory and from pytuio-0.1 run the following command to install the package:
sudo python setup.py install
With both dependencies installed the script can be run. The updated version is licenced under gpl3 in accordance with the original version. To run the script download the archive from the following page and unpack it:
Navigate to the unpacked directory and from Tuio to UTouch run the following command to start the script:
sudo python tuiototouch.py
The ReadMe file contained in the script download explains the arguments which can be used with the script and showcases examples of its use. The script allows for receiving TUIO from local or remote sources on any port and also enables the touch events to mapped to specific displays.
While run in a console, the script should print out a response for each received touch event. The script ends when the console is closed. Of course the bridge could be made runnable through a bash script which would allow the bridge to be started automatically after certain events, such as logging on.
I haven’t found many applications which use UTouch but the cursor support makes it usable with most pieces of software on linux. I’ve yet to find a good virtual keyboard, the one shown in the video is the first result in the software centre but was very lacking in features. I’ve tried the script in Ubuntu 12.04, Ubuntu 12.10 and Xubuntu 12.10 without problem. In theory it should work on any distribution which uses UTouch and allows you to install libudev-dev.
Edit: Early downloaders of the script may have noticed an error when supplying a port mapping argument. This has now been fixed in the download.
7 thoughts on “TUIO to UTouch”
I am using a separate X screen for my touch screen. The scripts works well, but the position of the mouse is not correct. is there a way to set an offset (x,y) to the position of the input. Or a way to specifiy that the input is on the second screen?
Hi, I’ve updated the script now so you can set offsets and display widths through the script arguments. This should allow you to map the touches to a specific display. If you download the updated script (same link in the article above) you’ll find the necessary arguments in the ReadMe file. I’ve only tested it on xfce but it should work on any xserver. Hope this helps.
I know this is an old blog entry, but I would like to use an old kinect for an unbuntu 16.04 touch screen desktop. So far, I have not found any other solution seem to be complete. Do you know if your setup still works with the current API, or would I just be spinning my wheels? Thanks.
Hi, the part of bridging the TUIO to Utouch should still work (though it may need a little tweaking to overcome some small API changes) – the problem is getting the Kinect to work in Ubuntu. It is possible to get the Kinect working with the Kinect to TUIO I use in the video but its a real pain (you may have noticed in the video I actually was running the Kinect on windows and forwarding the resulting TUIO across a network to the Ubuntu machine). So I wouldn’t say its impossible, but you would have to put a fair bit of work to get it up and running. I’m not sure if it’d be worth the amount of work given how inaccurate the old kinects are, it makes using a Desktop interface quite a pain (might be interesting to try with Unity 8 though).
Hi JAMcNaughton, I know this an old project, but I wonder if you know that there is any windows version of Pytuio. the one that you mentioned above is damaged.
Hi, it looks like pytuio hasn’t been updated some in some time so its likely not supported anymore. You could try this version: https://github.com/luftj/pytuio which is a more recent fork but I couldn’t vouch for whether it’ll work with this any more.