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

Develop #262

Merged
merged 14 commits into from
Aug 7, 2024
155 changes: 115 additions & 40 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
linter:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -23,52 +23,136 @@ jobs:
with:
toolchain: stable
override: true

- name: UBX2RNX dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev

- uses: actions-rs/cargo@v1
name: Cargo update
with:
command: update

- uses: actions-rs/cargo@v1
name: Linter
with:
command: fmt
args: --all -- --check

- uses: actions-rs/cargo@v1
name: Build (all features)

build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- name: Workspace default
folder: "."
opts: -r
- name: Workspace All-features
folder: "."
opts: --all-features
- name: RINEX Default
folder: rinex
opts: -r
- name: RINEX Observations
folder: rinex
opts: --features "obs"
- name: RINEX Navigation
folder: rinex
opts: --features "nav"
- name: RINEX QC
folder: rinex
opts: --features "qc"
- name: RINEX Meteo
folder: rinex
opts: --features "meteo"
- name: RINEX Clock
folder: rinex
opts: --features "clock"
- name: ANTEX
folder: rinex
opts: --features "antex"
- name: DORIS RINEX
folder: rinex
opts: --features "doris"
- name: RINEX Processing
folder: rinex
opts: --features "processing"
- name: RINEX Full
folder: rinex
opts: --features "full"
- name: RINEX All-features
folder: rinex
opts: --all-features
- name: SP3 default
folder: sp3
opts: -r
- name: SP3 QC
folder: sp3
opts: --features "qc"
- name: SP3 Processing
folder: sp3
opts: --features "processing"
- name: SP3 All-features
folder: sp3
opts: --all-features
- name: RINEX-QC Default
folder: rinex-qc
opts: -r
- name: RINEX-QC SP3
folder: rinex-qc
opts: --features "sp3"
- name: RINEX-QC All-features
folder: rinex-qc
opts: --all-features

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
command: build
args: --all-features --release

- uses: actions-rs/cargo@v1
name: Test
toolchain: stable
override: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev

- name: ${{ matrix.name }}
run: |
cd ${{ matrix.folder }} && cargo clean && cargo update && cargo build ${{ matrix.opts }}

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
command: test
args: --verbose

toolchain: stable
override: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
- uses: actions-rs/cargo@v1
name: Test (all features)
with:
command: test
args: --verbose --all-features
args: --all-features

documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install nightly
with:
toolchain: nightly
override: true

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev
- name: Documentation
run: |
./tools/builddoc.sh

windows-build:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -78,24 +162,20 @@ jobs:
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
name: Cargo update
with:
command: update

- uses: actions-rs/cargo@v1
name: Build (default)
with:
command: build
args: --release --verbose
args: --release

- uses: actions-rs/cargo@v1
name: Build (all features)
with:
command: build
args: --all-features --release --verbose
args: --all-features --release

macos-build:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -105,19 +185,14 @@ jobs:
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
name: Cargo update
with:
command: update

- uses: actions-rs/cargo@v1
name: Build (default)
with:
command: build
args: --release --verbose
args: --release

- uses: actions-rs/cargo@v1
name: Build (all features)
with:
command: build
args: --all-features --release --verbose
args: --all-features --release
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ members = [
"ublox-rnx",
]

exclude = ["./test_resources"]
exclude = [
"./test_resources",
]
10 changes: 5 additions & 5 deletions rinex-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
kml = { version = "0.8", optional = true }
gpx = { version = "0.10", optional = true }

# plotly = "0.9"
plotly = "0.9"
# plotly = { path = "../../plotly-rs/plotly" }
plotly = { git = "https://github.com/gwbres/plotly", branch = "scattergeo" }
# plotly = { git = "https://github.com/gwbres/plotly", branch = "scattergeo" }

anise = { version = "0.4.2", features = ["embed_ephem"] }
hifitime = { version = "4.0.0-alpha", features = ["serde", "std"] }

gnss-rs = { version = "2.2.1", features = ["serde"] }

# gnss-rtk = { version = "0.5.0", features = ["serde"] }
# gnss-rtk = { path = "../../rtk-rs/gnss-rtk", features = ["serde"] }
# gnss-rtk = { version = "0.6.0", features = ["serde"] }
# gnss-rtk = { path = "../../rtk-rs/gnss-rtk", features = ["serde"] }
gnss-rtk = { git = "https://github.com/rtk-rs/gnss-rtk", branch = "main", features = ["serde"] }

