-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path7_TakeoffSync.py
More file actions
37 lines (32 loc) · 860 Bytes
/
Copy path7_TakeoffSync.py
File metadata and controls
37 lines (32 loc) · 860 Bytes
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
#!/usr/bin/python
"""
Starting for usage at the computer
Do not delete the except Typer error. GPS data error, added when include GPS
"""
import time
import math
start_time = time.time()
from core.bebop import *
drone=Bebop()
def main():
try:
drone.takeoff()
drone.hover()
time.sleep(5)
drone.land()
sys.exit(0)
except KeyboardInterrupt, e:
print
print "ManualControlException"
drone.hover()
if drone.flyingState is None or drone.flyingState == 1: # taking off
drone.emergency()
drone.land()
sys.exit(0)
def fixedTime():
new_time = (((int(math.floor(start_time)) + 1) / 10) + 1) * 10
print("Wait %s seconds ..." % (new_time - start_time))
time.sleep(new_time - start_time)
main()
if __name__ == "__main__":
fixedTime()