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.
33use 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
3727struct 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.
0 commit comments