Notice: MediaWiki has been updated. Report any rough edges to marcan@marcan.st
Ruby Wrapper
From OpenKinect
This effort will provide a wrapper to access the Kinect through Ruby.
About
Who is involved
Coordinator/Development: Aditya Gaddam (User:LostInCake)
Current Status
Feature | Supported? | Notes |
---|---|---|
Connect to Kinect (heh) | No (Possible values are Yes/No/Partial) | Not started main development |
Control LED | yes | |
Control motor | yes | |
Get accelerometer data | No | |
RGB data callback | No | |
Depth data callback | No |
Demos / Videos
Some demo links / videos / images will go here
Installation/Configuration
- Step one
- Step two
- Step three
Sample Code
require 'rubygems'
require 'usb'
LED_STATES = {:off=>0, :green=>1, :red=>2, :yellow=>3, :blink_yellow=>4, :blink_green=>5, :blink_red_yellow=>6, :blink_red_green=>7}
def set_led(state)
begin
@@led_device ||= USB.devices.select{|d| d.idVendor==0x045e && d.idProduct==0x02b0}.first
@@led_handle ||= @@led_device.usb_open
@@led_handle.usb_control_msg 0x40, 0x06, state, 0x0000, '', 0
rescue Exception => e
puts e.message
end
end
def set_motor(pitch)
begin
@@motor_device ||= USB.devices.select{|d| d.idVendor==0x045e && d.idProduct==0x02b0}.first
@@motor_handle ||= @@motor_device.usb_open
pitch = -35 if pitch < -35
pitch = 55 if pitch > 55
@@motor_handle.usb_control_msg 0x40,0x31,pitch,0x0000,'',0
rescue Exception => e
puts e.message
end
end
...anyone still active here? if so please leave a message, i will check back ;)