├── .gitignore ├── .gitmodules ├── .npmignore ├── README.md ├── app.js ├── index.js ├── package.json └── public ├── js └── main.js ├── model ├── ARDrone.three.json ├── ardrone2.obj └── ardrone_hull.tga ├── style └── style.css └── webgl.html /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "public/js/three.js"] 2 | path = public/js/three.js 3 | url = git://github.com/mrdoob/three.js.git 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | remote-control and monitoring for your nodecopter 2 | ==== 3 | 4 | note: the code is a complete mess and will eventually be reworked and 5 | documented. 6 | 7 | usage 8 | ---- 9 | 10 | Install the module with `npm install nodecopter-monitor`, then integrate it 11 | into your project with 12 | 13 | var arDrone = require('ar-drone'), 14 | client = arDrone.createClient(); 15 | 16 | require('nodecopter-monitor').init(client); 17 | 18 | after starting your program you can access the monitoring via `http://localhost:3001/webgl.html`. 19 | From the monitoring-page you can also remote-control the drone with the following key-commands: 20 | 21 | space – takeoff 22 | escape - land 23 | W/S/A/D – move front/back/left/right 24 | cursor-keys – up/down and rotate cw/ccw 25 | 1/2/3/4/5 – animations (flipAhead/flipLeft/yawShake/doublePhiThetaMixed/wave) 26 | 27 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var arDrone = require('ar-drone'), 2 | client = arDrone.createClient(); 3 | 4 | require('./index.js').init(client); 5 | 6 | require('nodecopter-gamepad').bindEvents(client); -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | exports.init = function(drone) { 2 | var express = require('express'), 3 | http = require('http'), 4 | path = require('path'), 5 | util = require('util'); 6 | 7 | var app = express(), 8 | srv = http.createServer(app), 9 | io = require('socket.io').listen(srv); 10 | 11 | io.set('log level', 0); 12 | 13 | app.configure(function() { 14 | app.set('port', process.env.PORT || 3001); 15 | app.use(app.router); 16 | app.use(express.static(path.join(__dirname, 'public'))); 17 | }); 18 | 19 | drone.config('general:navdata_demo', 'TRUE'); 20 | 21 | 22 | // send required parts of navdata to the client 23 | drone.on('navdata', function(data) { 24 | if(!data.demo) { return; } 25 | 26 | var clientData = { 27 | droneState: { flying: data.droneState.flying } 28 | }; 29 | 30 | var navdataClientKeys = ['controlState', 'flyState', 'batteryPercentage', 'altitudeMeters']; 31 | 32 | for(var i=0, n=navdataClientKeys.length; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Battery: NA%
13 |

14 |     
15 | 16 | 17 | 18 | 19 | 20 | 21 | --------------------------------------------------------------------------------