File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import asyncio
4
+ from mavsdk import System
5
+
6
+
7
+ async def run ():
8
+ drone = System ()
9
+ await drone .connect (system_address = "udp://:14540" )
10
+
11
+ print ("Waiting for drone to connect..." )
12
+ async for state in drone .core .connection_state ():
13
+ if state .is_connected :
14
+ print (f"Drone discovered with UUID: { state .uuid } " )
15
+ break
16
+
17
+ print ("Waiting for drone to have a global position estimate..." )
18
+ async for health in drone .telemetry .health ():
19
+ if health .is_global_position_ok :
20
+ print ("Global position estimate ok" )
21
+ break
22
+
23
+ print ("-- Arming" )
24
+ await drone .action .arm ()
25
+
26
+ print ("-- Taking off" )
27
+ await drone .action .takeoff ()
28
+
29
+ await asyncio .sleep (1 )
30
+
31
+ await drone .action .goto_location (55.8688660 , - 4.2851267 , 40 , 0 )
32
+
33
+ if __name__ == "__main__" :
34
+ loop = asyncio .get_event_loop ()
35
+ loop .run_until_complete (run ())
You can’t perform that action at this time.
0 commit comments