GNSS-SDR  0.0.17
An Open Source GNSS Software Defined Receiver
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, 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-2019, 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"
39 #include "beidou_dnav_ephemeris.h"
40 #include "beidou_dnav_iono.h"
41 #include "beidou_dnav_utc_model.h"
42 #include "galileo_almanac.h"
43 #include "galileo_ephemeris.h"
44 #include "galileo_iono.h"
45 #include "galileo_utc_model.h"
46 #include "glonass_gnav_almanac.h"
47 #include "glonass_gnav_ephemeris.h"
48 #include "glonass_gnav_utc_model.h"
49 #include "gnss_synchro.h"
50 #include "gps_almanac.h"
51 #include "gps_cnav_ephemeris.h"
52 #include "gps_cnav_iono.h"
53 #include "gps_cnav_utc_model.h"
54 #include "gps_ephemeris.h"
55 #include "gps_iono.h"
56 #include "gps_utc_model.h"
57 #include "monitor_pvt.h"
58 #include "pvt_solution.h"
59 #include "rtklib.h"
60 #include <array>
61 #include <fstream>
62 #include <map>
63 #include <string>
64 
65 /** \addtogroup PVT
66  * \{ */
67 /** \addtogroup PVT_libs pvt_libs
68  * Library for the computation of PVT solutions.
69  * \{ */
70 
71 
72 /*!
73  * \brief This class implements a PVT solution based on RTKLIB
74  */
76 {
77 public:
78  Rtklib_Solver(const rtk_t& rtk, const std::string& dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat);
79  ~Rtklib_Solver();
80 
81  bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
82 
83  double get_hdop() const override;
84  double get_vdop() const override;
85  double get_pdop() const override;
86  double get_gdop() const override;
87  Monitor_Pvt get_monitor_pvt() const;
88 
89  sol_t pvt_sol{};
90  std::array<ssat_t, MAXSAT> pvt_ssat{};
91 
92  std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
93  std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
94  std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
95  std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
96  std::map<int, Beidou_Dnav_Ephemeris> beidou_dnav_ephemeris_map; //!< Map storing new BeiDou DNAV Ephmeris
97 
98  Galileo_Utc_Model galileo_utc_model;
99  Galileo_Iono galileo_iono;
100  std::map<int, Galileo_Almanac> galileo_almanac_map;
101 
102  Gps_Utc_Model gps_utc_model;
103  Gps_Iono gps_iono;
104  std::map<int, Gps_Almanac> gps_almanac_map;
105 
106  Gps_CNAV_Iono gps_cnav_iono;
107  Gps_CNAV_Utc_Model gps_cnav_utc_model;
108 
109  Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model
110  Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model
111 
112  Beidou_Dnav_Utc_Model beidou_dnav_utc_model;
113  Beidou_Dnav_Iono beidou_dnav_iono;
114  std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
115 
116 private:
117  bool save_matfile() const;
118 
119  std::array<obsd_t, MAXOBS> d_obs_data{};
120  std::array<double, 4> d_dop{};
121  rtk_t d_rtk{};
122  Monitor_Pvt d_monitor_pvt{};
123  std::string d_dump_filename;
124  std::ofstream d_dump_file;
125  bool d_flag_dump_enabled;
126  bool d_flag_dump_mat_enabled;
127 };
128 
129 
130 /** \} */
131 /** \} */
132 #endif // GNSS_SDR_RTKLIB_SOLVER_H
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200M. ...
Definition: gps_iono.h:35
Interface of a GLONASS EPHEMERIS storage.
This class is a storage for the BeiDou DNAV UTC Model.
Interface of a GLONASS GNAV UTC MODEL storage.
Interface of a GLONASS GNAV ALMANAC storage.
Interface of a BeiDou UTC MODEL storage.
Interface of a GPS CNAV UTC MODEL storage.
Interface of a Beidou DNAV Almanac storage.
This class is a storage for the BEIDOU IONOSPHERIC data as described in ICD v2.1. ...
Glonass_Gnav_Almanac glonass_gnav_almanac
Map storing GLONASS GNAV Almanac Model.
Interface of a GPS UTC MODEL storage.
Interface of a BEIDOU EPHEMERIS storage.
Interface of a Galileo ALMANAC storage.
This class contains parameters and outputs of the PVT block.
Definition: monitor_pvt.h:32
This class implements a PVT solution based on RTKLIB.
Definition: rtklib_solver.h:75
Interface of a GPS ALMANAC storage.
main header file for the rtklib library
This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200M.
std::map< int, Gps_CNAV_Ephemeris > gps_cnav_ephemeris_map
Map storing new GPS_CNAV_Ephemeris.
Definition: rtklib_solver.h:94
Glonass_Gnav_Utc_Model glonass_gnav_utc_model
Map storing GLONASS GNAV UTC Model.
This class is a storage for the GALILEO IONOSPHERIC data as described in Galileo ICD paragraph 5...
Definition: galileo_iono.h:37
Interface of a Galileo UTC MODEL storage.
Interface of a GPS EPHEMERIS storage.
std::map< int, Galileo_Ephemeris > galileo_ephemeris_map
Map storing new Galileo_Ephemeris.
Definition: rtklib_solver.h:92
Interface of a GPS CNAV IONOSPHERIC MODEL storage.
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 UTC MODEL data as described in IS-GPS-200M.
Definition: gps_utc_model.h:35
Interface of a BEIDOU IONOSPHERIC MODEL storage.
Interface of the Monitor_Pvt class.
This class is a storage for the GLONASS SV ALMANAC data as described GLONASS ICD (Edition 5...
This class is a storage for the GALILEO UTC MODEL data as described in Galileo ICD https://www...
Interface of a GPS CNAV EPHEMERIS storage.
Interface of a Galileo Ionospheric Model storage.
Definition: rtklib.h:814
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200M. ...
Definition: gps_cnav_iono.h:34
std::map< int, Beidou_Dnav_Ephemeris > beidou_dnav_ephemeris_map
Map storing new BeiDou DNAV Ephmeris.
Definition: rtklib_solver.h:96
std::map< int, Glonass_Gnav_Ephemeris > glonass_gnav_ephemeris_map
Map storing new GLONASS GNAV Ephemeris.
Definition: rtklib_solver.h:95
Interface of a GPS IONOSPHERIC MODEL storage.
Interface of a Galileo EPHEMERIS storage.
std::map< int, Gps_Ephemeris > gps_ephemeris_map
Map storing new GPS_Ephemeris.
Definition: rtklib_solver.h:93
Base class for a PVT solution.
Definition: pvt_solution.h:35
Interface of a base class for a PVT solution.
Definition: rtklib.h:1060
Interface of the Gnss_Synchro class.