{"id":13685679,"url":"https://github.com/hybridgroup/artoo","last_synced_at":"2025-05-14T12:11:06.185Z","repository":{"id":4288353,"uuid":"5418256","full_name":"hybridgroup/artoo","owner":"hybridgroup","description":"Ruby framework for robotics, drones, and the Internet of Things (IoT)","archived":false,"fork":false,"pushed_at":"2023-12-19T14:46:41.000Z","size":1125,"stargazers_count":1546,"open_issues_count":20,"forks_count":142,"subscribers_count":85,"default_branch":"master","last_synced_at":"2025-05-12T11:09:50.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://artoo.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hybridgroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-08-14T20:31:07.000Z","updated_at":"2025-05-11T08:12:33.000Z","dependencies_parsed_at":"2022-09-02T14:01:28.937Z","dependency_job_id":"a2a15901-c837-4f8b-81ab-43f16e84e8e1","html_url":"https://github.com/hybridgroup/artoo","commit_stats":{"total_commits":617,"total_committers":29,"mean_commits":"21.275862068965516","dds":0.6272285251215559,"last_synced_commit":"e5e67f6659fa3c5530d28a2a324810c7673e8735"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridgroup%2Fartoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridgroup%2Fartoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridgroup%2Fartoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hybridgroup%2Fartoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hybridgroup","download_url":"https://codeload.github.com/hybridgroup/artoo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140760,"owners_count":22021219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T14:00:55.838Z","updated_at":"2025-05-14T12:11:06.143Z","avatar_url":"https://github.com/hybridgroup.png","language":"Ruby","funding_links":[],"categories":["Ruby","Robotics and Physical computing","Robotics","Uncategorized"],"sub_categories":["TR-069","Android Things","Uncategorized"],"readme":"[![Artoo](https://cdn.rawgit.com/hybridgroup/artoo-site/master/source/images/elements/artoo.png)](http://artoo.io)\n\nhttp://artoo.io/\n\nArtoo is a micro-framework for robotics using Ruby.\n\nArtoo provides a simple, yet powerful Domain-Specific Language (DSL) for robotics and physical computing.\n\nWant to use JavaScript on robots? Check out our sister project Cylon.js (http://cylonjs.com)\n\nWant to use the Go programming language to power your robots? Check out our sister project Gobot (http://gobot.io).\n\n[![Code Climate](https://codeclimate.com/github/hybridgroup/artoo.png)](https://codeclimate.com/github/hybridgroup/artoo) [![Build Status](https://travis-ci.org/hybridgroup/artoo.png?branch=master)](https://travis-ci.org/hybridgroup/artoo)\n\n## Examples:\n\n### Basic\n\n#### Arduino with an LED and a button, using the Firmata protocol.\n\n```ruby\nrequire 'artoo'\n\nconnection :arduino, :adaptor =\u003e :firmata, :port =\u003e '/dev/ttyACM0'\ndevice :led, :driver =\u003e :led, :pin =\u003e 13\ndevice :button, :driver =\u003e :button, :pin =\u003e 2\n\nwork do\n  on button, :push =\u003e proc {led.toggle}\nend\n```\n\n#### Parrot ARDrone 2.0\n\n```ruby\nrequire 'artoo'\n\nconnection :ardrone, :adaptor =\u003e :ardrone\ndevice :drone, :driver =\u003e :ardrone\n\nwork do\n  drone.start\n  drone.take_off\n\n  after(25.seconds) { drone.hover.land }\n  after(30.seconds) { drone.stop }\nend\n```\n\n### Modular\n\nYou can also write more modular class-oriented code, that allows you to control swarms of robots:\n\n```ruby\nrequire 'artoo/robot'\n\nSPHEROS = [\"4567\", \"4568\", \"4569\", \"4570\", \"4571\"]\n\nclass SpheroRobot \u003c Artoo::Robot\n  connection :sphero, :adaptor =\u003e :sphero\n  device :sphero, :driver =\u003e :sphero\n\n  work do\n    every(3.seconds) do\n      sphero.roll 90, rand(360)\n    end\n  end\nend\n\nrobots = []\nSPHEROS.each {|p|\n  robots \u003c\u003c SpheroRobot.new(:connections =\u003e\n                              {:sphero =\u003e\n                                {:port =\u003e p}})\n}\n\nSpheroRobot.work!(robots)\n```\n\nRuby versions supported: Ruby 2.1, Ruby 2.0, Ruby 1.9.3, JRuby 1.7.4+, and Rubinius 2.1+\n\nRubinius requires 1.9 mode, to install Rubinius in 1.9 mode using rvm\n\n```\nrvm get head \u0026\u0026 rvm install rbx-2.1.1 --1.9\n```\n\nArtoo is conceptualy influenced by [Sinatra](https://github.com/sinatra/sinatra) as well as borrowing some code from it.\n\nArtoo 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. This means you will need to use JRuby or Rubinius for maximum concurrency.\n\nTo a large extent, this is due to being built on top of [Celluloid](https://github.com/celluloid/celluloid), [Celluloid::IO](https://github.com/celluloid/celluloid-io), and [Reel](https://github.com/celluloid/reel).\n\n## Hardware support:\n\nArtoo has a extensible system for connecting to hardware devices. The following robotics and physical computing platforms are currently supported:\n\n  - [Arduino](http://www.arduino.cc/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-arduino)\n  - [ARDrone](http://ardrone2.parrot.com/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-ardrone)\n  - [BeagleBone](http://beagleboard.org/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-beaglebone)\n  - [Crazyflie](http://www.bitcraze.se/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-crazyflie)\n  - [Digispark](http://digistump.com/products/1) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-digispark)\n  - [Joystick](http://www.libsdl.org/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-joystick)\n  - [Keyboard](http://en.wikipedia.org/wiki/Computer_keyboard) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-keyboard)\n  - [Leap Motion](https://www.leapmotion.com/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-leapmotion)\n  - [OpenCV](http://opencv.org/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-opencv)\n  - [Pebble](http://getpebble.com/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-pebble)\n  - [Raspberry Pi](http://www.raspberrypi.org/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-raspi)\n  - [Roomba](http://www.irobot.com/About-iRobot/STEM.aspx) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-roomba)\n  - [Spark Core](http://www.spark.io/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-spark)\n  - [Sphero](http://www.gosphero.com/) \u003c=\u003e [Adaptor](https://github.com/hybridgroup/artoo-sphero)\n\nMore platforms are coming soon!\n\nArtoo also has support for devices that can work across multiple hardware platforms.\n  - GPIO (General Purpose Input/Output) devices \u003c=\u003e [Drivers](https://github.com/hybridgroup/artoo-gpio)\n  - i2c devices \u003c=\u003e [Drivers](https://github.com/hybridgroup/artoo-i2c)\n\nDo you have some hardware that is not yet supported by Artoo? We want to help you, help us, help them! Get in touch...\n\n## Getting Started:\n\n### Installation\n\n```ruby\ngem install artoo\n```\n\nThen install the gems required by the hardware you want to use. For example, if you wanted to integrate a PS3 controller to fly your ARDrone:\n\n```ruby\ngem install artoo-joystick\ngem install artoo-ardrone\n```\n\nIf you will be using socket to serial commuication (required if you will use JRuby or Rubinius), you are ready to start programming your hardware.\n\nIf you want to connect via serial port directly, and are using MRI, install the hybridgroup-serialport gem:\n\n```ruby\ngem install hybridgroup-serialport\n```\n\n### Writing your robot code:\n\nNow you are ready to write your own code. Take a look at the examples directory for a whole bunch of code you can use to help get started. We recommend using TDR (Test-Driven Robotics) with your preferred test frameworks.\n\n### Running your robot:\n\n```ruby\nruby myrobot.rb\n```\n\n## API:\n\nArtoo includes a RESTful API to query the status of any robot running within a group, including the connection and device status, and device streaming data via websockets.\n\nTo activate the API, use the `api` command like this:\n\n```ruby\nrequire 'artoo'\n\nconnection :loop\ndevice :passthru\napi :host =\u003e '127.0.0.1', :port =\u003e '4321'\n\nwork do\n  puts \"Hello from the API running at #{api_host}:#{api_port}...\"\nend\n```\n\nOnce the robot or group is working, you can view the main API page at the host and port specified.\n\n## Test-Driven Robotics:\n\nArtoo makes it easy to do Test Driven Development (TDD) of your robotic devices using your favorite Ruby test and mocking frameworks.\n\nHere is an example that uses Minitest, Mocha, and Timecop:\n\n```ruby\nrequire './test_helper'\nrequire './test_robot'\n\ndescribe 'sphero' do\n  let(:robot) { Artoo::MainRobot.new }\n  let (:start) { Time.now }\n\n  before :each do\n    Timecop.travel(start)\n    robot.work\n  end\n\n  after :each do\n    Timecop.return\n  end\n\n  it 'has work to do every 3 seconds' do\n    robot.has_work?(:every, 3.seconds).wont_be_nil\n  end\n\n  it 'receives collision event' do\n    robot.expects(:contact)\n    robot.sphero.publish(\"collision\", \"clunk\")\n    sleep 0.05\n  end\n\n  it 'must roll every 3 seconds' do\n    Timecop.travel(start + 3.seconds) do\n      robot.sphero.expects(:roll)\n      sleep 0.05\n    end\n    Timecop.travel(start + 6.seconds) do\n      robot.sphero.expects(:roll)\n      sleep 0.05\n    end\n  end\nend\n```\nto describe the following Sphero robot:\n\n```ruby\nrequire 'artoo'\n\nconnection :sphero, :adaptor =\u003e :sphero, :port =\u003e '127.0.0.1:4560'\ndevice :sphero, :driver =\u003e :sphero\n\ndef contact(*args)\n  @contacts ||= 0\n  @contacts += 1\n  puts \"Contact #{@contacts}\"\nend\n\nwork do\n  on sphero, :collision =\u003e :contact\n\n  every(3.seconds) do\n    sphero.roll 90, rand(360)\n  end\nend\n```\n\nThe repo with full example of using Artoo for test driven robotics is located at [https://github.com/hybridgroup/artoo-test-example](https://github.com/hybridgroup/artoo-test-example)\n\n## CLI\n\nArtoo uses the Gort [http://gort.io](http://gort.io) Command Line Interface (CLI) so you can access important features right from the command line. We call it \"RobotOps\", aka \"DevOps For Robotics\". You can scan, connect, update device firmware, and more!\n\nArtoo also has its own CLI so you can generate new robots, or use its console.\n\n```\n$ artoo\nCommands:\n  artoo console ROBOT                # Run a robot using the Robi console\n  artoo generate SUBCOMMAND ...ARGS  # Generates a new robot or adaptor\n  artoo help [COMMAND]               # Describe available commands or one specific command\n  artoo install SUBCOMMAND ...ARGS   # Installs utility programs\n  artoo start ROBOT                  # Run a robot\n  artoo version                      # Displays the current version\n```\n\n### Console:\n\nArtoo includes a console based on [Pry](http://pryrepl.org/) to allow you to interactively debug and control your robot.\n\n```\n$ artoo console ./examples/hello.rb\n         run  robi ./examples/hello.rb from \".\"\nI, [2013-07-03T17:11:35.793913 #5527]  INFO -- : Registering connection 'loop'...\nI, [2013-07-03T17:11:35.794939 #5527]  INFO -- : Preparing work...\nrobi\u003e start\nStarting main robot...\nI, [2013-07-03T17:11:48.950888 #5527]  INFO -- : Initializing connection loop...\nI, [2013-07-03T17:11:48.955804 #5527]  INFO -- : Starting work...\nI, [2013-07-03T17:11:48.956152 #5527]  INFO -- : Connecting to 'loop' on port '#\u003cArtoo::Port:0xfea0\u003e'...\nrobi\u003e list\n#\u003cArtoo::MainRobot:0x100c0\u003e\nrobi\u003e hello\nhello\nhello\nrobi\u003e stop\nStopping robots...\nrobi\u003e exit\nD, [2013-07-03T17:12:04.413060 #5527] DEBUG -- : Terminating 7 actors...\nD, [2013-07-03T17:12:04.414300 #5527] DEBUG -- : Shutdown completed cleanly\n```\n\n### Generator\n\nWant to integrate a hardware device we don't have Artoo support for yet? There's a generator for that! You can easily generate a new skeleton Artoo adaptor to help you get started. Simply run the 'artoo generate adaptor' command, and the generator will create a new directory with all of the files in place for your new adaptor gem.\n\n```\n$ artoo generate adaptor awesome_device\nCreating artoo-awesome_device adaptor...\n      create  artoo-awesome_device\n       exist  artoo-awesome_device\n      create  artoo-awesome_device/Gemfile\n      create  artoo-awesome_device/LICENSE\n      create  artoo-awesome_device/README.md\n      create  artoo-awesome_device/Rakefile\n      create  artoo-awesome_device/artoo-awesome_device.gemspec\n      create  artoo-awesome_device/lib/artoo-awesome_device.rb\n      create  artoo-awesome_device/lib/artoo-awesome_device/version.rb\n      create  artoo-awesome_device/lib/artoo/adaptors/awesome_device.rb\n      create  artoo-awesome_device/lib/artoo/drivers/awesome_device.rb\n      create  artoo-awesome_device/test/adaptors/awesome_device_adaptor_test.rb\n      create  artoo-awesome_device/test/drivers/awesome_device_driver_test.rb\n      create  artoo-awesome_device/test/test_helper.rb\nDone!\n```\n\n## Documentation\n\nCheck out our [documentation](http://artoo.io/documentation/) for lots of information about how to use Artoo.\n\nIf you want to help us with some documentation on the site, you can go to [artoo.io branch](https://github.com/hybridgroup/artoo/tree/artoo.io) and then, follow the instructions.\n\n## IRC\n\nNeed more help? Just want to say \"Hello\"? Come visit us on IRC freenode #artoo\n\n## Contributing\n* All patches must be provided under the Apache 2.0 License\n* Please use the -s option in git to \"sign off\" that the commit is your work and you are providing it under the Apache 2.0 License\n* Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC.\n* We will look at the patch, test it out, and give you feedback.\n* Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done seperately.\n* Take care to maintain the existing coding style.\n* Add unit tests for any new or changed functionality.\n* All pull requests should be \"fast forward\"\n  * If there are commits after yours use “git rebase -i \u003cnew_head_branch\u003e”\n  * If you have local changes you may need to use “git stash”\n  * For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git\n\n\n(c) 2012-2016 The Hybrid Group\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridgroup%2Fartoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhybridgroup%2Fartoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhybridgroup%2Fartoo/lists"}