Skip to content
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

mavutil: Add option to set dialect directly from file #934

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MauroPfister
Copy link

Add option to set a dialect directly from a file anywhere on the system. The dialect file has to be generated beforehand from message definitions using mavgen.

This is useful in situations where different versions of the same dialect might be needed to talk to different devices (see #864).

Example:

from pymavlink import mavutil
import os

os.environ['MAVLINK20'] = "1"

mavutil.set_dialect_from_file("/home/user/my_dialects/v20/my_special_dialect.py")

I'm not sure if this is something that pymavlink intends to support or if there are better solutions to this problem. Happy to be educated.

@khancyr
Copy link
Contributor

khancyr commented Mar 28, 2024

probably using venv for each dialect type could work.

@MauroPfister
Copy link
Author

That only works if you don't need to switch dialect at runtime. Imagine a test application that can connect (at runtime) to various devices that might not use the same dialect. In this case using different vens won't be an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants