Skip to content

Commit 16f37de

Browse files
Update README to include pip instructions
1 parent e90d05c commit 16f37de

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

README.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,29 @@ The Python wrapper is based on a gRPC client communicating with the gRPC server
99
- Python 3.6+ is required (because the wrapper is based on [asyncio](https://docs.python.org/3.7/library/asyncio.html)).
1010
- You may need to run `pip3` instead of `pip` and `python3` instead of `python`, depending of your system defaults.
1111

12-
## Build and run backend
12+
## Install from pip
1313

14-
First, we need to build and run the backend which is the gRPC server that the Python wrapper will connect to.
14+
To install mavsdk-python, simply run:
1515

16-
**Note: it is planned to automate this step using package managers like brew, apt-get, etc. .**
17-
18-
```
19-
git clone https://github.com/mavlink/MAVSDK --recursive
20-
cd MAVSDK
21-
mkdir -p build/default
22-
cd build/default
23-
cmake -DBUILD_BACKEND=ON ../..
24-
cmake --build .
16+
```sh
17+
pip3 install mavsdk
2518
```
2619

27-
For more help on this step, check the [docs on how to build from source](https://sdk.dronecode.org/en/contributing/build.html).
20+
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.
2821

29-
Once this is built, start PX4 SITL and run the backend:
22+
## Run the examples
23+
24+
Once the package has been installed, the examples can be run:
3025

3126
```
32-
./src/backend/src/backend_bin
27+
examples/takeoff_and_land.py
3328
```
3429

35-
By default, the backend will connect using MAVLink on UDP port 14540 which is running by default when PX4 is run in SITL (software in the loop simulation). Run `$ ./src/backend/src/backend_bin --help` for more information.
30+
## Build and run from sources
31+
32+
Note: this is more involved and targetted to contributors.
3633

37-
## Get the Python wrapper
34+
### Get the Python wrapper
3835

3936
Clone this repo and recursively update submodules:
4037

@@ -78,11 +75,8 @@ After generating the wrapper you can install a development (editable) version of
7875
pip install -e .
7976
```
8077

78+
### Build mavsdk_server
8179

82-
### Running the examples
80+
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.
8381

84-
Once the package has been installed, the examples can be run:
85-
86-
```
87-
examples/takeoff_and_land.py
88-
```
82+
For more help on this step, check the [docs on how to build from source](https://sdk.dronecode.org/en/contributing/build.html).

0 commit comments

Comments
 (0)