Showing posts with label tuiokinect. Show all posts
Showing posts with label tuiokinect. Show all posts

Wednesday, 13 June 2012

Getting Started with TUIO, Reactivision, AS3, and PD

IMG_5332

Recently, a bunch of us were at Universidad Autónoma del Estado de México (Facultad del Artes) in Toluca, teaching a workshop and having an expocision there! Luis gave a class on Blender, Anne-marie taught about Gamemaker, Andreas taught about Pure Data, and I attempted to teach about TUIO/Kinect/Reactivision.

I say attempted, because I and Andreas did not speak much spanish (or rather we did not actually speak ANY spanish on arrival), and as I am a particularly longwinded and wordy person (with some incredibly longwinded and complicated ideas to communicate about the purpose and meaning behind interaction or programming), there were many things lost in translation due to the language barrier, despite the very kind attempts by some of the MA students such as Julio and Blanca (who tried to bridge the language and learning gaps for us by teaching the younger students a little bit more about flash and programming before we got there). But I hope everyone there still learnt something from my murmurings about tangible touch (and thanks to Janitzio for having us all there to teach as well!).

P5254497

IMG_5440

P5254505

P5244488

Some pictures from the part of the workshop that Andreas and I were teaching


The class was actually very sweet and it was lovely to go there and teach them all for a week, although there were truly some moments of utter exasperation of not being able to communicate an idea better as I simply did not have any common words to do so. In the end I also had to improvise and turn the class into a reactivation focused lesson because there were too few kinect sets in the classroom (I had only brought two from Singapore). I suppose I too have learnt a lot of things from this experience:

  1. it is truly very difficult to really teach programming to people who speak a different language to one's own (especially when simple pseudocode examples do not make any sense to them)
  2. its easier to teach a short workshop with opensource tools like pure data, rather than a program like flash that requires a licence, or with external hardware like kinect, because one really needs to have a day in advance to do a pre-setup session or installfest. i had not catered for this earlier unfortunately. also, that part about Flash files not being readable by more than the version before it (ie: Flash CS5 files are only editable in CS4 and CS5, but not CS3) really bothers me. (caveat: despite this drawback, i feel Flash is a pretty practical tool with its own commercial uses so i would still recommend learning Flash although its a little more bothersome...)
  3. it is very difficult to learn how to make a tangible touch setup AND to write the program if one does not have any basic understanding or grounding in programming. IN FACT LET'S JUST SAY ITS IMPOSSIBLE. this is not going to be the easiest "MY FIRST FLASH APP" to start with. perhaps i could eventually find a way to write a simpler tutorial, but at this point i suppose i don't have enough teaching experience to know how to make it understandable to someone with TOTALLY ZERO programming experience. it would take much longer. but i suppose maybe as i slowly accrue more teaching experience, i might also learn the mystical way of magically teaching anything to people who have zero knowledge of the thing that you are teaching about......

P5254502

Julio and Blanca in a funny moment. The MA students really helped translate and communicate some of the things I could not say in Spanish to the rest of the class. Thank you so much guys!




P5244490

at the workshop i tried to show examples in both as3 and pure data. having played a little bit with max and pd before, it was straightforward for me to figure out how i could start using pd and tuio from the examples provided although this was also my first time really using PD.

I am by no means some sort of ultimate expert on learning about TUIO (as these were things I had slowly figured out by myself on my own from reading on the internet and posting on forums) but I suppose one thing I've appreciated about this in the few years that I have been trying to figure it out is how TUIO is easy and consistent so that when you code up something, say for Flash AS3, you would then have a consistent way to refer to things and a flash app could be built for a touch table OR also used for kinect and it would still work immediately both ways for both setups (assuming you used the term TUIOCursor and TUIOObject consistently)

The difference between TUIOCursor is that a cursor is like a dot on the screen that is tracked and does not have rotational angle. There can be many many Cursors as well, whereas an TUIOObject is something that is already defined an object number and it is an object which has an "Up" or "Down" while on screen and can be rotated around and around. (There is also a TUIOBlob, but suffice to say since its been all pretty homebrew I rarely get around to calibrating my blobs)









Click here to view the full
TUIO + Kinect/Reactivision + AS3 Workshop Guide
http://dreamsyntax.org/tuioworkshop


- This guide is for Mac Users who use 10.5 and above.
- Windows users can also use the guide but some instructions may differ (such as the way one uses the Terminal/Console)
- Example start file available at http://dreamsyntax.org/tuioworkshop/tuioclientexample.zip
- Solution file available at http://dreamsyntax.org/tuioworkshop/tuioclientexample_solution.zip
- Presentation built with slidedown



BONUS! - Getting started with TUIO and PD

To get started with TUIO and PD, download PD Extended from the puredata websitew.

Download the TUIO Client Reference Implementations for PD

Download reactivision and print out some fiducial markers to wave at your camera to test it

Open the programs in this order: reactivision > pure data > the tuio pd patch of your choice, and voila it should work out of the box when you wave a symbol at your webcam!

Screen shot 2012-05-25 at PM 01

Sunday, 11 March 2012

What can you do with a Kinect in one day: The $100 Exhibition

TODAY! My goal is to spend one day making up something using kinect in time for an impromptu exhibition/show organised by Kathleen and Kent this evening. Given the timeline, it will probably just be some experiment or sketch.

