Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nodecopter Pivotal

Nodecopter Pivotal

Andrew Nesbitt

July 29, 2014
Tweet

More Decks by Andrew Nesbitt

Other Decks in Technology

Transcript

  1. Nodecopter

    View Slide

  2. andrew

    View Slide

  3. View Slide

  4. Felix Geisendörfer

    View Slide

  5. AR Drone 2.0

    View Slide

  6. HD
    Camera
    Downfacing camera
    Gyroscope
    Wifi
    1GHz CPU
    Linux
    Accelerometer
    Magnetometer
    Ultrasound

    View Slide

  7. ardrone2.parrot.com/developer-zone

    View Slide

  8. View Slide

  9. 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.

    View Slide

  10. View Slide

  11. Server-side Javascript
    Asynchronous
    Runs on v8 from Chrome
    Perfect for network programs

    View Slide

  12. http://nodejs.org/download/
    !
    nodejs.org/download
    v0.10.29
    $ node
    $ NPM install ar-drone

    View Slide

  13. 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();

    });

    View Slide

  14. shama.github.com/voxel-drone

    View Slide

  15. Demo Time

    View Slide

  16. WARNING
    WARNING

    View Slide

  17. QR CodeR

    View Slide

  18. Dance Mat Drone

    View Slide

  19. Kinect Drone

    View Slide

  20. robot laser pong

    View Slide

  21. matador-copter

    View Slide

  22. $ telnet 192.168.1.1

    View Slide

  23. # 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 ([email protected])
    (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

    View Slide

  24. $ ftp -u ftp://anonymous:[email protected]/file file
    !
    $ telnet 192.168.1.1
    !
    # ls /data/video
    !
    # file
    !
    ** bug in tar unpacking **
    !
    # ls /data/video/usb

    View Slide

  25. View Slide

  26. # ls /data/video/usb
    !
    ar-drone
    !
    # cp -r /data/video/usb/ar-drone /data/video/

    View Slide

  27. https://github.com/felixge/node-cross-compiler

    View Slide

  28. # https://github.com/felixge/node-cross-compiler
    !
    $ git clone git://github.com/felixge/node-cross-compiler.git
    $ cd node-cross-compiler
    $ ./helpers/ardrone2.sh

    View Slide

  29. #!/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:[email protected]/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

    View Slide

  30. 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')
    });

    View Slide

  31. 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')
    });

    View Slide

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

    View Slide

  33. View Slide

  34. virus-copter
    github.com/substack/virus-copter

    View Slide

  35. View Slide

  36. CoderDojo

    View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. View Slide

  41. View Slide

  42. nodecopter.com

    View Slide

  43. robotsconf.com
    December 6-7 2014
    Florida

    View Slide

  44. Thank You
    @teabass

    View Slide

  45. Thank You
    @teabass

    View Slide