-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSecond_Scene.js
45 lines (45 loc) · 1.04 KB
/
Second_Scene.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
% % main script
var df = require ( ’ dateformat ’)
var autonomy = require ( ’ ardrone - autonomy ’) ;
var mission
= autonomy . createMission () ;
mission . log (" mission -" + df ( new Date () , " yyyy - mm - dd_hh - MM - ss ") + ". txt ") ;
mission . takeoff ()
. zero () // Sets the current state as the reference
. altitude (2) // Climb to altitude = 1 meter
. wait (200)
. forward (0.5)
. right (1)
. forward (0.5)
. left (1)
. forward (0.5)
. right (1)
. forward (0.5)
. left (1)
. forward (0.5)
. right (1)
. forward (0.5)
. left (1)
. forward (0.5)
. right (1)
. forward (0.5)
. left (1)
. forward (0.5)
. right (1)
. forward (0.5)
. left (1)
. forward (0.5)
. hover (100)
// Hover in place for 1 second
. wait (150)
. land () ;
mission . run ( function ( err , result ) {
if ( err ) {
console . trace (" Oops , something bad happened : % s " , err . message ) ;
mission . client () . stop () ;
mission . client () . land () ;
} else {
console . log (" Mission success !") ;
process . exit (0) ;
}
}) ;