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

Fix codegeneration for newer MAVLink message definitions #285

Open
pv42 opened this issue Sep 24, 2024 · 0 comments
Open

Fix codegeneration for newer MAVLink message definitions #285

pv42 opened this issue Sep 24, 2024 · 0 comments

Comments

@pv42
Copy link
Contributor

pv42 commented Sep 24, 2024

Currently using mavlink against mavlink master's message definitions does not compile.
There are 2 issues, both related to bitmasks:

  • The enum GIMBAL_MANAGER_FLAGS that is bitmask="true" is used in messages without labeling the fields as display="bitmask". I believe this is a bug and have opened a PR (common.xml: GIMBAL_MANAGER_FLAGS display as bitmask mavlink#2154)
  • The enum ILLUMINATOR_MODE that is not a bitmask is used with display="bitmask" in the ILLUMINATOR_STATUS message. This is not really a bug since ILLUMINATOR_MODE is both used as an bitmask to indicate supported modes as well as a value to indicate the current mode.

At least the second problem requires a solution that allows the usage of enums as bitmasks independent of their designation in the enum definition.
This could be solved by generating a bitmask version of every enum regardless of their bitmask="true"designation but that would probably create a lot of extra, unneeded code. The solution that avoids that by checking the usage of each enum and the generate it depending on how it is used also does not seem ideal to me since the code generation would probably not be context free anymore. This could impact code generation performance and increase complexity but I haven't looked too far into it.
Since the version of the mavlink message definitons used is now over a year old a solution should be found, so newer messages/message fields can be used.

If someone needs an immediate solution that does not require the ILLUMINATOR_STATUS message, it would also be possible to just blacklist this message from code generation until a more permanent solution is found.

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

1 participant