Skip to content
Micro-framework for robotics using Ruby
Pull request Compare This branch is 74 commits ahead, 615 commits behind hybridgroup:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
api
bin
examples
lib
test
.gitignore
Gemfile
Gemfile.lock
Guardfile
LICENSE
README.md
Rakefile
artoo.gemspec

README.md

artoo

http://artoo.io/

Artoo is a micro-framework for robotics using Ruby.

Artoo provides a simple, yet powerful domain-specific language (DSL) for robotics and physical computing.

Code Climate

Examples:

Basic

Arduino with an LED and a button, using the Firmata protocol.

require 'artoo'

connection :arduino, :adaptor => :firmata, :port => '/dev/tty.usbmodemxxxxx'
device :led, :driver => :led, :pin => 13
device :button, :driver => :button, :pin => 2

work do
  on button, :push => proc {led.toggle}
end

Parrot ARDrone 2.0

require 'artoo'

connection :ardrone, :adaptor => :ardrone
device :drone, :driver => :ardrone

work do
  drone.start
  drone.take_off

  after(25.seconds) { drone.hover.land }
  after(30.seconds) { drone.stop }
end

Modular

require 'artoo/robot'

SPHEROS = ["4567", "4568", "4569", "4570", "4571"]

class SpheroRobot < Artoo::Robot
  connection :sphero, :adaptor => :sphero
  device :sphero, :driver => :sphero

  work do
    every(3.seconds) do
      sphero.roll 90, rand(360)
    end
  end
end

robots = []
SPHEROS.each {|p|
  robots << SpheroRobot.new(:connections => 
                              {:sphero => 
                                {:port => p}})
}

SpheroRobot.work!(robots)

Artoo is conceptualy influenced by Sinatra (https://github.com/sinatra/sinatra) as well as borrowing some code from it.

Artoo provides a robust actor-based messaging architecture, that can support fully multi-threaded operation and high-concurrency, as long as it is supported by the Ruby version in which it is executing. To a large extent, this is due to being built on top of Celluloid (https://github.com/celluloid/celluloid) and Celluloid::IO (https://github.com/celluloid/celluloid-io).

Installing:

gem install artoo

Then install the gems required by your specific supported hardware:

gem install hybridgroup-firmata
gem install hybridgroup-argus
gem install hybridgroup-sphero

Running:

ruby myrobot.rb
Something went wrong with that request. Please try again.