Skip to content

How to use custom dialect with pymavlink installed pip #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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: 18 additions & 0 deletions en/mavgen_python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ You will also need to include them in *pymavlink* and install them locally on yo

The libraries can then be used in the same way as those installed using *pip*.

### Using custom dialect with pymavlink installed pip

Another way to use a custom dialect with a standard installation of *pymavlink* with *pip* is
1. [Generate](../getting_started/generate_libraries.md) the Python libraries for your dialect.
1. Copy the generated **.py** dialect file into folder you have the code (for example: customDialect.py)
1. You need to change one import on the generated file
```python
# from ...generator.mavcrc import x25crc
from pymavlink.generator.mavcrc import x25crc
```
1. And finally use the new dialect in the code
```python
import pymavlink.mavutil as mavutil
import customDialec # the file is customDialect.py

mavutil.mavlink = customDialec
mav = mavutil.mavlink_connection(...)
```

## Using the Libraries

Expand Down