Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ Starting from September 2022, mavnative, a C extension for parsing mavlink, was
From the pymavlink directory, you can use :

```bash
MDEF=PATH_TO_message_definitions python3 -m pip install . -v
(cd ..; git clone https://github.com/ArduPilot/mavlink.git)
MDEF=$PWD/../mavlink/message_definitions python3 -m pip install . -v
```

Since pip installation is executed from /tmp, it is necessary to point to the directory containing message definitions with MDEF. MDEF should not be set to any particular message version directory but the parent folder instead. If you have cloned from mavlink/mavlink then this is ```/mavlink/message_definitions``` . Using pip should auto install dependencies and allow you to keep them up-to-date.
Expand All @@ -105,6 +106,21 @@ Or:
python3 -m pip install .
```

## Running the tests

From inside the pymavlink directory, fetch the message definitions alongside
the checkout and run the suite with `pytest`:

```bash
(cd ..; git clone https://github.com/ArduPilot/mavlink.git)
MDEF=$PWD/../mavlink/message_definitions PYTHONPATH=.. python3 -m pytest
```

`MDEF` points at the message definitions used to generate the dialects; if you
already have an ArduPilot checkout, point it at that `mavlink/message_definitions`
instead. `PYTHONPATH=..` imports the local checkout rather than a pip-installed
copy.

### Ardupilot Custom Modes

By default, `pymavlink` will map the Ardupilot mode names to mode numbers per the definitions in the [ardupilotmega.xml](https://mavlink.io/en/messages/ardupilotmega.html#PLANE_MODE) file. However, during development, it can be useful to add to or update the default mode mappings.
Expand Down