Giter VIP home page Giter VIP logo

tuio-ruby's Introduction

A TUIO client for Ruby

www.tuio.org/

INSTALL:

[sudo] gem install tuio-ruby

EXAMPLE:

require 'rubygems'
require 'tuio-ruby'

@tc = TuioClient.new

@tc.on_object_creation do | to |
  puts "New TUIO Object at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_object_update do | to |
  puts "Updated TUIO Object #{to.fiducial_id} at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_object_removal do | to |
  puts "Removed TUIO Object #{to.fiducial_id}"
end

@tc.on_cursor_creation do | to |
  puts "New TUIO Cursor at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_cursor_update do | to |
  puts "Updated TUIO Cursor #{to.session_id} at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_cursor_removal do | to |
  puts "Removed TUIO Cursor #{to.session_id}"
end

@tc.start
sleep

Copyright © 2009 Colin Harris. See LICENSE for details.

tuio-ruby's People

Contributors

aberant avatar

Stargazers

Angus H. avatar Matthias Richard avatar Brendon Rapp avatar Ryan Wold avatar Amos avatar Darcy Brás da Silva avatar Stéphane Adam Garnier avatar GPad avatar Ruben Jenster avatar Daniel Hoelzgen avatar Martin Kaltenbrunner avatar Anirudh Sharma avatar Alexander Sorokin avatar Macario Ortega avatar Pete Brumm avatar  avatar Onofre Souza avatar Herval Freire avatar Jason Morrison avatar

Watchers

 avatar James Cloos avatar  avatar

tuio-ruby's Issues

message size problem

I've found the problem with message arguments parsing.
Maybe it is because of TUIO protocol changes, dunno

It definetely happens when I check 'send width & height' in CCV.
As I understand in this case CCV sends more data in messages.

I hacked the code to see arguments, there are actually 2 more arguments.

Maybe limiting arguments array size is the solution (tuio_client.rb:42)

here is a dump:

./tuio-ruby/lib/tuio-ruby/tuio_client.rb:91:in initialize': wrong number of arguments (8 for 6) (ArgumentError) from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:91:innew'
from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:91:in track_tuio_cursor' from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:42:ininitialize'
from XXXXXXX/ruby/lib/ruby/gems/1.8/gems/osc-ruby-0.2.0/lib/osc-ruby/server.rb:50:in call' from XXXXXXX/ruby/lib/ruby/gems/1.8/gems/osc-ruby-0.2.0/lib/osc-ruby/server.rb:50:insendmesg'
from XXXXXXX/ruby/lib/ruby/gems/1.8/gems/osc-ruby-0.2.0/lib/osc-ruby/server.rb:48:in each' from XXXXXXX/ruby/lib/ruby/gems/1.8/gems/osc-ruby-0.2.0/lib/osc-ruby/server.rb:48:insendmesg'
from XXXXXXX/ruby/lib/ruby/gems/1.8/gems/osc-ruby-0.2.0/lib/osc-ruby/server.rb:80:in dispatch_message' ... 8 levels... from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:52:ininitialize'
from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:52:in new' from ./tuio-ruby/lib/tuio-ruby/tuio_client.rb:52:instart'
from ctrl_server.rb:34

Some include problem

I'm running ubuntu 9.04 with ruby 1.8.7
Got installed tuio-ruby 0.2.2 gem by 'gem install tuio-ruby' and osc-ruby 0.2.0

simple example with slightly modified copy-paste of your example.rb doesn't work.
btw, original example.rb doesn't work as well

Looks like requires in 'lib/tuio_client.rb' should be changed to something like these:

core exts

require File.join( File.dirname( FILE ), 'core_ext', 'object' )
require File.join( File.dirname( FILE ), 'core_ext', 'float' )

my code:

require 'rubygems'
require 'tuio-ruby'
@tc = TuioClient.new

@tc.on_object_creation do | to |
puts "New TUIO Object at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_object_update do | to |
puts "Updated TUIO Object #{to.fiducial_id} at x: #{to.x_pos}, y: #{to.y_pos}"
end

@tc.on_object_removal do | to |
puts "Removed TUIO Object #{to.fiducial_id}"

end

The error:
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- core_ext/object (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /home/test/.gem/ruby/1.8/gems/tuio-ruby-0.2.2/lib/tuio-ruby/tuio_client.rb:5
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /home/test/.gem/ruby/1.8/gems/tuio-ruby-0.2.2/lib/tuio-ruby.rb:10
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:inrequire'
from ruby_test.rb:2

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.