Skip to content

Commit 634653e

Browse files
authored
Improve features definition (#394)
* improve features definition * update gnsslib * build serde feature * cleanup * remove wkt * remove unused dependencies * improve features definition * update main table * update deps * update gitignore * updated GNSS constellation formating * removed one panic, replaced by FormatingError * adds more RINEX / CRINEX header formating tests * improved RINEX/CRINEX versioning API --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent 51a3b54 commit 634653e

File tree

19 files changed

+494
-234
lines changed

19 files changed

+494
-234
lines changed

.github/workflows/daily.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ jobs:
3737
command: build
3838
args: --all-features
3939

40+
- uses: actions-rs/cargo@v1
41+
name: Build (SERDES)
42+
with:
43+
command: build
44+
args: --features serde
45+
4046
- uses: actions-rs/cargo@v1
4147
name: Build (Observation)
4248
with:

.github/workflows/rust.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ jobs:
4848
command: build
4949
args: --all-features
5050

51+
- uses: actions-rs/cargo@v1
52+
name: Build (SERDES)
53+
with:
54+
command: build
55+
args: --features serde
56+
5157
- uses: actions-rs/cargo@v1
5258
name: Build (Observation)
5359
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Cargo.lock
1717
.DS_Store
1818
*.rnx
1919
*.crx
20+
*.rs~
2021

2122
rinex/merge.rnx
2223
rinex/test.crx

Cargo.toml

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,28 @@ msrv = "1.83"
2121
all-features = true
2222
rustdoc-args = ["--cfg", "docrs", "--generate-link-to-definition"]
2323

24-
#####################################################################
25-
# To understand the lib features, please read the following comments.
26-
#
27-
# Other features that exist:
28-
# - log: unlocks debug traces
29-
# - serde: internal structures serdes
30-
#####################################################################
31-
32-
################################################################
33-
# Note for devs:
34-
#
35-
# [Dependencies] see if we can get rid of
36-
# - geo: either replaced by Orbit, and 3D does not exist anyway
37-
# - wkt:
38-
# - strum/macros
39-
# - regex
40-
# - num/num-integer (.div_ceil)
41-
################################################################
42-
4324
[features]
44-
default = ["flate2"] # gzip files supported by default
25+
# serde by default
26+
# gzip files are supported by default
27+
default = ["flate2", "serde"]
28+
29+
# unlock objects serialization
30+
serde = [
31+
"dep:serde",
32+
"gnss-rs/serde",
33+
"hifitime/serde",
34+
"bitflags/serde",
35+
"ublox/serde",
36+
]
4537

4638
# OBSERVATION RINEX Iterators & methods. Unlocks signal combinations.
4739
obs = []
4840

4941
# NAVIGATION RINEX (decoded radio messages) Iterators & methods.
5042
# Unlocks navigation calculations including Kepler solver and Ut1Provider.
5143
nav = [
52-
"nalgebra",
5344
"anise",
45+
"nalgebra",
5446
]
5547

5648
# Provides the special UT1-TAI methods
@@ -90,8 +82,8 @@ ublox = [
9082

9183
# Unlock Quality Check and TEQC like methods & traits.
9284
qc = [
93-
"dep:gnss-qc-traits",
9485
"dep:maud",
86+
"dep:gnss-qc-traits",
9587
]
9688

9789
# Unlocks the Filter designer, pre and post processing algorithms.
@@ -114,65 +106,77 @@ full = [
114106
"rtcm",
115107
"ut1",
116108
"ublox",
109+
"serde",
117110
]
118111

119112
[build-dependencies]
120113
serde_json = { version = "1.0", features = ["preserve_order"] }
121114
serde = { version = "1.0", default-features = false, features = ["derive"] }
122115

116+
[dependencies.gnss-rs]
117+
git = "https://github.com/nav-solutions/gnss"
118+
rev = "dc4d4c2d413a3be90a3fa08a6ab29079eec13923"
119+
features = ["std", "domes", "cospar", "sbas"]
120+
121+
[dependencies.gnss-qc-traits]
122+
git = "https://github.com/nav-solutions/qc-traits"
123+
rev = "63200d41bab2efa7d10082ae43a113d360722342"
124+
optional = true
125+
features = ["html"]
126+
127+
[dependencies.binex]
128+
version = "0.5"
129+
optional = true
130+
131+
[dependencies.gnss-protos]
132+
version = "0.0.2"
133+
optional = true
134+
features = ["gps"]
135+
136+
[dependencies.ublox]
137+
git = "https://github.com/ublox-rs/ublox"
138+
rev = "d43c425ee2904d577d06e70d7fbd80d98132a8a6"
139+
optional = true
140+
features = ["std", "sfrbx-gps"]
141+
142+
[dependencies.hifitime]
143+
version = "4.1"
144+
features = ["std"]
145+
146+
[dependencies.anise]
147+
version = "0.6.9"
148+
optional = true
149+
123150
[dependencies]
124-
num = "0.4"
125-
regex = "1"
126-
strum = "0.26"
127151
thiserror = "2"
128-
lazy_static = "1.4"
129-
num-derive = "0.4"
130-
itertools = "0.14.0"
131-
# dms-coordinates = "1.3.1"
132-
# geo = { version = "0.28", optional = true }
152+
bitflags = "2"
153+
lazy_static = "1"
154+
itertools = "0.14"
133155
flate2 = { version = "1", optional = true }
134156
maud = { version = "0.26", optional = true }
135-
nalgebra = { version = "0.33.0", optional = true }
136-
bitflags = { version = "2.3", features = ["serde"] }
137-
anise = { version = "0.6.9", optional = true }
138-
hifitime = { version = "4.1", features = ["serde", "std"] }
139-
wkt = { version = "0.14", default-features = false, optional = true }
140-
gnss-rs = { version = "2.5", features = ["serde", "domes", "cospar"] }
141-
gnss-qc-traits = { version = "0.4", features = ["html"], optional = true }
157+
rtcm-rs = { version = "0.11", optional = true }
142158
serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] }
143159

