Attack of the drones!

Attack of the drones!

Flying helicopters with Arduino and node.js

57c612ae64ddcfae16b2965087da71d9?s=128

Gilles Ruppert

May 15, 2013
Tweet

Transcript

  1. Attack of the Drones! Flying helicopters with Arduino & node.js

    Wednesday, 15 May 13
  2. Hardware Hacking Have Fun While Voiding Your Warranty Wednesday, 15

    May 13
  3. Who am I? Wednesday, 15 May 13

  4. Wednesday, 15 May 13

  5. Wednesday, 15 May 13

  6. How I got started Wednesday, 15 May 13

  7. CC-BY Jan Marsch Wednesday, 15 May 13

  8. CC-BY Jan Marsch Wednesday, 15 May 13

  9. CC-BY Jan Marsch Wednesday, 15 May 13

  10. CC-BY Jan Marsch Wednesday, 15 May 13

  11. CC-BY Jan Marsch Wednesday, 15 May 13

  12. CC-BY Jan Marsch Wednesday, 15 May 13

  13. CC-BY Jan Marsch Wednesday, 15 May 13

  14. CC-BY Jan Marsch Wednesday, 15 May 13

  15. CC-BY Jan Marsch Wednesday, 15 May 13

  16. Fog machine Emily Rose Max Ogden Daniel Shaw me... CC-BY

    Nico Kaiser Wednesday, 15 May 13
  17. Wednesday, 15 May 13

  18. Parrot AR Drone 2.0 Wednesday, 15 May 13

  19. Specs • WiFi (b/g/n) Router • 1GHz 32Bit ARM Cortex

    A8 processor • 125 MB DDR2 RAM • Linux 2.6.32 (Busybox) • 720p front facing camera (30fps) • 240p vertical camera (60 fps) • USB 2.0 connector Wednesday, 15 May 13
  20. Specs • 3 axis gyroscope (2000º/second precision) • 3 axis

    accelerometer (± 50mg precision) • 3 axis magentometer (6º precision) • Pressure sensor (±10Pa precision) • Ultrasound sensors • Fully repairable - all components can be ordered • 300 Euro Wednesday, 15 May 13
  21. • Connect to it via WiFi • telnet into it

    • open protocol (Parrot publishes SDK) • commands via UDP packets • https://github.com/felixge/node-ar-drone In a nutshell Wednesday, 15 May 13
  22. Some examples // repl.js var arDrone = require('ar-drone'); var client

    = arDrone.createClient(); client.createRepl(); client.takeoff(); // cli // drone takes off (see script) $ node repl.js drone> clockwise(0.5) // land the drone drone> land() Wednesday, 15 May 13
  23. Arduino Wednesday, 15 May 13

  24. • open-source electronics prototyping platform • easy-to use • usually

    programmed with Arduino programming language (based on Wiring) • Made in Italy Overview Wednesday, 15 May 13
  25. • none to very little knowledge of electronics necessary •

    some great beginners kits Wednesday, 15 May 13
  26. Wednesday, 15 May 13

  27. But where is the JS? Wednesday, 15 May 13

  28. Johnny Five Wednesday, 15 May 13

  29. Code Example // JOHNNY FIVE var five = require('johnny-five'); var

    board = new five.Board(); // once the board is ready board.on('ready', function () { // create a new LED object on pin 13 and strobe it (new five.Led(13)).strobe(); }); Wednesday, 15 May 13
  30. Compared to // the setup routine runs once when you

    press reset: void setup() { // initialize the digital pin as an output. pinMode(13, OUTPUT); } // the loop routine runs over and over again forever: void loop() { // turn the LED on (HIGH is the voltage level) digitalWrite(13, HIGH); // wait for a second delay(1000); // turn the LED off by making the voltage LOW digitalWrite(13, LOW); // wait for a second delay(1000); } Wednesday, 15 May 13
  31. Bringing it all together Wednesday, 15 May 13

  32. up down counter clockwise clockwise front back left right takeoff/land

    animation 1 animation 2 Wednesday, 15 May 13
  33. Demo Wednesday, 15 May 13

  34. Code Wednesday, 15 May 13

  35. • physical components are not ‘perfect’ • properties change depending

    on circumstances • the cheaper the component, the less ‘perfect’ and the more ‘tolerant’ it is • debugging Gotchas Wednesday, 15 May 13
  36. Other ideas • create an autonomous drone • create a

    whole control centre • mash up different modules found on nodecopter.com • build an autonomous greenhouse, etc • your own fantasy is the limit! Wednesday, 15 May 13
  37. Conclusion • barrier to entry lower than ever: • lots

    of information • prices are affordable • use the tools you know Wednesday, 15 May 13
  38. “Any application that can be written in JavaScript, will eventually

    be written in JavaScript.” Atwood’s law Wednesday, 15 May 13
  39. Join us • AUG Roma (http://bit.ly/aug-roma) • start of RomaJS

    meetup • organise a nodecopter event in Rome Wednesday, 15 May 13
  40. Thank you gillesruppert @gillesruppert http://github.com/gillesruppert/nodecopter-remote thanks to Jan Marsch (https://plus.google.com/107012710192519215701/posts)

    & Nico Kaiser (http://www.flickr.com/photos/73084860@N00/) for permission to use pictures Wednesday, 15 May 13