Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ jobs:
version: "10.0"
directory: ${{ runner.temp }}/llvm-10.0/

- name: Set CMake generator
if: matrix.os == 'windows-latest'
run: |
echo "CMAKE_GENERATOR=NMake Makefiles" >> $env:GITHUB_ENV
echo "${{ env.CMAKE_GENERATOR }}"
echo $env:CMAKE_GENERATOR

- name: Install rust ${{ matrix.binary_target }}
uses: actions-rs/toolchain@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion swiftnav-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "LGPL-3.0"

[build-dependencies]
bindgen = "0.59"
cmake = "0.1"
cmake = "0.1.46"

[features]
testcpp = []
2 changes: 1 addition & 1 deletion swiftnav-sys/src/libswiftnav
2 changes: 1 addition & 1 deletion swiftnav/src/ephemeris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl Ephemeris {
valid,
health_bits,
source,
__bindgen_anon_1: match terms {
data: match terms {
EphemerisTerms::Kepler(c_kepler) => {
assert!(matches!(
sid.to_constellation(),
Expand Down
100 changes: 84 additions & 16 deletions swiftnav/src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,46 @@ mod tests {
nm
}

// Note this is a copy of GPS nm1 but set to code GAL_E1B, do not combine
// them in the same test case
fn make_gal_nm1() -> NavigationMeasurement {
let mut nm = NavigationMeasurement::new();
nm.set_sid(GnssSignal::new(9, Code::GalE1b).unwrap());
nm.set_pseudorange(23946993.888943646);
nm.set_satellite_state(&SatelliteState {
pos: ECEF::new(-19477278.087422125, -7649508.9457812719, 16674633.163554827),
vel: ECEF::new(0.0, 0.0, 0.0),
acc: ECEF::new(0.0, 0.0, 0.0),
clock_err: 0.0,
clock_rate_err: 0.0,
iodc: 0,
iode: 0,
});
nm.set_lock_time(Duration::from_secs_f64(5.0));
nm.set_measured_doppler(0.);
nm
}

// Note this is a copy of GPS nm2 but set to code GAL_E1B, do not combine
// them in the same test case
fn make_gal_nm2() -> NavigationMeasurement {
let mut nm = NavigationMeasurement::new();
nm.set_sid(GnssSignal::new(1, Code::GalE1b).unwrap());
nm.set_pseudorange(22932174.156858064);
nm.set_satellite_state(&SatelliteState {
pos: ECEF::new(-9680013.5408340245, -15286326.354385279, 19429449.383770257),
vel: ECEF::new(0.0, 0.0, 0.0),
acc: ECEF::new(0.0, 0.0, 0.0),
clock_err: 0.0,
clock_rate_err: 0.0,
iodc: 0,
iode: 0,
});
nm.set_lock_time(Duration::from_secs_f64(5.0));
nm.set_measured_doppler(0.);
nm
}

#[test]
fn pvt_failed_repair() {
let nms = [make_nm1(), make_nm2(), make_nm3(), make_nm4(), make_nm5()];
Expand Down Expand Up @@ -944,9 +984,6 @@ mod tests {

#[test]
fn pvt_outlier_gps_l1ca_only() {
/* 9 L1CA signals and 1 (broken) L2CM signal */
let expected_removed_sid = GnssSignal::new(8, Code::GpsL2cm).unwrap();

let nms = [
make_nm2(),
make_nm3(),
Expand All @@ -967,10 +1004,10 @@ mod tests {
let result = calc_pvt(&nms, make_tor(), settings);

assert!(result.is_ok(), "PVT should succeed");
let (pvt_status, soln, _, sid_set) = result.unwrap();
let (pvt_status, soln, _, _sid_set) = result.unwrap();
assert_eq!(
pvt_status,
PvtStatus::RepairedSolution,
PvtStatus::RaimPassed,
"Return code should be pvt repaired. Saw: {:?}",
pvt_status
);
Expand All @@ -988,10 +1025,6 @@ mod tests {
nms.len() - 1,
soln.sats_used()
);
assert!(
sid_set.contains(expected_removed_sid),
"Unexpected RAIM removed SID!"
);
}

#[test]
Expand Down Expand Up @@ -1063,12 +1096,11 @@ mod tests {

let result = calc_pvt(&nms, make_tor(), settings);

let expected_removed_sid = GnssSignal::new(8, Code::GpsL2cm).unwrap();
assert!(result.is_ok(), "PVT should succeed");
let (pvt_status, soln, _, sid_set) = result.unwrap();
let (pvt_status, soln, _, _sid_set) = result.unwrap();
assert_eq!(
pvt_status,
PvtStatus::RepairedSolution,
PvtStatus::RaimPassed,
"Return code should be repaired solution. Saw: {:?}",
pvt_status
);
Expand All @@ -1086,10 +1118,6 @@ mod tests {
nms.len() - 2,
soln.sats_used()
);
assert!(
sid_set.contains(expected_removed_sid),
"Unexpected RAIM removed SID!"
);
}

#[test]
Expand Down Expand Up @@ -1283,4 +1311,44 @@ mod tests {
dops.vdop()
);
}

#[test]
fn test_calc_pvt_exclude_gal() {
// u8 n_used = 8;
// u8 n_gps_l1ca = 6;
// gnss_solution soln;
// dops_t dops;
// gnss_sid_set_t raim_removed_sids;

let nms = [
make_nm3(),
make_gal_nm1(),
make_gal_nm2(),
make_nm5(),
make_nm6(),
make_nm7(),
make_nm8(),
make_nm9(),
];
let settings = PvtSettings {
strategy: ProcessingStrategy::GpsOnly,
disable_raim: false,
disable_velocity: false,
};

let result = calc_pvt(&nms, make_tor(), settings);

assert!(result.is_ok(), "PVT should succeed");
let (_, soln, _, _) = result.unwrap();
assert_eq!(
soln.sats_used(),
6,
"Only 6 sats should be used when performing GPS only"
);
assert_eq!(
soln.signals_used(),
6,
"Only 6 signals should be used when performing GPS only"
);
}
}