160+
nalgebra = { version = "0.33", optional = true }
161+
144162
# Log is optional and our "debug" feature: use this if you're a dev.
145163
# Turn this on to obtain debug traces during parsing, formatting and calculations
146164
# Use DEBUG sensitivy for all traces.
147165
# Use normal sensitivy for error / warning traces.
148166
log = { version = "0.4", optional = true }
149167

150-
# BINEX
151-
binex = { version = "0.5", optional = true }
152-
153-
# RTCM
154-
rtcm-rs = { version = "0.11", optional = true }
155-
156-
# RINEX to GNSS protos
157-
gnss-protos = { version = "0.0.2", optional = true, features = ["gps"] }
158-
159-
# U-Blox
160-
# ublox = { version = "0.6", optional = true, features = ["std", "sfrbx-gps"] }
161-
ublox = { git = "https://github.com/ublox-rs/ublox", rev = "d43c425ee2904d577d06e70d7fbd80d98132a8a6", optional = true, features = ["std", "sfrbx-gps"] }
162-
163-
# TODO: see if we can get rid of FromPrimitive ?
168+
# TODO see if we can get rid of those
169+
num = "0.4"
170+
num-derive = "0.4"
164171
num-traits = "0.2.15"
165-
166-
# TODO: see if we can get rid of num.div_ceil() ?
167172
num-integer = "0.1.44"
168173

169174
[dev-dependencies]
170175
flate2 = "1"
171-
rand = "0.8.4"
176+
rand = "0.9"
172177
serde_json = "1"
173178
criterion = "0.7"
174179
env_logger = "0.11"
175-
ublox = { git = "https://github.com/ublox-rs/ublox", rev = "d43c425ee2904d577d06e70d7fbd80d98132a8a6", features = ["std", "sfrbx-gps"] }
176180

177181
[[bench]]
178182
name = "parsing"

README.md

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ To contribute to either of our project or join our community, you way
1919

2020
## Advantages :rocket:
2121

22-
- Fast
22+
- Fast and powerful parser
2323
- Open sources: read and access all the code
24+
- Seamless Gzip decompression (on `flate2` feature)
2425
- All modern GNSS constellations, codes and signals
2526
- GPS, Galileo, BeiDou and QZSS
2627
- Time scales: GPST, QZSST, BDT, GST, UTC, TAI
@@ -48,31 +49,65 @@ If you need to reference this work, please use the following model:
4849

