GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
rtklib_pvt.h
Go to the documentation of this file.
1 /*!
2  * \file rtklib_pvt.h
3  * \brief Interface of a Position Velocity and Time computation block
4  * \author Javier Arribas, 2017. jarribas(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_RTKLIB_PVT_H
19 #define GNSS_SDR_RTKLIB_PVT_H
20 
21 #include "gnss_synchro.h"
22 #include "pvt_interface.h" // for PvtInterface
23 #include "rtklib.h" // for rtk_t
24 #include "rtklib_pvt_gs.h" // for rtklib_pvt_gs_sptr
25 #include <gnuradio/gr_complex.h> // for gr_complex
26 #include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
27 #include <cstddef> // for size_t
28 #include <ctime> // for time_t
29 #include <map> // for map
30 #include <string> // for string
31 
32 /** \addtogroup PVT
33  * Computation of Position, Velocity and Time from GNSS observables.
34  * \{ */
35 /** \addtogroup PVT_adapters pvt_adapters
36  * Wrap GNU Radio PVT solvers with a PvtInterface
37  * \{ */
38 
40 class Galileo_Almanac;
41 class Galileo_Ephemeris;
42 class Gps_Almanac;
43 class Gps_Ephemeris;
44 
45 /*!
46  * \brief This class implements a PvtInterface for the RTKLIB PVT block
47  *
48  * Global configuration options used:
49  *
50  * GNSS-SDR.pre_2009_file - flag indicating a file older than 2009 rollover should be processed (false)
51  * GNSS-SDR.observable_interval_ms - (20)
52  *
53  * It supports the following configuration options:
54  *
55  * .dump - (false)
56  * .dump_filename - ("./pvt.dat")
57  * .dump_mat - (true)
58  * .rtk_trace_level - debug level for the RTKLIB methods (0)
59  *
60  * .output_rate_ms - (500)
61  * Note that the actual rate is the least common multiple of this value and GNSS-SDR.observable_interval_ms
62  * .display_rate_ms - (500)
63  *
64  * .flag_nmea_tty_port - (false)
65  * .nmea_dump_filename - ("./nmea_pvt.nmea")
66  * .nmea_dump_devname - ("/dev/tty1")
67  *
68  * .rinex_version - (3) overridden by -RINEX_version=n.nn command line argument
69  * .rinexobs_rate_ms - rate at which RINEX observations are written (1000). Note that
70  * the actual rate is the least common multiple of this value and
71  * .output_rate_ms
72  * .rinex_name - (-RINEX_name command-line argument)
73  *
74  * .flag_rtcm_tty_port - (false)
75  * .rtcm_dump_devname - ("/dev/pts/1")
76  * .flag_rtcm_server - (false)
77  * .rtcm_tcp_port - (2101)
78  * .rtcm_station_id - (1234)
79  * Output rates ... all values are LCM with the computed output rate (above)
80  * .rtcm_MT1019_rate_ms - (5000)
81  * .rtcm_MT1020_rate_ms - (5000)
82  * .rtcm_MT1045_rate_ms - (5000)
83  * .rtcm_MSM_rate_ms - (1000)
84  * .rtcm_MT1077_rate_ms - (.rtcm_MSM_rate_ms)
85  * .rtcm_MT1087_rate_ms - (.rtcm_MSM_rate_ms)
86  * .rtcm_MT1097_rate_ms - (.rtcm_MSM_rate_ms)
87  *
88  * .kml_rate_ms - (1000)
89  * .gpx_rate_ms - (1000)
90  * .geojson_rate_ms - (1000)
91  * .nmea_rate_ms - (1000)
92  *
93  * .positioning_mode - The RTKLIB positioning mode. ("Single") Supported values are "Single",
94  * "Static", "Kinematic", "PPP_Static" and "PPP_Kinematic". Unsupported modes
95  * include DGPS/DGNSS, Moving Baseline, Fixed, and PPP-fixed
96  * .num_bands - number of frequencies to use, between 1 and 3. Default is based on the channels configured
97  * .elevation_mask - (15.0). Value must be in the range [0,90.0]
98  * .dynamics_model - (0) 0:none, 1:velocity, 2:acceleration
99 
100  * .iono_model - ("OFF"). Supported values are "OFF", "Broadcast", "SBAS", "Iono-Free-LC",
101  * "Estimate_STEC", "IONEX". Unsupported values include QZSS broadcast, QZSS
102  * LEX, and SLANT TEC.
103  * .trop_model - ("OFF"). Supported values are "OFF", "Saastamoinen", "SBAS", "Estimate_ZTD", and
104  * "Estimate_ZTD_Grad". Unsupported values include ZTD correction and ZTD+grad
105  * correction
106  * .phwindup - phase windup correction for PPP modes (0)
107  * .reject_GPS_IIA - whether the GPS Block IIA satellites in eclipse are excluded (0). Only applies in PPP-* modes
108  * .raim_fde - whether RAIM (receiver autonomous integrity monitoring) FDE (fault detection and exclusion) is enabled (0)
109  * .earth_tide - (0)
110  * .navigation_system - mask of navigation systems to use. Default based on configured channels
111  * 0x01:GPS, 0x02:SBAS, 0x04:GLONASS, 0x08:Galileo, 0x10:QZSS, 0x20:BeiDou,
112  * 0x40:IRNS, 0x80:LEO
113  *
114  * .AR_GPS - Ambiguity Resolution mode for GPS ("Continuous"). Supported values are "OFF",
115  * "Continuous", "Instantaneous", "Fix-and-Hold", "PPP-AR". Unsupported values
116  * include PPP-AR ILS, WLNL, and TCAR.
117  * .AR_GLO - Ambiguity Resolution mode for GLONASS (1). Value must be in the range [0,3]. (0:off,1:on,2:auto cal,3:ext cal)
118  * .AR_DBS - Ambiguity Resolution Mode for BeiDou (1). Value must be in the range [0,1]. (0:off,1:on)
119  * .min_ratio_to_fix_ambiguity - (3.0)
120  * .min_lock_to_fix_ambiguity - (0)
121  * .min_elevation_to_fix_ambiguity - minimum elevation (deg) to fix integer ambiguity (0.0)
122  * .outage_reset_ambiguity - (5)
123  * .slip_threshold - (0.05)
124  * .threshold_reject_gdop - if GDOP is over this value, the observable is excluded (30.0)
125  * .threshold_reject_innovation - if innovation is over this value, the observable is excluded (30.0)
126  * .number_filter_iter - number of iterations for the estimation filter (1)
127  * .bias_0 - (30.0)
128  * .iono_0 - (0.03)
129  * .trop_0 - (0.3)
130  * .sigma_bias - process noise stddev of carrier-phase bias(ambiguity)(cycle/sqrt(s)) (1e-4)
131  * .sigma_iono - process noise stddev of vertical ionospheric delay per 10km baseline (m/sqrt(s)) (1e-3)
132  * .sigma_trop - process noise stddev of zenith tropospheric delay (m/sqrt(s)) (1e-4)
133  * .sigma_acch - process noise stddev of the receiver acceleration horizontal component (m/s2/sqrt(s)) (1e-1)
134  * .sigma_accv - process noise stddev of the receiver acceleration vertical component (m/s2/sqrt(s)) (1e-2)
135  * .sigma_pos - (0.0)
136  * .code_phase_error_ratio_l1 - (100.0)
137  * .code_phase_error_ratio_l2 - (100.0)
138  * .code_phase_error_ratio_l5 - (100.0)
139  * .carrier_phase_error_factor_a - (0.003)
140  * .carrier_phase_error_factor_b - (0.003)
141  *
142  * .output_enabled - (true)
143  * .rinex_output_enabled - (.output_enabled)
144  * .gpx_output_enabled - (.output_enabled)
145  * .geojson_output_enabled - (.output_enabled)
146  * .kml_output_enabled - (.output_enabled)
147  * .xml_output_enabled - (.output_enabled)
148  * .nmea_output_enabled - (.output_enabled)
149  * .rtcm_output_enabled - (false)
150 
151  * .output_path - directory to which output files are written (".")
152  * .rinex_output_path - (.output_path)
153  * .gpx_output_path - (.output_path)
154  * .geojson_output_path - (.output_path)
155  * .kml_output_path - (.output_path)
156  * .xml_output_path - (.output_path)
157  * .nmea_output_path - (.output_path)
158  * .rtcm_output_path - (.output_path)
159  *
160  * .enable_monitor - enable the PVT monitor (false)
161  * .monitor_client_addresses - ("127.0.0.1")
162  * .monitor_udp_port - DO NOT USE THE DEFAULT (1234)
163  * .enable_protobuf - serialize using protocol buffers (true). Monitor.enable_protobuf if true, sets this to true
164  *
165  * .enable_monitor_ephemeris - enable the ephemeris monitor (false)
166  * .monitor_ephemeris_client_addresses - ("127.0.0.1")
167  * .monitor_ephemeris_udp_port - DO NOT USE THE DEFAULT (1234)
168  *
169  * .show_local_time_zone - (false)
170  * .enable_rx_clock_correction - (false)
171  * .max_clock_offset_ms - (40)
172  */
173 class Rtklib_Pvt : public PvtInterface
174 {
175 public:
176  Rtklib_Pvt(const ConfigurationInterface* configuration,
177  const std::string& role,
178  unsigned int in_streams,
179  unsigned int out_streams);
180 
181  virtual ~Rtklib_Pvt();
182 
183  inline std::string role() override
184  {
185  return role_;
186  }
187 
188  //! Returns "RTKLIB_PVT"
189  inline std::string implementation() override
190  {
191  return "RTKLIB_PVT";
192  }
193 
194  void clear_ephemeris() override;
195  std::map<int, Gps_Ephemeris> get_gps_ephemeris() const override;
196  std::map<int, Galileo_Ephemeris> get_galileo_ephemeris() const override;
197  std::map<int, Gps_Almanac> get_gps_almanac() const override;
198  std::map<int, Galileo_Almanac> get_galileo_almanac() const override;
199 
200  void connect(gr::top_block_sptr top_block) override;
201  void disconnect(gr::top_block_sptr top_block) override;
202  gr::basic_block_sptr get_left_block() override;
203  gr::basic_block_sptr get_right_block() override;
204 
205  inline void reset() override
206  {
207  return;
208  }
209 
210  //! All blocks must have an item_size() function implementation
211  inline size_t item_size() override
212  {
213  return sizeof(Gnss_Synchro);
214  }
215 
216  bool get_latest_PVT(double* longitude_deg,
217  double* latitude_deg,
218  double* height_m,
219  double* ground_speed_kmh,
220  double* course_over_ground_deg,
221  time_t* UTC_time) override;
222 
223 private:
224  rtklib_pvt_gs_sptr pvt_;
225  rtk_t rtk{};
226  std::string role_;
227  unsigned int in_streams_;
228  unsigned int out_streams_;
229 };
230 
231 /** \} */
232 /** \} */
233 #endif // GNSS_SDR_RTKLIB_PVT_H
This class represents an interface to a PVT block.
Definition: pvt_interface.h:48
Interface of a Position Velocity and Time computation block.
This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-...
Definition: gps_ephemeris.h:40
This class is a storage for the Galileo SV ALMANAC data.
This class represents an interface to a PVT block.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:38
main header file for the rtklib library
This abstract class represents an interface to configuration parameters.
This class is a storage and orbital model functions for the Galileo SV ephemeris data as described in...
size_t item_size() override
All blocks must have an item_size() function implementation.
Definition: rtklib_pvt.h:211
This class implements a PvtInterface for the RTKLIB PVT block.
Definition: rtklib_pvt.h:173
This class is a storage for the GPS SV ALMANAC data as described in IS-GPS-200M.
Definition: gps_almanac.h:35
std::string implementation() override
Returns "RTKLIB_PVT".
Definition: rtklib_pvt.h:189
Definition: rtklib.h:1066
Interface of the Gnss_Synchro class.