GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
rtklib_solver.h
Go to the documentation of this file.
1/*!
2 * \file rtklib_solver.h
3 * \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
4 * data flow and structures
5 * \authors <ul>
6 * <li> 2017, Javier Arribas
7 * <li> 2017-2023, Carles Fernandez
8 * <li> 2007-2013, T. Takasu
9 * </ul>
10 *
11 * This is a derived work from RTKLIB http://www.rtklib.com/
12 * The original source code at https://github.com/tomojitakasu/RTKLIB is
13 * released under the BSD 2-clause license with an additional exclusive clause
14 * that does not apply here. This additional clause is reproduced below:
15 *
16 * " The software package includes some companion executive binaries or shared
17 * libraries necessary to execute APs on Windows. These licenses succeed to the
18 * original ones of these software. "
19 *
20 * Neither the executive binaries nor the shared libraries are required by, used
21 * or included in GNSS-SDR.
22 *
23 * -----------------------------------------------------------------------------
24 * Copyright (C) 2007-2013, T. Takasu
25 * Copyright (C) 2017-2019, Javier Arribas
26 * Copyright (C) 2017-2023, Carles Fernandez
27 * All rights reserved.
28 *
29 * SPDX-License-Identifier: BSD-2-Clause
30 *
31 * -----------------------------------------------------------------------------
32 */
33
34#ifndef GNSS_SDR_RTKLIB_SOLVER_H
35#define GNSS_SDR_RTKLIB_SOLVER_H
36
37
38#include "beidou_dnav_almanac.h"
40#include "beidou_dnav_iono.h"
42#include "galileo_almanac.h"
43#include "galileo_ephemeris.h"
44#include "galileo_has_data.h"
45#include "galileo_iono.h"
46#include "galileo_utc_model.h"
50#include "gnss_synchro.h"
51#include "gps_almanac.h"
52#include "gps_cnav_ephemeris.h"
53#include "gps_cnav_iono.h"
54#include "gps_cnav_utc_model.h"
55#include "gps_ephemeris.h"
56#include "gps_iono.h"
57#include "gps_utc_model.h"
58#include "monitor_pvt.h"
59#include "pvt_conf.h"
60#include "pvt_kf.h"
61#include "pvt_solution.h"
62#include "rtklib.h"
63#include "rtklib_conversions.h"
65#include <array>
66#include <cstdint>
67#include <fstream>
68#include <map>
69#include <string>
70#include <utility>
71
72/** \addtogroup PVT
73 * \{ */
74/** \addtogroup PVT_libs pvt_libs
75 * Library for the computation of PVT solutions.
76 * \{ */
77
78
79/*!
80 * \brief This class implements a PVT solution based on RTKLIB
81 */
82class Rtklib_Solver : public Pvt_Solution
83{
84public:
85 Rtklib_Solver(const rtk_t& rtk,
86 const Pvt_Conf& conf,
87 const std::string& dump_filename,
88 uint32_t signal_enabled_flags,
89 bool flag_dump_to_file,
90 bool flag_dump_to_mat);
91
92 ~Rtklib_Solver();
93
94 bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, double kf_update_interval_s, const SensorDataAggregator& sensor_data_aggregator);
95
96 double get_hdop() const override;
97 double get_vdop() const override;
98 double get_pdop() const override;
99 double get_gdop() const override;
100 Monitor_Pvt get_monitor_pvt() const;
101 void store_has_data(const Galileo_HAS_data& new_has_data);
102 void update_has_corrections(const std::map<int, Gnss_Synchro>& obs_map);
103
104 sol_t pvt_sol{};
105 std::array<ssat_t, MAXSAT> pvt_ssat{};
106
107 std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
108 std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
109 std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
110 std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
111 std::map<int, Beidou_Dnav_Ephemeris> beidou_dnav_ephemeris_map; //!< Map storing new BeiDou DNAV Ephmeris
112
113 Galileo_Utc_Model galileo_utc_model;
114 Galileo_Iono galileo_iono;
115 std::map<int, Galileo_Almanac> galileo_almanac_map;
116
117 Gps_Utc_Model gps_utc_model;
118 Gps_Iono gps_iono;
119 std::map<int, Gps_Almanac> gps_almanac_map;
120
121 Gps_CNAV_Iono gps_cnav_iono;
122 Gps_CNAV_Utc_Model gps_cnav_utc_model;
123
124 Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model
125 Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model
126
127 Beidou_Dnav_Utc_Model beidou_dnav_utc_model;
128 Beidou_Dnav_Iono beidou_dnav_iono;
129 std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
130
131private:
132 bool save_matfile() const;
133
134 void check_has_orbit_clock_validity(const std::map<int, Gnss_Synchro>& obs_map);
135 void get_has_biases(const std::map<int, Gnss_Synchro>& obs_map);
136 void get_current_has_obs_correction(const std::string& signal, uint32_t tow_obs, int prn);
137
138 std::array<obsd_t, MAXOBS> d_obs_data{};
139 std::array<double, 4> d_dop{};
140 std::map<int, int> d_rtklib_freq_index;
141 std::map<std::string, int> d_rtklib_band_index;
142
143 std::map<std::string, std::map<int, HAS_orbit_corrections>> d_has_orbit_corrections_store_map; // first key is system, second key is PRN
144 std::map<std::string, std::map<int, HAS_clock_corrections>> d_has_clock_corrections_store_map; // first key is system, second key is PRN
145
146 std::map<std::string, std::map<int, std::pair<float, uint32_t>>> d_has_code_bias_store_map; // first key is signal, second key is PRN
147 std::map<std::string, std::map<int, std::pair<float, uint32_t>>> d_has_phase_bias_store_map; // first key is signal, second key is PRN
148
149 std::map<std::string, std::map<int, HAS_obs_corrections>> d_has_obs_corr_map; // first key is signal, second key is PRN
150
151 std::string d_dump_filename;
152 std::ofstream d_dump_file;
153 rtk_t d_rtk{};
154 nav_t d_nav_data{};
155 Monitor_Pvt d_monitor_pvt{};
156 Pvt_Conf d_conf;
157 Pvt_Kf d_pvt_kf;
158 uint32_t d_signal_enabled_flags;
159 bool d_flag_dump_enabled;
160 bool d_flag_dump_mat_enabled;
161};
162
163
164/** \} */
165/** \} */
166#endif // GNSS_SDR_RTKLIB_SOLVER_H
Interface of a Beidou DNAV Almanac storage.
Interface of a BEIDOU EPHEMERIS storage.
Interface of a BEIDOU IONOSPHERIC MODEL storage.
Interface of a BeiDou UTC MODEL storage.
This class is a storage for the BEIDOU IONOSPHERIC data as described in ICD v2.1.
This class is a storage for the BeiDou DNAV UTC Model.
This class is a storage for Galileo HAS message type 1, as defined in Galileo High Accuracy Service S...
This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5....
This class is a storage for the GALILEO UTC MODEL data as described in Galileo ICD https://www....
This class is a storage for the GLONASS SV ALMANAC data as described GLONASS ICD (Edition 5....
This class is a storage for the GLONASS GNAV UTC MODEL data as described in GLONASS ICD (Edition 5....
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200M.
This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200M.
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200M.
Definition gps_iono.h:36
This class is a storage for the GPS UTC MODEL data as described in IS-GPS-200M.
This class contains parameters and outputs of the PVT block.
Definition monitor_pvt.h:34
Glonass_Gnav_Almanac glonass_gnav_almanac
Map storing GLONASS GNAV Almanac Model.
std::map< int, Gps_CNAV_Ephemeris > gps_cnav_ephemeris_map
Map storing new GPS_CNAV_Ephemeris.
std::map< int, Galileo_Ephemeris > galileo_ephemeris_map
Map storing new Galileo_Ephemeris.
std::map< int, Beidou_Dnav_Ephemeris > beidou_dnav_ephemeris_map
Map storing new BeiDou DNAV Ephmeris.
std::map< int, Gps_Ephemeris > gps_ephemeris_map
Map storing new GPS_Ephemeris.
std::map< int, Glonass_Gnav_Ephemeris > glonass_gnav_ephemeris_map
Map storing new GLONASS GNAV Ephemeris.
Glonass_Gnav_Utc_Model glonass_gnav_utc_model
Map storing GLONASS GNAV UTC Model.
Interface of a Galileo ALMANAC storage.
Interface of a Galileo EPHEMERIS storage.
Class for Galileo HAS message type 1 data storage.
Interface of a Galileo Ionospheric Model storage.
Interface of a Galileo UTC MODEL storage.
Interface of a GLONASS GNAV ALMANAC storage.
Interface of a GLONASS EPHEMERIS storage.
Interface of a GLONASS GNAV UTC MODEL storage.
Interface of the Gnss_Synchro class.
Interface of a GPS ALMANAC storage.
Interface of a GPS CNAV EPHEMERIS storage.
Interface of a GPS CNAV IONOSPHERIC MODEL storage.
Interface of a GPS CNAV UTC MODEL storage.
Interface of a GPS EPHEMERIS storage.
Interface of a GPS IONOSPHERIC MODEL storage.
Interface of a GPS UTC MODEL storage.
Interface of the Monitor_Pvt class.
Class that contains all the configuration parameters for the PVT block.
Kalman Filter for Position and Velocity.
Interface of a base class for a PVT solution.
main header file for the rtklib library
GNSS-SDR to RTKLIB data structures conversion functions.
Aggregates sensor samples from gnu radio stream tags into typed lists for easy access.