4950
`Nav-solutions (2025), RINEX: analysis and processing (MPLv2), https://github.com/nav-solutions`
5051

52+
## Library features
53+
54+
All RINEX formats [described in the following table](#RINEX_formats_&_applications) are supported natively, we do not
55+
hide a specific format under compilation options. The parser is smart enough to adapt to the file
56+
revision, you don't need specific options to work with RINEX V2 or RINEX V4, and you may work with both at the same
57+
time conveniently.
58+
59+
We offer one compilation option
60+
per format, to provide more detail and "enhance" the capabilities for that format.
61+
For example:
62+
- `obs` relates to the Observation RINEX format and provides
63+
special iterators and processing feature for this file format.
64+
- `nav`: is the heaviest amongst all options, because it relies on heavy external libraries like `nalgebra`
65+
and `anise`.
66+
67+
Note that this library requires std library at all times, it is not planed to make it no-std compatible.
68+
69+
We offer many serialization (and deserialization) options:
70+
71+
- `serde` for standard serdes, usually to JSON
72+
- `ublox`: to serialize RINEX structures to UBX messages
73+
and construct RINEX structures from UBX messages
74+
- `binex`: same thing for BINEX protocol
75+
- `rtcm`: same thing for RTCM protocol
76+
- `gnss-protos`: to serialize RINEX structures to raw GNSS navigation messages,
77+
for example GPS messages, or collecting a RINEX structure from GPS messages.
78+
For example, this could be the high level entrypoint to a GNSS simulator.
79+
80+
`GNSS-QC` (Quality check) relates to complex geodesic processing workflows, usually starting
81+
from RINEX files, by means of this library. To support demanding `GNSS-QC` operations, we provide two options:
82+
83+
- The `qc` option is the entry point, it provides means to manipulate thos files.
84+
For example, merging two files into one.
85+
- The `processing` features builds on top `qc` and is expected to provide all requirements
86+
to complex GNSS-QC workflows.
87+
5188
Formats & revisions
5289
===================
5390

5491
The parser supports RINEX V4.0, that includes RINEX V4 Navigation files.
55-
We support the latest revisions for both IONEX and Clock RINEX.
56-
We support the latest (rev D) SP3 format.
92+
All revisions are supported by default and without compilation options: the parser automatically adapts.
5793

5894
RINEX formats & applications
5995
============================
6096

61-
| Type | Parser | Writer | CLI | Content | Record Iteration | Timescale |
62-
|----------------------------|-------------------|---------------------|----------------------|----------------------|----------------------| -----------|
63-
| Navigation (NAV) | :heavy_check_mark:| :construction: | :heavy_check_mark: :chart_with_upwards_trend: | Ephemerides, Ionosphere models | Epoch | SV System time broadcasting this message |
64-
| Observation (OBS) | :heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: :chart_with_upwards_trend: | Phase, Pseudo Range, Doppler, SSI | Epoch | GNSS (any) |
65-
| CRINEX (Compressed OBS) | :heavy_check_mark:| RNX2CRX1 :heavy_check_mark: RNX2CRX3 :construction: | :heavy_check_mark: :chart_with_upwards_trend: | Phase, Pseudo Range, Doppler, SSI | Epoch | GNSS (any) |
66-
| Meteorological data (MET) | :heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark: :chart_with_upwards_trend: | Meteo sensors data (Temperature, Moisture..) | Epoch | UTC |
67-
| Clocks (CLK) | :heavy_check_mark:| :construction: | :heavy_check_mark: :chart_with_upwards_trend: | Precise SV and Reference Clock states | Epoch | GNSS (any) |
68-
| Antenna (ATX) | :heavy_check_mark:| :construction: | :construction: | Precise RX/SV Antenna calibration | `antex::Antenna` | :heavy_minus_sign: |
69-
| Ionosphere Maps (IONEX) | :heavy_check_mark:| :construction: | :heavy_check_mark: :chart_with_upwards_trend: | Ionosphere Electron density | Epoch | UTC |
70-
| DORIS RINEX | :heavy_check_mark:| :construction: | :heavy_check_mark: | Temperature, Moisture, Pseudo Range and Phase observations | Epoch | TAI |
97+
| Type | Parser | Writer | Content | Record Indexing | Timescale |
98+
|----------------------------|-------------------|---------------------|-----------------------------------------------|----------------------------------------------------------------------------------| -----------|
99+
| Navigation (NAV) | :heavy_check_mark:| :heavy_check_mark: | Ephemerides, Ionosphere models | [NavKey](https://docs.rs/rinex/latest/rinex/navigation/struct.NavKey.html) | SV System time broadcasting this message |
100+
| Observation (OBS) | :heavy_check_mark:| :heavy_check_mark: | Phase, Pseudo Range, Doppler, SSI | [ObsKey](https://docs.rs/rinex/latest/rinex/observation/struct.ObsKey.html) | GNSS (any) |
101+
| CRINEX (Compressed OBS) | :heavy_check_mark:| :heavy_check_mark: | Phase, Pseudo Range, Doppler, SSI | [ObsKey](https://docs.rs/rinex/latest/rinex/observation/struct.ObsKey.html) | GNSS (any) |
102+
| Meteorological data (MET) | :heavy_check_mark:| :heavy_check_mark: | Meteo sensors data (Temperature, Moisture..) | [MeteoKey](https://docs.rs/rinex/latest/rinex/meteo/struct.MeteoKey.html) | UTC |
103+
| Clocks (CLK) | :heavy_check_mark:| :construction: | Precise temporal states | [ClockKey](https://docs.rs/rinex/latest/rinex/clock/record/struct.ClockKey.html) | GNSS (any) |
104+
| Antenna (ATX) | :heavy_check_mark:| :construction: | Precise RX/SV Antenna calibration | `antex::Antenna` | :heavy_minus_sign: |
105+
| Ionosphere Maps (IONEX) | [Moved to dedicated parser](https://github.com/nav-solutions/ionex) | :heavy_check_mark: | Ionosphere Electron density | [Record Key](https://docs.rs/ionex/latest/ionex/key/struct.Key.html) | UTC |
106+
| DORIS RINEX | [Moved to dedicated parser](https://github.com/nav-solutions/doris) | :heavy_check_mark: | Temperature, Moisture, Pseudo Range and Phase observations | [Record Key](https://docs.rs/doris-rs/latest/doris_rs/record/struct.Key.html) | TAI / "DORIS" timescale |
71107

72108
Contributions
73109
=============
74110

75-
Contributions are welcomed, do not hesitate to open new issues
76-
and submit Pull Requests through Github.
77-
78-
If you want to take part in active developments, check out our [contribution guidelines and hints](CONTRIBUTING.md) to navigate this library quicker.
111+
Contributions are welcomed, we still have a lot to accomplish, any help is always appreciated.
112+
[We wrote these few lines](CONTRIBUTING.md) to help you understand the inner workings.
113+
Join us on [Discord](https://discord.gg/EqhEBXBmJh) to discuss ongoing and future developments.

db/NAV/orbits.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@
792792
}
793793
},
794794
{
795-
"constellation": "GEO",
795+
"constellation": "SBAS",
796796
"version": {
797797
"major": 3
798798
},
@@ -812,7 +812,7 @@
812812
}
813813
},
814814
{
815-
"constellation": "GEO",
815+
"constellation": "SBAS",
816816
"version": {
817817
"major": 4
818818
},

src/error.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,22 @@ pub enum ParsingError {
183183
pub enum FormattingError {
184184
#[error("i/o: output error")]
185185
OutputError(#[from] IoError),
186+
186187
#[error("missing constellation information")]
187-
NoConstellationDefinition,
188+
UndefinedConstellation,
189+
188190
#[error("missing navigation standard specs")]
189191
MissingNavigationStandards,
192+
190193
#[error("undefined observables")]
191194
UndefinedObservables,
195+
192196
#[error("missing observable definition")]
193197
MissingObservableDefinition,
198+
194199
#[error("nav: unknown radio message")]
195200
NoNavigationDefinition,
201+
196202
#[error("nav: missing grid defs")]
197203
NoGridDefinition,
198204
}

src/hatanaka/crinex.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ use serde::{Deserialize, Serialize};
1616
pub struct CRINEX {
1717
/// Compression program version
1818
pub version: Version,
19+
1920
/// Compression program name
2021
pub prog: String,
22+
2123
/// Date of compression
2224
pub date: Epoch,
2325
}

0 commit comments

Comments
 (0)