Skip to content

Commit ce5f09e

Browse files
committed
docs: update connection syntax
1 parent c37dff7 commit ce5f09e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

mavsdk/source/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The package contains ``mavsdk_server`` already (previously called "backend"), wh
4646
from mavsdk import System
4747
...
4848
drone = System()
49-
await drone.connect(system_address="udp://:14540")
49+
await drone.connect(system_address="udpin://0.0.0.0:14540")
5050
5151
5252
Note: ``System()`` takes two named parameters: ``mavsdk_server_address`` and ``port``. When left empty, they default to ``None`` and ``50051``, respectively, and ``mavsdk_server -p 50051`` is run by ``await drone.connect()``. If ``mavsdk_server_address`` is set (e.g. to "localhost"), then ``await drone.connect()`` will not start the embedded ``mavsdk_server`` and will try to connect to a server running at this address. This is useful for platforms where ``mavsdk_server`` does not come embedded, for debugging purposes, and for running ``mavsdk_server`` in a place different than where the MAVSDK-Python script is run.
@@ -76,7 +76,7 @@ For this case, let's assume the example was like this:
7676
.. code:: python
7777
7878
drone = System()
79-
await drone.connect(system_address="udp://:14540")
79+
await drone.connect(system_address="udpin://0.0.0.0:14540")
8080
8181
8282
The mavsdk_server binary is installed using ``pip``. If installed with ``python -m pip install --upgrade mavsdk`` it is usually (at least for Linux) to be found in ``~/.local/lib/python3.10/site-packages/mavsdk/bin/`` (of course depending on the Python version used).
@@ -85,21 +85,21 @@ It can then be run in a separate console with the ``system_address`` as an argum
8585

8686
.. code:: bash
8787
88-
~/.local/lib/python3.10/site-packages/mavsdk/bin/mavsdk_server udp://:14540
88+
~/.local/lib/python3.10/site-packages/mavsdk/bin/mavsdk_server udpin://0.0.0.0:14540
8989
9090
Without an autopilot connecting, the output will look something like:
9191

9292
.. code:: bash
9393
9494
[02:36:31|Info ] MAVSDK version: v1.4.16 (mavsdk_impl.cpp:28)
95-
[02:36:31|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
95+
[02:36:31|Info ] Waiting to discover system on udpin://0.0.0.0:14540... (connection_initiator.h:20)
9696
9797
Once an autopilot is discovered, something like this should be printed:
9898

9999
.. code:: bash
100100
101101
[02:38:12|Info ] MAVSDK version: v1.4.16 (mavsdk_impl.cpp:28)
102-
[02:38:12|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
102+
[02:38:12|Info ] Waiting to discover system on udpin://0.0.0.0:14540... (connection_initiator.h:20)
103103
[02:39:01|Info ] New system on: 127.0.0.1:14580 (with sysid: 1) (udp_connection.cpp:194)
104104
[02:39:01|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:484)
105105
[02:39:01|Debug] Component Autopilot (1) added. (system_impl.cpp:355)

mavsdk/system.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ async def connect(self, system_address=None):
9696
----------
9797
system_address: str
9898
The address of the remote system. If None, it will
99-
default to udp://:14540. Supported URL formats:
99+
default to udpin://0.0.0.0:14540. Supported URL formats:
100100
101101
- Serial: serial:///path/to/serial/dev[:baudrate]
102-
- UDP: udp://[bind_host][:bind_port]
103-
- TCP: tcp://[server_host][:server_port]
102+
- UDP in: udpin://bind_host:bind_port
103+
- UDP out: udpout://dest_host:dest_port
104+
- TCP in: tcpin://bind_host:bind_port
105+
- TCP out: tcpout://dest_host:dest_port
104106
105107
"""
106108

0 commit comments

Comments
 (0)