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

Restructure project to enable custom mavlink bindings generation #223

Merged
merged 20 commits into from Feb 18, 2024

Conversation

GrahamDennis
Copy link
Contributor

The goal of this PR is to enable generating Rust MAVLink bindings from custom MAVLink dialects in new crates. This is done by splitting the project into three crates:

  • mavlink-core: core MAVLink types including TCP, UDP and serial connections
  • mavlink-bindgen: a library & CLI for generating Rust bindings for MAVLink dialects
  • mavlink: generated MAVLink bindings for the MAVLink dialects in the mavlink/mavlink repo

mavlink-bindgen can be used to create MAVLink bindings for Rust, and this is used from build.rs in the mavlink crate to create bindings from the standard MAVLink dialects in https://github.com/mavlink/mavlink.

The mavlink crate is intended to remain API-compatible with the previous structure.

@GrahamDennis
Copy link
Contributor Author

This now passes all checks in my fork, so is ready for review @patrickelectric . The biggest change here is refactoring the crate into 3 crates in a single cargo workspace (which I think is required to supporting custom dialects). I'm happy to discuss alternative approaches or structures of a cargo workspace. Thanks!

@patrickelectric
Copy link
Member

That looks awesome, thanks @GrahamDennis. I'll review asap.

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a mavlink-embedded binary lost in the PR.

mavlink/build/main.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@GrahamDennis GrahamDennis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also removed the accidentally-commited mavlink-embedded binary in the root directory.

mavlink/build/main.rs Outdated Show resolved Hide resolved
@patrickelectric patrickelectric merged commit 09411e9 into mavlink:master Feb 18, 2024
18 checks passed
@booo
Copy link
Contributor

booo commented Feb 24, 2024

This change broke two links in the main README to the examples.

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

3 participants