2017-04-20 14:10:12 +00:00
|
|
|
/*!
|
|
|
|
* \file rtklib_solver.h
|
|
|
|
* \brief PVT solver based on rtklib library functions adapted to the GNSS-SDR
|
|
|
|
* data flow and structures
|
|
|
|
* \authors <ul>
|
|
|
|
* <li> 2017, Javier Arribas
|
|
|
|
* <li> 2017, Carles Fernandez
|
|
|
|
* <li> 2007-2013, T. Takasu
|
|
|
|
* </ul>
|
|
|
|
*
|
|
|
|
* This is a derived work from RTKLIB http://www.rtklib.com/
|
|
|
|
* The original source code at https://github.com/tomojitakasu/RTKLIB is
|
|
|
|
* released under the BSD 2-clause license with an additional exclusive clause
|
|
|
|
* that does not apply here. This additional clause is reproduced below:
|
|
|
|
*
|
|
|
|
* " The software package includes some companion executive binaries or shared
|
|
|
|
* libraries necessary to execute APs on Windows. These licenses succeed to the
|
|
|
|
* original ones of these software. "
|
|
|
|
*
|
|
|
|
* Neither the executive binaries nor the shared libraries are required by, used
|
|
|
|
* or included in GNSS-SDR.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
* Copyright (C) 2007-2013, T. Takasu
|
2019-07-26 10:38:20 +00:00
|
|
|
* Copyright (C) 2017-2019, Javier Arribas
|
|
|
|
* Copyright (C) 2017-2019, Carles Fernandez
|
2017-04-20 14:10:12 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2017-05-08 19:30:41 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_RTKLIB_SOLVER_H
|
|
|
|
#define GNSS_SDR_RTKLIB_SOLVER_H
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "beidou_dnav_almanac.h"
|
|
|
|
#include "beidou_dnav_ephemeris.h"
|
|
|
|
#include "beidou_dnav_iono.h"
|
|
|
|
#include "beidou_dnav_utc_model.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "galileo_almanac.h"
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "galileo_ephemeris.h"
|
|
|
|
#include "galileo_iono.h"
|
|
|
|
#include "galileo_utc_model.h"
|
|
|
|
#include "glonass_gnav_almanac.h"
|
|
|
|
#include "glonass_gnav_ephemeris.h"
|
|
|
|
#include "glonass_gnav_utc_model.h"
|
2017-04-20 14:10:12 +00:00
|
|
|
#include "gnss_synchro.h"
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "gps_almanac.h"
|
|
|
|
#include "gps_cnav_ephemeris.h"
|
|
|
|
#include "gps_cnav_iono.h"
|
|
|
|
#include "gps_cnav_utc_model.h"
|
|
|
|
#include "gps_ephemeris.h"
|
|
|
|
#include "gps_iono.h"
|
|
|
|
#include "gps_utc_model.h"
|
2019-01-21 10:59:29 +00:00
|
|
|
#include "monitor_pvt.h"
|
2017-04-20 14:10:12 +00:00
|
|
|
#include "pvt_solution.h"
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "rtklib.h"
|
2018-12-11 11:02:19 +00:00
|
|
|
#include <array>
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <fstream>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2018-12-03 15:39:39 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2017-04-20 14:10:12 +00:00
|
|
|
/*!
|
2019-06-28 10:26:09 +00:00
|
|
|
* \brief This class implements a PVT solution based on RTKLIB
|
2017-04-20 14:10:12 +00:00
|
|
|
*/
|
2019-02-22 09:47:24 +00:00
|
|
|
class Rtklib_Solver : public Pvt_Solution
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-07-19 07:39:32 +00:00
|
|
|
Rtklib_Solver(const rtk_t& rtk, int nchannels, const std::string& dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat);
|
2019-02-22 09:47:24 +00:00
|
|
|
~Rtklib_Solver();
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2018-06-02 10:55:00 +00:00
|
|
|
bool get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_map, bool flag_averaging);
|
2019-03-04 07:12:50 +00:00
|
|
|
|
2020-06-18 09:49:28 +00:00
|
|
|
double get_hdop() const override;
|
|
|
|
double get_vdop() const override;
|
|
|
|
double get_pdop() const override;
|
|
|
|
double get_gdop() const override;
|
2019-01-21 10:59:29 +00:00
|
|
|
Monitor_Pvt get_monitor_pvt() const;
|
2018-06-02 10:55:00 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
sol_t pvt_sol{};
|
|
|
|
std::array<ssat_t, MAXSAT> pvt_ssat{};
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
std::map<int, Galileo_Ephemeris> galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris
|
|
|
|
std::map<int, Gps_Ephemeris> gps_ephemeris_map; //!< Map storing new GPS_Ephemeris
|
|
|
|
std::map<int, Gps_CNAV_Ephemeris> gps_cnav_ephemeris_map; //!< Map storing new GPS_CNAV_Ephemeris
|
2018-12-11 11:02:19 +00:00
|
|
|
std::map<int, Glonass_Gnav_Ephemeris> glonass_gnav_ephemeris_map; //!< Map storing new GLONASS GNAV Ephemeris
|
2019-03-17 01:57:28 +00:00
|
|
|
std::map<int, Beidou_Dnav_Ephemeris> beidou_dnav_ephemeris_map; //!< Map storing new BeiDou DNAV Ephmeris
|
2017-04-20 14:10:12 +00:00
|
|
|
|
|
|
|
Galileo_Utc_Model galileo_utc_model;
|
|
|
|
Galileo_Iono galileo_iono;
|
2018-10-24 15:28:12 +00:00
|
|
|
std::map<int, Galileo_Almanac> galileo_almanac_map;
|
2017-04-20 14:10:12 +00:00
|
|
|
|
|
|
|
Gps_Utc_Model gps_utc_model;
|
|
|
|
Gps_Iono gps_iono;
|
2018-10-25 09:01:29 +00:00
|
|
|
std::map<int, Gps_Almanac> gps_almanac_map;
|
2017-04-20 14:10:12 +00:00
|
|
|
|
|
|
|
Gps_CNAV_Iono gps_cnav_iono;
|
|
|
|
Gps_CNAV_Utc_Model gps_cnav_utc_model;
|
2017-08-16 15:33:29 +00:00
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
Glonass_Gnav_Utc_Model glonass_gnav_utc_model; //!< Map storing GLONASS GNAV UTC Model
|
|
|
|
Glonass_Gnav_Almanac glonass_gnav_almanac; //!< Map storing GLONASS GNAV Almanac Model
|
2017-07-18 03:09:10 +00:00
|
|
|
|
2018-11-29 15:53:40 +00:00
|
|
|
Beidou_Dnav_Utc_Model beidou_dnav_utc_model;
|
|
|
|
Beidou_Dnav_Iono beidou_dnav_iono;
|
|
|
|
std::map<int, Beidou_Dnav_Almanac> beidou_dnav_almanac_map;
|
2018-08-09 18:36:11 +00:00
|
|
|
|
2019-07-01 21:44:42 +00:00
|
|
|
private:
|
2020-07-19 07:39:32 +00:00
|
|
|
bool save_matfile() const;
|
2020-06-23 07:47:58 +00:00
|
|
|
|
2019-08-01 19:10:02 +00:00
|
|
|
std::array<obsd_t, MAXOBS> obs_data{};
|
|
|
|
std::array<double, 4> dop_{};
|
2020-06-23 07:47:58 +00:00
|
|
|
rtk_t rtk_{};
|
|
|
|
Monitor_Pvt monitor_pvt{};
|
2019-07-01 21:44:42 +00:00
|
|
|
std::string d_dump_filename;
|
|
|
|
std::ofstream d_dump_file;
|
2019-08-01 19:10:02 +00:00
|
|
|
int d_nchannels; // Number of available channels for positioning
|
2019-07-01 21:44:42 +00:00
|
|
|
bool d_flag_dump_enabled;
|
|
|
|
bool d_flag_dump_mat_enabled;
|
2017-04-20 14:10:12 +00:00
|
|
|
};
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_RTKLIB_SOLVER_H
|