2017-04-20 14:10:12 +00:00
|
|
|
/*!
|
|
|
|
* \file rtklib_pvt.h
|
|
|
|
* \brief Interface of a Position Velocity and Time computation block
|
|
|
|
* \author Javier Arribas, 2017. jarribas(at)cttc.es
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-04-20 14:10:12 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2017-04-20 14:10:12 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2017-04-20 14:10:12 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-04-20 14:10:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_RTKLIB_PVT_H
|
|
|
|
#define GNSS_SDR_RTKLIB_PVT_H
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2020-06-25 12:54:01 +00:00
|
|
|
#include "gnss_synchro.h"
|
2019-03-05 07:59:04 +00:00
|
|
|
#include "pvt_interface.h" // for PvtInterface
|
|
|
|
#include "rtklib.h" // for rtk_t
|
|
|
|
#include "rtklib_pvt_gs.h" // for rtklib_pvt_gs_sptr
|
|
|
|
#include <gnuradio/gr_complex.h> // for gr_complex
|
|
|
|
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
|
|
|
|
#include <cstddef> // for size_t
|
|
|
|
#include <ctime> // for time_t
|
|
|
|
#include <map> // for map
|
|
|
|
#include <string> // for string
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup PVT
|
|
|
|
* Computation of Position, Velocity and Time from GNSS observables.
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup PVT_adapters pvt_adapters
|
|
|
|
* Wrap GNU Radio PVT solvers with a PvtInterface
|
|
|
|
* \{ */
|
|
|
|
|
2017-04-20 14:10:12 +00:00
|
|
|
class ConfigurationInterface;
|
2019-03-05 07:59:04 +00:00
|
|
|
class Galileo_Almanac;
|
|
|
|
class Galileo_Ephemeris;
|
|
|
|
class Gps_Almanac;
|
|
|
|
class Gps_Ephemeris;
|
2017-04-20 14:10:12 +00:00
|
|
|
|
|
|
|
/*!
|
2018-10-21 10:16:45 +00:00
|
|
|
* \brief This class implements a PvtInterface for the RTKLIB PVT block
|
2017-04-20 14:10:12 +00:00
|
|
|
*/
|
2019-02-26 00:38:48 +00:00
|
|
|
class Rtklib_Pvt : public PvtInterface
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-06-29 07:07:41 +00:00
|
|
|
Rtklib_Pvt(const ConfigurationInterface* configuration,
|
2018-12-02 04:29:11 +00:00
|
|
|
const std::string& role,
|
2018-03-03 01:03:39 +00:00
|
|
|
unsigned int in_streams,
|
|
|
|
unsigned int out_streams);
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2019-02-26 00:38:48 +00:00
|
|
|
virtual ~Rtklib_Pvt();
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string role() override
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
|
|
|
return role_;
|
|
|
|
}
|
|
|
|
|
2018-11-07 18:23:40 +00:00
|
|
|
//! Returns "RTKLIB_PVT"
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string implementation() override
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
|
|
|
return "RTKLIB_PVT";
|
|
|
|
}
|
|
|
|
|
2018-11-07 18:23:40 +00:00
|
|
|
void clear_ephemeris() override;
|
2018-11-08 13:25:38 +00:00
|
|
|
std::map<int, Gps_Ephemeris> get_gps_ephemeris() const override;
|
|
|
|
std::map<int, Galileo_Ephemeris> get_galileo_ephemeris() const override;
|
|
|
|
std::map<int, Gps_Almanac> get_gps_almanac() const override;
|
|
|
|
std::map<int, Galileo_Almanac> get_galileo_almanac() const override;
|
2018-11-05 16:53:53 +00:00
|
|
|
|
2017-08-15 22:58:10 +00:00
|
|
|
void connect(gr::top_block_sptr top_block) override;
|
|
|
|
void disconnect(gr::top_block_sptr top_block) override;
|
|
|
|
gr::basic_block_sptr get_left_block() override;
|
|
|
|
gr::basic_block_sptr get_right_block() override;
|
2017-04-20 14:10:12 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline void reset() override
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-06-25 12:54:01 +00:00
|
|
|
//! All blocks must have an item_size() function implementation
|
2017-08-21 09:45:12 +00:00
|
|
|
inline size_t item_size() override
|
2017-04-20 14:10:12 +00:00
|
|
|
{
|
2020-06-25 12:54:01 +00:00
|
|
|
return sizeof(Gnss_Synchro);
|
2017-04-20 14:10:12 +00:00
|
|
|
}
|
|
|
|
|
2018-11-06 13:39:57 +00:00
|
|
|
bool get_latest_PVT(double* longitude_deg,
|
|
|
|
double* latitude_deg,
|
|
|
|
double* height_m,
|
|
|
|
double* ground_speed_kmh,
|
|
|
|
double* course_over_ground_deg,
|
2018-11-07 18:23:40 +00:00
|
|
|
time_t* UTC_time) override;
|
2018-11-06 13:39:57 +00:00
|
|
|
|
2017-04-20 14:10:12 +00:00
|
|
|
private:
|
2019-03-02 01:21:03 +00:00
|
|
|
rtklib_pvt_gs_sptr pvt_;
|
2018-12-08 17:49:31 +00:00
|
|
|
rtk_t rtk{};
|
2017-04-20 14:10:12 +00:00
|
|
|
std::string role_;
|
|
|
|
unsigned int in_streams_;
|
|
|
|
unsigned int out_streams_;
|
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \} */
|
|
|
|
/** \} */
|
|
|
|
#endif // GNSS_SDR_RTKLIB_PVT_H
|