GNSS-SDR  0.0.13
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 
66 /*!
67  * \brief This class implements a PVT solution based on RTKLIB
68  */
70 {
71 public:
72  Rtklib_Solver(const rtk_t& rtk, int nchannels, const std::string& dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat);
73  ~Rtklib_Solver();
74 
75  bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
76 
77  double get_hdop() const override;
78  double get_vdop() const override;
79  double get_pdop() const override;
80  double get_gdop() const override;
81  Monitor_Pvt get_monitor_pvt() const;
82 
83  sol_t pvt_sol{};
84  std::array<ssat_t, MAXSAT> pvt_ssat{};
85 
86  std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
87  std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
88  std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
89  std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
90  std::map<int, Beidou_Dnav_Ephemeris> beidou_dnav_ephemeris_map; //!< Map storing new BeiDou DNAV Ephmeris
91 
92  Galileo_Utc_Model galileo_utc_model;
93  Galileo_Iono galileo_iono;
94  std::map<int, Galileo_Almanac> galileo_almanac_map;
95 
96  Gps_Utc_Model gps_utc_model;
97  Gps_Iono gps_iono;
98  std::map<int, Gps_Almanac> gps_almanac_map;
99 
100  Gps_CNAV_Iono gps_cnav_iono;
101  Gps_CNAV_Utc_Model gps_cnav_utc_model;
102 
103  Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model
104  Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model
105 
106  Beidou_Dnav_Utc_Model beidou_dnav_utc_model;
107  Beidou_Dnav_Iono beidou_dnav_iono;
108  std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
109 
110 private:
111  bool save_matfile() const;
112 
113  std::array<obsd_t, MAXOBS> obs_data{};
114  std::array<double, 4> dop_{};
115  rtk_t rtk_{};
116  Monitor_Pvt monitor_pvt{};
117  std::string d_dump_filename;
118  std::ofstream d_dump_file;
119  int d_nchannels; // Number of available channels for positioning
120  bool d_flag_dump_enabled;
121  bool d_flag_dump_mat_enabled;
122 };
123 
124 #endif // GNSS_SDR_RTKLIB_SOLVER_H
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200K. ...
Definition: gps_iono.h:33
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:29
This class implements a PVT solution based on RTKLIB.
Definition: rtklib_solver.h:69
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-200K.
std::map< int, Gps_CNAV_Ephemeris > gps_cnav_ephemeris_map
Map storing new GPS_CNAV_Ephemeris.
Definition: rtklib_solver.h:88
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:32
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:86
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-200K.
Definition: gps_utc_model.h:32
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:813
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200K. ...
Definition: gps_cnav_iono.h:33
std::map< int, Beidou_Dnav_Ephemeris > beidou_dnav_ephemeris_map
Map storing new BeiDou DNAV Ephmeris.
Definition: rtklib_solver.h:90
std::map< int, Glonass_Gnav_Ephemeris > glonass_gnav_ephemeris_map
Map storing new GLONASS GNAV Ephemeris.
Definition: rtklib_solver.h:89
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:87
Base class for a PVT solution.
Definition: pvt_solution.h:33
Interface of a base class for a PVT solution.
Definition: rtklib.h:1059
Interface of the Gnss_Synchro class.