Skip to content

Commit 2192dfe

Browse files
committed
docs: fix formatting
1 parent 865f9ea commit 2192dfe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mavsdk/source/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ To install simply run:
3737

3838
The package contains ``mavsdk_server`` already (previously called "backend"), which is started automatically when connecting (e.g. ``await drone.connect()``). Have a look at the examples to see it used in practice. It will be something like:
3939

40+
.. code:: python
4041
python
4142
from mavsdk import System
42-
4343
...
44-
4544
drone = System()
4645
await drone.connect(system_address="udp://:14540")
4746
@@ -53,6 +52,7 @@ Run the examples
5352

5453
Once the package has been installed, the examples can be run:
5554

55+
.. code:: bash
5656
examples/takeoff_and_land.py
5757
5858
The examples assume that the embedded ``mavsdk_server`` binary can be run. In some cases (e.g. on Raspberry Pi), it may be necessary to run ``mavsdk_server`` manually, and therefore to set ``mavsdk_server_address='localhost'`` as described above.
@@ -64,6 +64,7 @@ In order to get more debugging information, it is possible to run the mavsdk_ser
6464

6565
For this case, let's assume the example was like this:
6666

67+
.. code:: python
6768
drone = System()
6869
await drone.connect(system_address="udp://:14540")
6970
@@ -72,15 +73,18 @@ The mavsdk_server binary is installed using ``pip3``. If installed with ``pip3 -
7273

7374
It can then be run in a separate console with the ``system_address`` as an argument:
7475

76+
.. code:: bash
7577
~/.local/lib/python3.9/site-packages/mavsdk/bin/mavsdk_server udp://:14540
7678
7779
Without an autopilot connecting, the output will look something like:
7880

81+
.. code:: bash
7982
[02:36:31|Info ] MAVSDK version: v0.50.0 (mavsdk_impl.cpp:28)
8083
[02:36:31|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
8184
8285
Once an autopilot is discovered, something like this should be printed:
8386

87+
.. code:: bash
8488
[02:38:12|Info ] MAVSDK version: v0.50.0 (mavsdk_impl.cpp:28)
8589
[02:38:12|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
8690
[02:39:01|Info ] New system on: 127.0.0.1:14580 (with sysid: 1) (udp_connection.cpp:194)
@@ -93,6 +97,7 @@ Once an autopilot is discovered, something like this should be printed:
9397
9498
This would look promising, and the example can now be run against this server, however, without ``system_address``:
9599

100+
.. code:: python
96101
drone = System()
97102
await drone.connect()
98103

0 commit comments

Comments
 (0)