Skip to content

Commit d534cb2

Browse files
authored
small improvements (#34)
* RTK unlocking continuation * working on rtk interface * Update API * introduce solid tides --------- Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
1 parent d618a48 commit d534cb2

File tree

15 files changed

+732
-429
lines changed

15 files changed

+732
-429
lines changed

examples/spp/main.rs

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPP example (pseudo range based direct positioning).
22
// This is simply here to demonstrate how to operate the API, and does not generate actual results.
33
use gnss_rtk::prelude::{
4-
BaseStation as RTKBaseStation, Candidate, Carrier, ClockCorrection, Config, Duration, Epoch,
5-
Error, InvalidationCause, IonoComponents, Method, Observation, OrbitalState,
6-
OrbitalStateProvider, Solver, TropoComponents, SV,
4+
Candidate, Carrier, ClockCorrection, Config, Duration, Epoch, Error, InvalidationCause,
5+
IonoComponents, Method, Observation, OrbitalState, OrbitalStateProvider, Solver,
6+
TropoComponents, SV,
77
};
88

99
// Orbit source example
@@ -23,16 +23,6 @@ impl OrbitalStateProvider for Orbits {
2323
}
2424
}
2525

26-
// This example is direct positioning (not RTK), therefore
27-
// the BaseStation returns Null all the time (== non existant)
28-
struct BaseStation {}
29-
30-
impl RTKBaseStation for BaseStation {
31-
fn observe(&mut self, t: Epoch, sv: SV, carrier: Carrier) -> Option<Observation> {
32-
None // no differential positioning
33-
}
34-
}
35-
3626
// Data source example
3727
struct MyDataSource {}
3828

@@ -56,12 +46,6 @@ impl MyDataSource {
5646
SV::default(),
5747
// Sampling Epoch. Must be identical for this grouping of candidates
5848
Epoch::default(),
59-
// You must provide a [ClockCorrection] for each candidate
60-
ClockCorrection::without_relativistic_correction(Duration::from_nanoseconds(
61-
100.0,
62-
)),
63-
// If you know the total group day for this Candidate, specify it here
64-
None,
6549
// List of observations
6650
vec![Observation {
6751
carrier: Carrier::L1, // example
@@ -73,10 +57,6 @@ impl MyDataSource {
7357
doppler: None,
7458
ambiguity: None,
7559
}],
76-
// Provide more information if you can
77-
IonoComponents::Unknown,
78-
// Provide more information if you can
79-
TropoComponents::Unknown,
8060
),
8161
// Create all as many candidates as possible.
8262
// It's better to have more than needed, it leaves us more possibility in the election process.
@@ -89,9 +69,6 @@ pub fn main() {
8969
// Build the Orbit source
9070
let orbits = Orbits {};
9171

92-
// Build the Base station
93-
let base_station = BaseStation {};
94-
9572
// The preset API is useful to quickly deploy depending on your application.
9673
// Static presets target static positioning.
9774
let cfg = Config::static_preset(Method::SPP); // Single Freq. Pseudo Range based
@@ -102,11 +79,8 @@ pub fn main() {
10279
&cfg,
10380
// We deploy without apriori knowledge.
10481
// The solver will initialize itself.
105-
None,
106-
// Tie the Orbit source
82+
None, // Tie the Orbit source
10783
orbits,
108-
// Tie the Base station
109-
Some(base_station),
11084
);
11185

11286
// The solver needs to be mutable, due to the iteration process.

src/bancroft.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ impl Bancroft {
4545
.pseudo
4646
.unwrap();
4747

48-
let dt_i = cd[i].clock_corr.duration.to_seconds();
48+
let clock_corr = cd[i].clock_corr.ok_or(Error::UnknownClockCorrection)?;
49+
let dt_i = clock_corr.duration.to_seconds();
4950
let tgd_i = cd[i].tgd.unwrap_or_default().to_seconds();
51+
5052
b[(i, 0)] = x_i;
5153
b[(i, 1)] = y_i;
5254
b[(i, 2)] = z_i;

0 commit comments

Comments
 (0)