File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-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
+ from mavsdk .server_utility import StatusTextType
6
+
7
+ """
8
+ This example shows how to use server_utility plugin to send status messages.
9
+
10
+ The messages will appear in GCS log. In order to debug messages you can use:
11
+ - QGroundControll MAVLink Inspector
12
+ - Wireshark (https://mavlink.io/en/guide/wireshark.html)
13
+
14
+ In this example we are changing sysid in order to show our message along the
15
+ other messages in QGroundControll interface.
16
+ """
17
+
18
+
19
+ async def run ():
20
+
21
+ drone = System (sysid = 1 )
22
+ await drone .connect (system_address = "udp://:14540" )
23
+
24
+ print ("Waiting for drone to connect..." )
25
+ async for state in drone .core .connection_state ():
26
+ if state .is_connected :
27
+ print (f"-- Connected to drone!" )
28
+ await drone .server_utility .send_status_text (StatusTextType .INFO , "Hello world!" )
29
+ break
30
+
31
+ if __name__ == "__main__" :
32
+ loop = asyncio .get_event_loop ()
33
+ loop .run_until_complete (run ())
You can’t perform that action at this time.
0 commit comments