cggtts = { version = "4.1.5", features = ["serde", "scheduler"], optional = true }
Expand All @@ -54,4 +54,4 @@ cggtts = { version = "4.1.5", features = ["serde", "scheduler"], optional = true

rinex = { path = "../rinex", version = "=0.16.1", features = ["full"] }
sp3 = { path = "../sp3", version = "=1.0.8", features = ["serde", "flate2"] }
rinex-qc = { path = "../rinex-qc", version = "=0.1.14", features = ["serde", "sp3"] }
rinex-qc = { path = "../rinex-qc", version = "=0.1.14", features = ["sp3"] }
52 changes: 32 additions & 20 deletions rinex-cli/src/positioning/cggtts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use gnss::prelude::{Constellation, SV};
use rinex::{carrier::Carrier, prelude::Observable};

use gnss_rtk::prelude::{
BaseStation, Candidate, Duration, Epoch, IonosphereBias, Method, Observation,
OrbitalStateProvider, Solver, TroposphereBias,
BaseStation, Candidate, Duration, Epoch, IonoComponents, IonosphereBias, Method, Observation,
OrbitalStateProvider, Solver, TropoComponents, SPEED_OF_LIGHT_M_S,
};

use cggtts::{
Expand Down Expand Up @@ -128,17 +128,18 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitalStateProvider, B: BaseS
debug!("{} ({}) - tgd: {}", *t, *sv, tgd);
}

let iono_bias = IonosphereBias {
kb_model: kb_model(nav_data, *t),
bd_model: bd_model(nav_data, *t),
ng_model: ng_model(nav_data, *t),
stec_meas: None, //TODO
let iono_components = if let Some(model) = kb_model(nav_data, *t) {
IonoComponents::KbModel(model)
} else if let Some(model) = bd_model(nav_data, *t) {
IonoComponents::BdModel(model)
} else if let Some(model) = ng_model(nav_data, *t) {
IonoComponents::NgModel(model)
} else {
// TODO STEC/IONEX
IonoComponents::Unknown
};

let tropo_bias = TroposphereBias {
total: None, //TODO
zwd_zdd: None, // TODO
};
let tropo_components = TropoComponents::Unknown; //TODO METEO

// tries to form a candidate for each signal
for (observable, data) in observations {
Expand Down Expand Up @@ -237,9 +238,17 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitalStateProvider, B: BaseS
}
}

let candidate = Candidate::new(*sv, *t, clock_corr, tgd, rtk_obs);

match solver.resolve(*t, &vec![candidate], &iono_bias, &tropo_bias) {
let candidate = Candidate::new(
*sv,
*t,
clock_corr,
tgd,
rtk_obs,
iono_components,
tropo_components,
);

match solver.resolve(*t, &vec![candidate]) {
Ok((t, pvt_solution)) => {
let pvt_data = pvt_solution.sv.get(sv).unwrap(); // infaillible

Expand All @@ -253,13 +262,16 @@ pub fn resolve<'a, 'b, CK: ClockStateProvider, O: OrbitalStateProvider, B: BaseS
* TROPO : always present
* convert to time delay (CGGTTS)
*/
let mdtr = match pvt_data.tropo_bias.value() {
Some(tropo) => tropo / 299792458.0,
None => 0.0_f64,
};
let mdtr = pvt_data.tropo_bias.unwrap_or_default() / SPEED_OF_LIGHT_M_S;

let mdio = pvt_data.iono_bias.modeled;
let msio = pvt_data.iono_bias.measured;
let mdio = match pvt_data.iono_bias {
Some(IonosphereBias::Modeled(bias)) => Some(bias),
_ => None,
};
let msio = match pvt_data.iono_bias {
Some(IonosphereBias::Measured(bias)) => Some(bias),
_ => None,
};
debug!(
"{:?} : new {}:{} solution (elev={:.2}°, azi={:.2}°, refsv={:.3E}, refsys={:.3E})",
t, sv, observable, elevation, azimuth, refsv, refsys
Expand Down
Loading
Loading