File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-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
+
9
+ drone = System (mavsdk_server_address = "localhost" , port = 50051 )
10
+ await drone .connect (system_address = "serial:///dev/ttyACM0:57600" )
11
+
12
+ print ("Waiting for drone to connect..." )
13
+ async for state in drone .core .connection_state ():
14
+ if state .is_connected :
15
+ print (f"-- Connected to drone!" )
16
+ break
17
+
18
+ async for update in drone .ftp .download (
19
+ "/etc/extras/px4_io-v2_default.bin" , "." , use_burst = False
20
+ ):
21
+ print (f"Got { update .bytes_transferred } of { update .total_bytes } bytes" )
22
+
23
+
24
+ if __name__ == "__main__" :
25
+ # Run the asyncio loop
26
+ asyncio .run (run ())
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
+
9
+ drone = System (mavsdk_server_address = 'localhost' , port = 50051 )
10
+ await drone .connect (system_address = "serial:///dev/ttyACM0:57600" )
11
+
12
+ print ("Waiting for drone to connect..." )
13
+ async for state in drone .core .connection_state ():
14
+ if state .is_connected :
15
+ print (f"-- Connected to drone!" )
16
+ break
17
+
18
+ print ("directory list" , await drone .ftp .list_directory ("/" ))
19
+
20
+
21
+ if __name__ == "__main__" :
22
+ # Run the asyncio loop
23
+ asyncio .run (run ())
You can’t perform that action at this time.
0 commit comments