-
Notifications
You must be signed in to change notification settings - Fork 0
/
drone flight
49 lines (41 loc) · 978 Bytes
/
drone flight
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
47
48
49
from time import sleep
from e_drone.drone import *
from e_drone.protocol import *
drone = Drone()
drone.open()
print("Take off")
drone.sendTakeOff()
for i in range(5, 0, -1):
print("{0}".format(i))
sleep(1)
print("Hovering")
drone.sendControlWhile(0, 0, 0, 0, 3600)
for i in range(3, 0, -1):
print("{0}".format(i))
sleep(1)
print("pitch")
drone.sendControlPosition16(10, 0, 0, 5, 0, 0)
for i in range(5, 0, -1):
print("{0}".format(i))
sleep(1)
print("roll")
drone.sendControlPosition16(0, -10, 0, 5, 0, 0)
for i in range(5, 0, -1):
print("{0}".format(i))
sleep(1)
print("yaw")
drone.sendControlPosition16(0, 0, 0, 0, 135, 15)
for i in range(10, 0, -1):
print("{0}".format(i))
sleep(1)
print("pitch")
drone.sendControlPosition16(14, 0, 0, 5, 0, 0)
for i in range(8, 0, -1):
print("{0}".format(i))
sleep(1)
print("Landing")
drone.sendLanding()
for i in range(5, 0, -1):
print("{0}".format(i))
sleep(1)
drone.close()