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

Switching between versions of dialects #864

Open
MauroPfister opened this issue Oct 10, 2023 · 2 comments
Open

Switching between versions of dialects #864

MauroPfister opened this issue Oct 10, 2023 · 2 comments

Comments

@MauroPfister
Copy link

I was wondering if there is an easy way to switch between different versions of dialects in code.

We are using a custom dialect to communicate with various devices over mavlink. Not all these devices necessarily use the same version of the dialect and we would like to be able to switch which dialect we're using depending on what device we are connected to.

Is there some way to achieve this?

I assume that I would have to generate the python modules for each version of the dialect according to these instructions and then make them available to mavlink by setting the MAVLINK_DIALECT and MDEF environment variables as mentioned here?

@peterbarker
Copy link
Contributor

No easy way to do that. You can include the new xml in all.xml and use the all dialect, however.

@MauroPfister
Copy link
Author

The problem here is that these dialects contain mostly the same messages but might be incompatible because some message definitions are different. I guess in this case I couldn't just include them in all.xml because the same message would be defined multiple times. Besides that, there would be no way of versionning the different dialects.

I recently discovered, that I can simply add the generated dialect .py files to the dialects/v20/ folder of the pymavlink installation and then select that dialect with mavutil.set_dialect("my_dialect.py"). However, it doesn't seem possible to load these dialect files from another location (which would solve my problem). Is there any reason for this?

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

No branches or pull requests

2 participants