Skip to content

Conversation

@BLM16
Copy link
Member

@BLM16 BLM16 commented Apr 18, 2025

Added the sbg-rs crate which provides a Rust wrapper around the sbgECom C library.

A custom build script compiles and links the library and uses bindgen to generate a bindings file for given library headers.

TODO:

  • Fix sbg_manager to work with Phoenix (it is currently a clone from Hydra so config is wrong)
  • Update CI pipeline to have the appropriate tooling to build sbg-rs (CMake, Arm Cross-Compiler, Clang)
  • Make sbgECom C library a git submodule (I tried initially and it seems the newest version causes issues with cross-compilation because it introduces Windows and Unix specific code, but if we can resolve it, that would be ideal)

@BLM16 BLM16 self-assigned this Apr 18, 2025
@BLM16 BLM16 requested a review from n123xyz April 18, 2025 03:53
@n123xyz
Copy link
Contributor

n123xyz commented Apr 18, 2025

Can you add this to the workspace Cargo.toml. TLDR: Optimisation makes you fall of the trampoline and hurt yourself 🤕 I say it this way because I'm not entirely sure why this happens with sbg-rs with any other opt-level, but you get a trampoline related failure.
`[profile.dev.package.sbg-rs]
opt-level = 0
debug = true

[profile.release.package.sbg-rs]
debug = true
opt-level = 0
`

@n123xyz
Copy link
Contributor

n123xyz commented Apr 18, 2025

I think the build fails because of this message repo being updated https://github.com/uorocketry/messages Check your lock 🔒

@BLM16
Copy link
Member Author

BLM16 commented Apr 18, 2025

[profile.release.package.sbg-rs]
debug = true
opt-level = 0

We want debug true for release too?

@BLM16
Copy link
Member Author

BLM16 commented Apr 18, 2025

I think the build fails because of this message repo being updated https://github.com/uorocketry/messages Check your lock 🔒

Oops, I forgot about that... I may have run cargo update instead of rustup update accidentally when I realized my toolchain was out of date 🤔

@n123xyz
Copy link
Contributor

n123xyz commented Apr 18, 2025

[profile.release.package.sbg-rs]
debug = true
opt-level = 0

We want debug true for release too?

I don't think it's needed 🤔 I believe I just never removed it from my search into what was going wrong.

BLM16

This comment was marked as off-topic.

@BLM16
Copy link
Member Author

BLM16 commented Apr 30, 2025

@NoahSprenger can you take a look at fixing some of these errors. I haven't been able to figure out some of the updates that you made to the messages crate which makes this very awkward to find the actual structs or enums that are expected. There are some other issues with what is a RadioMessage vs a CanMessage, and also the lifetime specifiers on all the radio stuff are a pain to deal with.

@n123xyz
Copy link
Contributor

n123xyz commented Apr 30, 2025

@NoahSprenger can you take a look at fixing some of these errors. I haven't been able to figure out some of the updates that you made to the messages crate which makes this very awkward to find the actual structs or enums that are expected. There are some other issues with what is a RadioMessage vs a CanMessage, and also the lifetime specifiers on all the radio stuff are a pain to deal with.

Yep, I can give you a hand. Can you elaborate on what you by "There are some other issues with what is a RadioMessage vs a CanMessage".

@BLM16
Copy link
Member Author

BLM16 commented Apr 30, 2025

"There are some other issues with what is a RadioMessage vs a CanMessage"

There are places where something is expecting a RadioMessage or a CanMessage and receiving the other. Specifically some stuff with Madgwick I think where the RTIC task passes in a CanMessage, but it's operating on SBG data from the RadioMessage.

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.

2 participants