Nodecopter - BristolJS

Nodecopter - BristolJS

8ddbf811da78bb0daeeb3cacd7cf743f?s=128

Andrew Nesbitt

May 21, 2014
Tweet

Transcript

  1. andrew

  2. None
  3. Nodecopter

  4. None
  5. Felix Geisendörfer

  6. AR Drone 2.0

  7. HD Camera Downfacing camera Gyroscope Wifi 1GHz CPU Linux Accelerometer

    Magnetometer Ultrasound
  8. ardrone2.parrot.com/developer-zone

  9. None
  10. Node.js is a platform built on Chrome's JavaScript runtime for

    easily building fast, scalable network applications. Node.js uses an event-driven, non- blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
  11. None
  12. Server-side Javascript Asynchronous Runs on v8 from Chrome Perfect for

    network programs
  13. http://nodejs.org/download/ ! nodejs.org/download v0.10.26 $ node $ NPM install ar-drone

  14. var arDrone = require('ar-drone');
 var client = arDrone.createClient();
 
 client.takeoff();


    
 client
 .after(3000, function() {
 this.up(1);
 })
 .after(2000, function() {
 this.stop()
 this.clockwise(1);
 })
 .after(3000, function() {
 this.stop();
 this.land();
 });
  15. shama.github.com/voxel-drone

  16. Demo Time

  17. Demo Time xbox Controller

  18. Demo Time xbox Controller

  19. WARNING WARNING

  20. None
  21. QR CodeR

  22. Dance Mat Drone

  23. Kinect Drone

  24. robot laser pong

  25. matador-copter

  26. $ telnet 192.168.1.1

  27. # busybox | head BusyBox v1.14.0 () multi-call binary Copyright

    (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko and others. Licensed under GPLv2. See source distribution for full notice. ! ! # cat /proc/version Linux version 2.6.32.9-g1dd1a2a (stephane@stephane-pc) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #1 PREEMPT Thu May 30 19:21:53 CEST 2013 ! ! # uname -a Linux uclibc 2.6.32.9-g1dd1a2a #1 PREEMPT Thu May 30 19:21:53 CEST 2013 armv7l GNU/Linux ! # df -h Filesystem Size Used Available Use% Mounted on ubi1:system 26.3M 21.7M 3.3M 87% / tmp 57.7M 644.0K 57.1M 1% /tmp dev 57.7M 0 57.7M 0% /dev ubi0:factory 4.8M 76.0K 4.5M 2% /factory ubi2:update 13.2M 28.0K 12.5M 0% /update ubi2:data 53.5M 14.0M 36.8M 28% /data
  28. $ ftp -u ftp://anonymous:anonymous@192.168.1.1/file file ! $ telnet 192.168.1.1 !

    # ls /data/video ! # file ! ** bug in tar unpacking ** ! # ls /data/video/usb
  29. None
  30. # ls /data/video/usb ! ar-drone ! # cp -r /data/video/usb/ar-drone

    /data/video/
  31. https://github.com/felixge/node-cross-compiler

  32. # https://github.com/felixge/node-cross-compiler ! $ git clone git://github.com/felixge/node-cross-compiler.git $ cd node-cross-compiler

    $ ./helpers/ardrone2.sh
  33. #!/bin/bash set -eu ! if [ ! -e build/bin/node ];

    then echo "-> Spinning up VM" vagrant up echo "-> Building node binary" vagrant ssh -c "cd cross-compiler && ./setup-vm.sh && make ardrone2" echo "-> Halting VM" vagrant halt echo "-> To completely remove the VM, please execute 'vagrant destroy'" else echo "-> Skipping build (node binary exists)" fi ! echo "Would you like to install node on the drone? (Connect now) [Y/n]" read a if [[ $a == "Y" || $a == "y" || $a = "" ]]; then echo "-> Uploading binary" ftp -u ftp://anonymous:anonymous@192.168.1.1/node build/bin/node echo "-> Installing" { echo "cd /data/video && mv ./node /bin && chmod u+x /bin/node && rm -rf node && exit"; sleep 1; } | telnet 192.168.1.1 echo "-> Installation completed!" else echo "-> Build completed!" fi
  34. var arDrone = require('..'); var http = require('http'); ! var

    client = arDrone.createClient(); client.disableEmergency(); ! navData = {} ! client.on('navdata', function(data){ navData = data; }); ! var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify(navData)); }); ! server.listen(8080, function() { console.log('started server on http://192.168.1.1:8080') });
  35. var arDrone = require('..'); var http = require('http'); ! var

    client = arDrone.createClient(); client.disableEmergency(); ! navData = {} ! client.on('navdata', function(data){ navData = data; }); ! var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify(navData)); }); ! server.listen(8080, function() { console.log('Serving latest png on port 8080 ...'); client.takeoff(); ! client .after(5000, function() { this.clockwise(0.5); }) .after(5000, function() { this.stop(); }) .after(1000, function() { this.stop(); this.land(); }); console.log('started server on http://192.168.1.1:8080') });
  36. Demo Time

  37. WARNING WARNING

  38. https://gist.github.com/maxogden/4152815

  39. None
  40. virus-copter github.com/substack/virus-copter

  41. None
  42. CoderDojo

  43. None
  44. None
  45. None
  46. None
  47. nodecopter.com

  48. Thank You @teabass

  49. Thank You @teabass