Skip to content

Commit fed757e

Browse files
committed
sphinx: copy basic instructions from readme
1 parent 39a2141 commit fed757e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

mavsdk/source/index.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,42 @@ MAVSDK-Python API reference
2020
system
2121
plugins/index
2222

23+
Important Notes
24+
---------------
25+
26+
- Python 3.6+ is required.
27+
- You may need to run ``pip3`` instead of ``pip`` and ``python3`` instead of ``python``, depending of your system defaults.
28+
- Auterion has a _Getting started with MAVSDK-Python: https://auterion.com/getting-started-with-mavsdk-python/ guide if you're a beginner and not sure where to start.
29+
30+
Install using pip from PyPi
31+
---------------------------
32+
33+
To install simply run:
34+
35+
pip3 install mavsdk
36+
37+
38+
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:
39+
40+
python
41+
from mavsdk import System
42+
43+
...
44+
45+
drone = System()
46+
await drone.connect(system_address="udp://:14540")
47+
48+
49+
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.
50+
51+
Run the examples
52+
----------------
53+
54+
Once the package has been installed, the examples can be run:
55+
56+
examples/takeoff_and_land.py
57+
58+
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.
2359

2460

2561
Indices and tables

0 commit comments

Comments
 (0)