|
1 | 1 | // SPP example (pseudo range based direct positioning). |
2 | 2 | // This is simply here to demonstrate how to operate the API, and does not generate actual results. |
3 | 3 | use gnss_rtk::prelude::{ |
4 | | - Candidate, Carrier, ClockCorrection, Config, Duration, Epoch, Error, InvalidationCause, |
5 | | - IonoComponents, Method, Observation, OrbitalState, OrbitalStateProvider, Solver, |
6 | | - TropoComponents, SV, |
| 4 | + Candidate, Carrier, Config, Epoch, Error, Frame, InvalidationCause, Method, Observation, Orbit, |
| 5 | + OrbitSource, Solver, EARTH_J2000, SV, |
7 | 6 | }; |
8 | 7 |
|
9 | 8 | // Orbit source example |
10 | 9 | struct Orbits {} |
11 | 10 |
|
12 | | -impl OrbitalStateProvider for Orbits { |
| 11 | +impl OrbitSource for Orbits { |
13 | 12 | // For each requested "t" and "sv", |
14 | | - // if we can, we should resolve the SV [OrbitalState]. |
| 13 | + // if we can, we should resolve the SV [Orbit]. |
15 | 14 | // If interpolation is to be used (depending on your apps), you can |
16 | 15 | // use the interpolation order that we recommend here, or decide to ignore it. |
17 | | - // If you're not in position to determine [OrbitalState], simply return None. |
| 16 | + // If you're not in position to determine [Orbit], simply return None. |
18 | 17 | // If None is returned for too long, this [Epoch] will eventually be dropped out, |
19 | 18 | // and we will move on to the next |
20 | | - fn next_at(&mut self, t: Epoch, sv: SV, order: usize) -> Option<OrbitalState> { |
21 | | - let (x, y, z) = (0.0_f64, 0.0_f64, 0.0_f64); |
22 | | - Some(OrbitalState::from_position((x, y, z))) |
| 19 | + fn next_at(&mut self, t: Epoch, _sv: SV, _fr: Frame, _order: usize) -> Option<Orbit> { |
| 20 | + let (x_km, y_km, z_km) = (0.0_f64, 0.0_f64, 0.0_f64); |
| 21 | + Some(Orbit::from_position(x_km, y_km, z_km, t, EARTH_J2000)) |
23 | 22 | } |
24 | 23 | } |
25 | 24 |
|
@@ -92,17 +91,10 @@ pub fn main() { |
92 | 91 | while let Some((epoch, candidates)) = source.next() { |
93 | 92 | match solver.resolve(epoch, &candidates) { |
94 | 93 | Ok((_epoch, solution)) => { |
95 | | - // A solution was successfully resolved for this Epoch. |
96 | | - // The position is expressed as absolute ECEF [m]. |
97 | | - let _position = solution.position; |
98 | | - // The velocity vector is expressed as variations of absolute ECEF positions [m/s] |
99 | | - let _velocity = solution.velocity; |
100 | 94 | // Receiver offset to preset timescale |
101 | 95 | let (_clock_offset, _timescale) = (solution.dt, solution.timescale); |
102 | 96 | // More infos on SVs that contributed to this solution |
103 | 97 | for info in solution.sv.values() { |
104 | | - // attitude |
105 | | - let (_el, _az) = (info.azimuth, info.elevation); |
106 | 98 | // Modeled (in this example) or simply copied ionosphere bias |
107 | 99 | // impacting selected signal from this spacecraft |
108 | 100 | let _bias_m = info.iono_bias; |
|
0 commit comments