Ruby On Robots

Ruby On Robots

In the past few years robots have started to invade our lives, as toys or tools for around the home or at work. These robots are often much more user friendly and more importantly, hackable, than traditional industrial robots, which has lowered the barrier to writing software to control robots.

We’ll look at one particular ruby library, Artoo, a micro-framework for robotics that lets you connect to multiple different hardware devices and robots at the same time with some live demos as well.

Presented at: http://lrug.org/meetings/2013/10/30/november-2013-meeting/

8ddbf811da78bb0daeeb3cacd7cf743f?s=128

Andrew Nesbitt

November 11, 2013
Tweet

Transcript

  1. Controlling Robots with Ruby

  2. Andrew Nesbitt @teabass github.com/andrew

  3. Controlling Robots with Ruby

  4. Why Ruby?

  5. High LEvel

  6. Lower Barriers

  7. Fun!

  8. http://artoo.io

  9. http://celluloid.io

  10. None
  11. Arduino

  12. Firmata

  13. Hello World

  14. require 'artoo' connection :arduino, :adaptor => :firmata, :port => '/dev/cu.usbmodemfd121'

    device :led, driver: :led, pin: 9 work do loop do led.toggle sleep 1 end end Hello World
  15. Sparkfun Inventors Kit hobbytronics.co.uk/sparkfun-inventors-kit-v3

  16. Sparkfun Inventors Kit hobbytronics.co.uk/sparkfun-inventors-kit-v3

  17. Sumobot http://www.pololu.com/catalog/product/2506

  18. require 'artoo' require 'curses' Curses.noecho # do not show typed

    keys Curses.init_screen Curses.stdscr.keypad(true) # enable arrow keys (required for pageup/down) keys = { 260 => :left, 261 => :right, 259 => :up, 258 => :down, 'x' => :exit, ' ' => :stop } connection :arduino, :adaptor => :firmata, :port => '/dev/cu.usbmodemfd121' device :board, :driver => :device_info device :left_motor, :driver => :motor, :forward_pin => 6, # hack! :backward_pin => 8, :speed_pin => 10 device :right_motor, :driver => :motor, :forward_pin => 6, # hack! :backward_pin => 7, :speed_pin => 9 MAX_SPEED = 60
  19. work do loop do key = keys[Curses.getch] case key when

    :left left_motor.backward MAX_SPEED right_motor.forward MAX_SPEED when :right left_motor.forward MAX_SPEED right_motor.backward MAX_SPEED when :up left_motor.forward MAX_SPEED right_motor.forward MAX_SPEED when :down left_motor.backward MAX_SPEED right_motor.backward MAX_SPEED when :stop left_motor.stop right_motor.stop when :exit Curses.close_screen exit! end end end
  20. AR Drone http://ardrone2.parrot.com

  21. require 'artoo' connection :ardrone, :adaptor => :ardrone, :port => '192.168.1.1:5556'

    device :drone, :driver => :ardrone, :connection => :ardrone work do drone.start drone.take_off after(10.seconds) { drone.hover.land } after(15.seconds) { drone.stop } end AR DRONE
  22. Sphero https://github.com/hybridgroup/artoo/blob/master/examples/conway_sphero.rb

  23. Dance Dance Drone

  24. Lego Controlled Rabbit

  25. NoDebots.io

  26. http://www.meetup.com/bathruby Programming Languages I've Been Meaning To Try But Haven't

    Got Around To Yet Saturday 30th November
  27. http://www.meetup.com/bathruby PLIBMTTBHGATY Saturday 30th November

  28. http://www.meetup.com/bathruby

  29. Thanks! code: github.com/andrew/artoo-experiments slides: speakerdeck.com/andrew/ruby-on-robots