-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.js
37 lines (27 loc) · 691 Bytes
/
run.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
var arDrone = require('ar-drone');
var control = arDrone.createUdpControl({ip:'192.168.88.234'});
var start = Date.now();
var ref = {};
var pcmd = {};
console.log('Recovering from emergency mode if there was one ...');
ref.emergency = true;
setTimeout(function() {
console.log('Takeoff ...');
ref.emergency = false;
ref.fly = true;
}, 1000);
setTimeout(function() {
console.log('Turning clockwise ...');
pcmd.clockwise = 0.5;
}, 6000);
setTimeout(function() {
console.log('Landing ...');
ref.fly = false;
pcmd = {};
}, 8000);
//client.on('navdata', console.log)
setInterval(function() {
control.ref(ref);
control.pcmd(pcmd);
control.flush();
}, 30);