-
Notifications
You must be signed in to change notification settings - Fork 0
/
flip.js
46 lines (39 loc) · 836 Bytes
/
flip.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
var
drone = require('ar-drone'),
client = drone.createClient(),
fs = require('fs'),
prettyjson = require('prettyjson');
fs.writeFile('data.txt', '');
client.disableEmergency();
var meter = function () {
return 1;
};
var dataCollector = function (data) {
var demo = data.demo;
fs.appendFile('data.txt', prettyjson.render(JSON.stringify(demo)));
fs.appendFile('data.txt', "\n\n");
};
client.takeoff();
client
.on('navdata', dataCollector)
.after(7000, function () {
this.front(0.3);
})
.after(2000, function () {
this.stop();
})
.after(1500, function () {
this.clockwise(0.65);
})
.after(1000, function () {
this.stop();
})
.after(500, function () {
this.front(0.3);
})
.after(2000, function () {
this.stop();
})
.after(1000, function () {
this.land();
});