control

이륙, 호버링, 착륙 테스트

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
print("TakeOff")
13
drone.sendTakeOff()
14
for i in range(5, 0, -1):
15
print("{0}".format(i))
16
sleep(1)
17
18
print("Hovering")
19
for i in range(3, 0, -1):
20
print("{0}".format(i))
21
drone.sendControlWhile(0, 0, 0, 0, 1000)
22
sleep(0.01)
23
24
print("Landing")
25
drone.sendLanding()
26
for i in range(5, 0, -1):
27
print("{0}".format(i))
28
sleep(1)
29
30
drone.close()
Copied!

이륙, 호버링, 하강, 정지 테스트

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
print("TakeOff")
13
drone.sendTakeOff()
14
sleep(0.01)
15
16
print("Hovering")
17
drone.sendControlWhile(0, 0, 0, 0, 6400)
18
sleep(0.01)
19
20
print("Throttle down")
21
drone.sendControlWhile(0, 0, 0, -25, 3600)
22
sleep(0.01)
23
24
print("Stop")
25
drone.sendStop()
26
sleep(0.01)
27
28
29
drone.close()
Copied!

이륙, 호버링, 전진, 착륙 테스트

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
print("TakeOff")
13
drone.sendTakeOff()
14
for i in range(5, 0, -1):
15
print("{0}".format(i))
16
sleep(1)
17
18
print("Hovering")
19
drone.sendControlWhile(0, 0, 0, 0, 3600)
20
for i in range(3, 0, -1):
21
print("{0}".format(i))
22
sleep(1)
23
24
print("Go Front 1 meter")
25
drone.sendControlPosition16(10, 0, 0, 5, 0, 0)
26
for i in range(5, 0, -1):
27
print("{0}".format(i))
28
sleep(1)
29
30
print("Landing")
31
drone.sendLanding()
32
for i in range(5, 0, -1):
33
print("{0}".format(i))
34
sleep(1)
35
36
37
drone.close()
Copied!

이륙, 호버링, 1미터 전진, 1미터 오른쪽 이동, 리턴 홈 테스트

1
from time import sleep
2
3
from e_drone.drone import *
4
from e_drone.protocol import *
5
6
7
if __name__ == '__main__':
8
9
drone = Drone()
10
drone.open()
11
12
print("TakeOff")
13
drone.sendTakeOff()
14
for i in range(5, 0, -1):
15
print("{0}".format(i))
16
sleep(1)
17
18
print("Hovering")
19
drone.sendControlWhile(0, 0, 0, 0, 3600)
20
for i in range(3, 0, -1):
21
print("{0}".format(i))
22
sleep(1)
23
24
print("Go Front 1 meter")
25
drone.sendControlPosition(1.0, 0, 0, 0.5, 0, 0)
26
for i in range(5, 0, -1):
27
print("{0}".format(i))
28
sleep(1)
29
30
print("Go Right 1 meter")
31
drone.sendControlPosition(0, -1.0, 0, 0.5, 0, 0)
32
for i in range(5, 0, -1):
33
print("{0}".format(i))
34
sleep(1)
35
36
print("Return Home")
37
drone.sendFlightEvent(FlightEvent.Return)
38
for i in range(5, 0, -1):
39
print("{0}".format(i))
40
sleep(1)
41
42
43
drone.close()
Copied!
Last modified 1yr ago