BathRuby on Robots

BathRuby on Robots

8ddbf811da78bb0daeeb3cacd7cf743f?s=128

Andrew Nesbitt

June 12, 2014
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. Drivers

  14. Hello World

  15. require 'artoo'
 
 connection :arduino, :adaptor => :firmata, 
 :port

    => '/dev/cu.usbmodem1411'
 device :led, driver: :led, pin: 9
 
 work do
 loop do
 led.toggle
 sleep 1
 end
 end Hello World
  16. Sparkfun Inventors Kit hobbytronics.co.uk/sparkfun-inventors-kit-v3

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

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

  19. ! require 'artoo' ! connection :arduino, :adaptor => :firmata, :port

    => '/dev/cu.usbmodem1411' ! 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 ! connection :keyboard, adaptor: :keyboard device :keyboard, driver: :keyboard, connection: :keyboard
  20. def keypress(sender, key) puts key 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 'space' left_motor.stop right_motor.stop end end ! work do puts "Ready!" on keyboard, :key => :keypress end
  21. AR Drone http://ardrone2.parrot.com

  22. 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
  23. Sphero https://github.com/hybridgroup/artoo/blob/master/examples/conway_sphero.rb

  24. Dance Dance Drone

  25. Lego Controlled Rabbit

  26. http://gobot.io Gobot

  27. http://cylonjs.com Cylon

  28. NoDebots.io

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