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

component_id does not support mavlink::common::MavComponent #97

Open
patrickelectric opened this issue May 20, 2021 · 3 comments
Open

Comments

@patrickelectric
Copy link
Member

MavComponent should be allowed to be used with component_id

@hamishwillee
Copy link

hamishwillee commented May 26, 2021

@patrickelectric What do you mean? There is nothing called MavComponent in common.xml.

If you mean MAV_COMPONENT this is an enum of component ids that have some predefined meaning. In theory you can actually use any component id other than 0 for anything, but in practice this will break code that (incorrectly) relies on the predefined meaning.

EDITED Ah, and now I see that this is a rust mavlink post, and presumably rust-specific. Please ignore me!

@patrickelectric
Copy link
Member Author

Thanks for your input @hamishwillee ! But yes, this is more related to the rust implementation 😄
Sorry for creating this simple issue, but it's better to write it down than forgetting.
The idea is to allow component_id used for the header creation to accept MavComponent enum, right now it only supports unsigned 8bits:
https://docs.rs/mavlink/0.9.0/mavlink/struct.MavHeader.html

But it should also accept MavComponent type:
https://docs.rs/mavlink/0.9.0/mavlink/common/enum.MavComponent.html

Probably I'm going to update the enum to accept an unspecified ID.
MavComponent::UNSPECIFIED(id_that_does_not_exist_in_enum)

@hamishwillee
Copy link

No need to be sorry - I think it is excellent to create issues as it is way too easy to lose track of things! And this is definitely a bug.

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