forked from rohitghatol/ardrone-nodejs-browser-control
-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.js
46 lines (37 loc) · 1.01 KB
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Created with JetBrains WebStorm.
* User: rohitghatol
* Date: 6/28/13
* Time: 5:47 PM
* To change this template use File | Settings | File Templates.
*/
var arDrone = require('ar-drone');
//client.createRepl();
//client.animateLeds('blinkRed', 5, 10);
//client.on('navdata', console.log);
//client.takeoff();
//client
// .after(5000, function() {
//
// this.clockwise(0.5);
// client.animateLeds('blinkRed', 5, 2);
// })
// .after(3000, function() {
// //this.animate('flipLeft', 15);
// })
// .after(1000, function() {
// this.stop();
// this.land();
// });
var io = require('socket.io-client'),
socket = io.connect('localhost', {
port: 3111
});
socket.on('connect', function () { console.log("socket connected"); });
socket.emit('image', { image: 'whazzzup?' });
var client = arDrone.createClient();
client.getPngStream()
.on('error', console.log)
.on('data', function(frame) {
socket.emit('image', { image: frame });
});