Skip to content

Commit 5015feb

Browse files
Update README
1 parent 724fda5 commit 5015feb

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Python wrapper is based on a gRPC client communicating with the gRPC server
1010

1111
- Python 3.6+ is required (because the wrapper is based on [asyncio](https://docs.python.org/3.7/library/asyncio.html)).
1212
- You may need to run `pip3` instead of `pip` and `python3` instead of `python`, depending of your system defaults.
13-
- 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.
13+
- 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.
1414

1515
## Install using pip from PyPi
1616

@@ -31,6 +31,8 @@ drone = System()
3131
await drone.connect(system_address="udp://:14540")
3232
```
3333

34+
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.
35+
3436
## Run the examples
3537

3638
Once the package has been installed, the examples can be run:
@@ -39,11 +41,15 @@ Once the package has been installed, the examples can be run:
3941
examples/takeoff_and_land.py
4042
```
4143

42-
## Build and run from sources
44+
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.
45+
46+
## Contribute
47+
48+
Note: this is more involved and targetted at contributors.
4349

44-
Note: this is more involved and targetted to contributors.
50+
Most of the code is auto-generated from the [proto definitions](https://github.com/mavlink/mavsdk-proto), using our [templates](./other/templates). The generated files can be found in the [generated](./mavsdk/generated) folder. As a result, contributions are generally made in the templates or on the build system. Regularly, there is a need to update MAVSDK-Python to include the latest features defined in the proto definitions. This is described [below](#generate-the-code).
4551

46-
### Get the Python wrapper
52+
### Clone the repo
4753

4854
Clone this repo and recursively update submodules:
4955

@@ -71,14 +77,18 @@ cd ../..
7177
pip3 install -r requirements.txt -r requirements-dev.txt
7278
```
7379

74-
### Generate wrapper
80+
### Generate the code
7581

76-
Run the following helper script. It will generate the Python wrappers for each plugin. If the submodules are not initialized already, the script will take care of it.
82+
Run the following helper script. It will generate the Python wrappers for each plugin.
7783

7884
```
7985
./other/tools/run_protoc.sh
8086
```
8187

88+
### Update `mavsdk_server` version
89+
90+
[MAVSDK_SERVER_VERSION](./MAVSDK_SERVER_VERSION) contains exactly the tag name of the `mavsdk_server` release corresponding to the version of MAVSDK-Python. When the [proto](./proto) submodule is updated here, chances are that `mavsdk_server` should be updated, too. Just edit this file, and the corresponding binary will be downloaded by the `setup.py` script (see below).
91+
8292
### Build and install the package locally
8393

8494
After generating the wrapper you can install a development (editable) version of the package using:
@@ -88,8 +98,8 @@ python3 setup.py build
8898
pip3 install -e .
8999
```
90100

91-
### Build mavsdk_server
101+
Note: MAVDSK-Python runs `mavsdk/bin/mavsdk_server` when `await drone.connect()` is called. This binary comes from [MAVSDK](https://github.com/mavlink/MAVSDK/releases) and is downloaded during the `setup.py` step above.
92102

93-
MAVDSK-Python runs the `mavsdk_server` when `await drone.connect()` is called. Under the hood, this will run `mavsdk/bin/mavsdk_server`, which has to be built separately from [MAVSDK](https://github.com/mavlink/MAVSDK) and copied there.
103+
### Release to PyPi repository
94104

95-
For more help on this step, check the [docs on how to build from source](https://mavsdk.mavlink.io/develop/en/contributing/build.html).
105+
The CI will create and push a wheel for Windows, Linux and macOS whenever a release tag is created.

0 commit comments

Comments
 (0)