You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The Python wrapper is based on a gRPC client communicating with the gRPC server
10
10
11
11
- Python 3.6+ is required (because the wrapper is based on [asyncio](https://docs.python.org/3.7/library/asyncio.html)).
12
12
- 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.
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
+
34
36
## Run the examples
35
37
36
38
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:
39
41
examples/takeoff_and_land.py
40
42
```
41
43
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.
43
49
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).
45
51
46
-
### Get the Python wrapper
52
+
### Clone the repo
47
53
48
54
Clone this repo and recursively update submodules:
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.
77
83
78
84
```
79
85
./other/tools/run_protoc.sh
80
86
```
81
87
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
+
82
92
### Build and install the package locally
83
93
84
94
After generating the wrapper you can install a development (editable) version of the package using:
@@ -88,8 +98,8 @@ python3 setup.py build
88
98
pip3 install -e .
89
99
```
90
100
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.
92
102
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
94
104
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