-
Notifications
You must be signed in to change notification settings - Fork 0
RIIR #122
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
Draft
jbangelo
wants to merge
28
commits into
master
Choose a base branch
from
jbangelo/riir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
RIIR #122
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jbangelo
added a commit
that referenced
this pull request
Aug 26, 2025
The second chunk of changes from #122. This re-implements the GNSS signal related types of functionality in native Rust ## What's been changed - The `signal` module has been broken up into multiple files, though these extra files are not visible via the public API - The various string conversion functions have been moved to utilize the derive macros from the [`strum` crate](https://docs.rs/strum/0.27.2/strum/index.html), but the actual string values have remained the same - Conversions to/from `swiftnav-sys` integer types has been replaced with conversions to/from native Rust integer types - The conversion error types have changed to no longer contain the `swiftnav-sys` types and instead contain native Rust types - The error types use the [`thiserror` crate](https://docs.rs/thiserror/latest/thiserror/) to reduce boiler plate code ## What's been removed - `Code::sig_count()` - `Code::chip_count()` - `Code::chip_rate()` ## What's been added - The `signal::consts` module - `Constellation::sat_count()` - `Constellation::first_prn()` - `Code::get_carrier_frequency()` - `Code::get_glo_channel_frequency()` - `GnssSignal::carrier_frequency()` - `GnssSignal::get_glo_channel_frequency()` --------- Co-authored-by: Alejandro Duarte <[email protected]>
jbangelo
added a commit
that referenced
this pull request
Aug 30, 2025
The next chunk of changes from #122. This re-implements the time related functionality in native Rust. This one is a bit larger, mostly from the fact that the conversions in the C implementation are very inter-dependent and so several new bits of functionality were pulled in to make the Rust implementation mirror the C implementation. There's a few bits of functionality thrown out because they caused some significant unsoundness, but I'm sure there is still several bits of unsoundness in this translation (e.g. several panics/asserts are still present). I'd prefer to keep this PR as close to a straight translation as possible, and re-consider the soundness concerns in a future PR. ## What's been changed - I don't think any implementations are still present but meaningfully modified ## What's been removed - `GloTime` - GLONASS time is particularly complicated and rarely used - `GpsTime::to_glo()` and `GpsTime::to_glo_hardcoded()` - See above - `impl Sub<GpsTime> for GpsTime` - It turns out a `std::time::Duration` can't hold a negative value. This implementation would occasionally panic because of this. [The `chrono` crate](https://docs.rs/chrono/latest/chrono/#time-delta--duration) handles this better, maybe we can move towards their approach in a later PR? - `UtcParams::decode()` - Decoding low-level messages seem unlikely to be needed - `impl Default for UtcParams` - Defaulting this data can cause unexpected errors - `impl Default for UtcTime` - Defaulting this type can cause unexpected errors ## What's been added - The `time::consts` module - `GpsTime::from_date()` and `GpsTime::from_date_hardcoded()` - `GpsTime::to_mjd()` and `GpsTime::to_mjd_hardcoded()` - `GpsTime::to_date()` and `GpsTime::to_date_hardcoded()` - `UtcTime::to_date()` - `MJD::to_gps()` and `MJD::to_gps_hardcoded()` - `MJD::to_date()` --------- Co-authored-by: Alejandro Duarte <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original massive branch with everything re-written in Rust. I think I'll be breaking this up into smaller PRs for ease of reviewing.
The desire is to re-write as much functionality in native Rust and remove the dependency on the C library. Depending on the C library complicates the builds and can cause issues in downstream applications.