Python wrapper for MAVSDK
Project description
# MAVSDK-Python
This is the Python wrapper for MAVSDK.
The Python wrapper is based on a gRPC client communicating with the gRPC server written in C++. To use the Python wrapper the gRPC server called “backend” needs to be running on the same system. The wrapper is essentially auto-generated from the message definitions ([proto files](https://github.com/mavlink/MAVSDK-Proto)).
## Important Notes
Python 3.6+ is required (because the wrapper is based on [asyncio](https://docs.python.org/3.7/library/asyncio.html)).
You may need to run pip3 instead of pip and python3 instead of python, depending of your system defaults.
## Install using pip from PyPy
To install mavsdk-python, simply run:
`sh pip3 install mavsdk `
The package contains mavsdk_server already (previously called “backend”). It needs to be run manually with start_mavlink(). Have a look at the examples to see it used in practice.
## Run the examples
Once the package has been installed, the examples can be run:
` examples/takeoff_and_land.py `
## Build and run from sources
Note: this is more involved and targetted to contributors.
### Get the Python wrapper
Clone this repo and recursively update submodules:
` git clone https://github.com/mavlink/MAVSDK-Python --recursive cd MAVSDK-Python `
### Install prerequisites
First install the protoc plugin (protoc-gen-dcsdk):
` cd proto/pb_plugins pip3 install -r requirements.txt pip3 install -e . `
You can check that the plugin was installed with $ which protoc-gen-dcsdk, as it should now be in the PATH.
Then go back to the root of the repo and install the dependencies of the SDK:
` cd ../.. pip3 install -r requirements.txt -r requirements-dev.txt `
### Generate wrapper
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.
` ./other/tools/run_protoc.sh `
### Install the package locally
After generating the wrapper you can install a development (editable) version of the package using:
` pip3 install -e . `
### Build mavsdk_server
MAVDSK-Python runs the mavsdk_server when start_mavlink() 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.
For more help on this step, check the [docs on how to build from source](https://mavsdk.mavlink.io/develop/en/contributing/build.html).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mavsdk-0.4.0-py3-none-win_amd64.whl.
File metadata
- Download URL: mavsdk-0.4.0-py3-none-win_amd64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d17f8a26bb3c83bc359f14aaffd5f657d8ca9b8b200727364600a757b7e9bbdd
|
|
| MD5 |
376597a59e0c0c0c3f6f781ed0d566e2
|
|
| BLAKE2b-256 |
76cde6d08c390d72b1073c238d381c9ff5997c35d685bb39c50f5a096ad4a8a9
|
File details
Details for the file mavsdk-0.4.0-py3-none-win32.whl.
File metadata
- Download URL: mavsdk-0.4.0-py3-none-win32.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9628db379d9d124f5c26e9d2b0ce88b76d98d34ae8627c6e6782bb67ad3c3d1f
|
|
| MD5 |
24ea9cc30bcff487f9947dd83bcc3495
|
|
| BLAKE2b-256 |
ea6f43ad4fb7de7c179c89aef53a2d96a9ea3cfac2bb3e590b9fadc43442f177
|
File details
Details for the file mavsdk-0.4.0-py3-none-manylinux1_x86_64.whl.
File metadata
- Download URL: mavsdk-0.4.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9cc049bfac6284ce33d07143e5f05957720f5b66a30264c0e1f186028f025f8
|
|
| MD5 |
c044f45f4a0d20ff6579ab421033f4b5
|
|
| BLAKE2b-256 |
9afe68b735053592622581d479dc9e7ee2baf7ff697761b8d66b1835a3f82902
|
File details
Details for the file mavsdk-0.4.0-py3-none-macosx_10_9_x86_64.whl.
File metadata
- Download URL: mavsdk-0.4.0-py3-none-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d576717aede55a4793fadb509cac6e9d4ada1a78e38819a17ec9a1666247043
|
|
| MD5 |
2dfb01747814c1f37d9f65dd039224cf
|
|
| BLAKE2b-256 |
c61e7277ba0a1bddb055f25c83230a6d50d77e041638f30e4c5082e9add3b17a
|