File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ async def run():
9
9
drone = System ()
10
10
await drone .connect (system_address = "udp://:14540" )
11
11
12
+ status_text_task = asyncio .ensure_future (print_status_text (drone ))
13
+
12
14
print ("Waiting for drone to connect..." )
13
15
async for state in drone .core .connection_state ():
14
16
if state .is_connected :
@@ -32,6 +34,18 @@ async def run():
32
34
print ("-- Landing" )
33
35
await drone .action .land ()
34
36
37
+ status_text_task .cancel ()
38
+
39
+
40
+
41
+ async def print_status_text (drone ):
42
+ try :
43
+ async for status_text in drone .telemetry .status_text ():
44
+ print (f"Status: { status_text .type } : { status_text .text } " )
45
+ except asyncio .CancelledError :
46
+ return
47
+
48
+
35
49
if __name__ == "__main__" :
36
50
loop = asyncio .get_event_loop ()
37
51
loop .run_until_complete (run ())
You can’t perform that action at this time.
0 commit comments