EQUIPMENT: I have a kinect from my project last year, a nyko zoom lens which i picked up from Gamers Hub the last week (S$40), and i just updated my trusty old Macbook Pro's OS to 10.6. Sherwin has a projector, and we improvised some temporary setup with the furniture, a big white cloth for a projection screen, and lots of duct tape...

Installing the Nyko Zoom Lens for XBOX 360 Kinect


Since it was a small space, I thought I would try the Nyko Zoom lens to see if it would help for installations in tiny spaces. When installing it over the Kinect you will hear a loud click when the lens snaps into place. I took a before and after screenshot so you can see the different in view.

Screen shot 2012-03-10 at AM 10

Without Nyko Zoom Lens on (as seen via flkinect demo example)

Screen shot 2012-03-10 at AM 11

With Nyko Zoom Lens on (as seen via flkinect demo example)

Xbox_ZoomNew3_zoom

According to the documentation, this is what the nyko zoom can do.


I noticed that the corners are not visible with the zoom but i have always had problems with those areas (esp for blob detection) so maybe i won't really miss those spots. Another thing is that some people on the internet seem to be complaining that removing the zoom device will scratch the kinect's plastic body. That seems a bit unfair since the product actually does come with a BIG BRIGHT YELLOW INSTRUCTION SHEET warning you to apply the protective sticker so you can prevent this from happening. I had no issue with clipping and unclipping the zoom lens to be honest so the possibility of scratching the kinect is a non-issue to me.

My verdict is that the zoom lens can provide the comfort of knowing you could reduce the range if you really had to, but i find that the data returned is actually more "noisy" so I wouldn't use it for an installation that is returning "blob" data.


as3kinect server


Installation is a breeze. Why did I panic or struggle the last time around? I suppose its all about pretending that you know what is going on and then slowly figuring it out along the way.

Download the OpenKinect wrapper v0.9c for Mac OSX. Install it and then open up terminal and run as3-server as follows:

Screen shot 2012-03-10 at AM 11

When you see "### Wait client" its ready.

Screen shot 2012-03-10 at AM 11

Screenshot of the demo package on the as3kinect site.

Screen shot 2012-03-10 at PM 01

my housemate tries the blob detection - success!


as3-server Isochronous Transfer Errors


Screen shot 2012-03-10 at PM 01


And then, of course it had to happen. I spoke too soon. On my Macbook Pro (OSX 10.6), it keeps dropping the packets - something that i never experienced with openkinect on Windows 7 (via Parallels). Not sure what to do about this. Playing with depth settings cause it to completely stop communicating... At this point I didn't feel confident that this would stand up to the rigours of being used in an installation so I scrapped this.

tuiokinect


Tried downloading tuiokinect. TUIO is a popular protocol used for blob detection, fidicual detection, and gestures and it works brilliantly with many things such as Flash, Processing, Java, etc. I wonder why I hadn't looked at this earlier!

Screen shot 2012-03-10 at PM 02


You can use udp-flashlc-bridge to send TUIO messages to Flash.

Screen shot 2012-03-10 at PM 02


DISCOVERED THAT IT WORKS OUT OF THE BOX WITH OTHER TUIO CLIENT APPLICATIONS! Now, this is a winner. Opened up my \\ application which was from my solo show in 2010 which also used TUIO, and the blob detection works immediately. The people working on TUIO are doing something right here, it is seriously awesome.

Screen shot 2012-03-10 at PM 02


Here, the gestures demo shows what it can do. After tweaking depth, I can use it to move squares around, rotate them, and make them larger or smaller.

I was going to build a tesla coil simulation and had scraped together something on the flash side, but it was impossible for me to mash it together with tuiokinect within the amount of time so I ended up just projecting this gestures demo which seemed to entertain people quite a bit, if not at least induce them to exercise for a few minutes by trying to push a square from one end of the screen to the other.

CALIBRATION: I ended up using flkinect inbetween to adjust tilt and other motor functions. If the kinect is accidentally disconnected, this will cause TUIOkinect and flash to crash! This happened when people tripped over the cabling which had to be run across the room. I also found myself constantly recalibrating it in TUIOkinect when people approached it from a different angle!

LOGISTICS: The next issue I think is if you want to build kinect things then projector cables need to be a lot longer because the computer and kinect have to sit in the front of the room and the projector needs to be high enough so that people's heads do not get in the way. We were forced to use a slightly awkward or should i say "cosy" arrangement of equipment because of cable length, and in my previous installation at MBS ArtScience Museum, a few dozen metres of VGA cables were used to connect the projector in the front of the room, with a cable that ran all the way up the wall to the ceiling of the exhibition hall across the entire space to the back and to a large metal projector rig hanging a good few metres from the ceiling.

PROOF-OF-CONCEPT: I guess the point of this is that a few years ago I wouldn't have imagined that it would be possible for me to even control or put together something like this on my own but this basic demo can be easily put together by someone with no formal technical background within one afternoon. If I can put this together in one day, then clearly, if given sufficient time and motivation, anyone could build something like right out of the interface in minority report, or something like microsoft surface - entirely from scratch, powered by a few smart opensource sockets and libraries. The next question would then be: but why would you want to do that....?"



Thanks to Kathleen and Kent for putting together the show, the other artists for bringing their works, and Sherwin for so graciously having us invade his place until the wee hours of the morning (including that remarkably focused artist talk that inexplicably went on until 3am). Photos I took at The $100 Exhibition can be seen here.