GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
hybrid_observables_gs.h
Go to the documentation of this file.
1 /*!
2  * \file hybrid_observables_gs.h
3  * \brief Interface of the observables computation block
4  * \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
5  * \author Javier Arribas 2013. jarribas(at)cttc.es
6  * \author Antonio Ramos 2018. antonio.ramos(at)cttc.es
7  *
8  * -----------------------------------------------------------------------------
9  *
10  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
11  *
12  * GNSS-SDR is a software defined Global Navigation
13  * Satellite Systems receiver
14  *
15  * This file is part of GNSS-SDR.
16  *
17  * SPDX-License-Identifier: GPL-3.0-or-later
18  *
19  * -----------------------------------------------------------------------------
20  */
21 
22 
23 #ifndef GNSS_SDR_HYBRID_OBSERVABLES_GS_H
24 #define GNSS_SDR_HYBRID_OBSERVABLES_GS_H
25 
26 #include "obs_conf.h"
27 #include <boost/circular_buffer.hpp> // for boost::circular_buffer
28 #include <gnuradio/block.h> // for block
29 #include <gnuradio/types.h> // for gr_vector_int
30 #include <cstddef> // for size_t
31 #include <cstdint> // for int32_t
32 #include <fstream> // for std::ofstream
33 #include <map> // for std::map
34 #include <memory> // for std::shared, std:unique_ptr
35 #include <string> // for std::string
36 #include <typeinfo> // for typeid
37 #include <vector> // for std::vector
38 #if GNURADIO_USES_STD_POINTERS
39 #else
40 #include <boost/shared_ptr.hpp>
41 #endif
42 
43 class Gnss_Synchro;
45 
46 template <class T>
48 
49 #if GNURADIO_USES_STD_POINTERS
50 using hybrid_observables_gs_sptr = std::shared_ptr<hybrid_observables_gs>;
51 #else
52 using hybrid_observables_gs_sptr = boost::shared_ptr<hybrid_observables_gs>;
53 #endif
54 
55 hybrid_observables_gs_sptr hybrid_observables_gs_make(const Obs_Conf& conf_);
56 
57 /*!
58  * \brief This class implements a block that computes observables
59  */
60 class hybrid_observables_gs : public gr::block
61 {
62 public:
64  void forecast(int noutput_items, gr_vector_int& ninput_items_required);
65  int general_work(int noutput_items, gr_vector_int& ninput_items,
66  gr_vector_const_void_star& input_items, gr_vector_void_star& output_items);
67 
68 private:
69  friend hybrid_observables_gs_sptr hybrid_observables_gs_make(const Obs_Conf& conf_);
70 
71  explicit hybrid_observables_gs(const Obs_Conf& conf_);
72 
73  const size_t d_double_type_hash_code = typeid(double).hash_code();
74 
75  void msg_handler_pvt_to_observables(const pmt::pmt_t& msg);
76  double compute_T_rx_s(const Gnss_Synchro& a) const;
77  bool interp_trk_obs(Gnss_Synchro& interpolated_obs, uint32_t ch, uint64_t rx_clock) const;
78  void update_TOW(const std::vector<Gnss_Synchro>& data);
79  void compute_pranges(std::vector<Gnss_Synchro>& data) const;
80  void smooth_pseudoranges(std::vector<Gnss_Synchro>& data);
81  int32_t save_matfile() const;
82 
83  Obs_Conf d_conf;
84 
85  enum StringValue_
86  {
87  evGPS_1C,
88  evGPS_2S,
89  evGPS_L5,
90  evSBAS_1C,
91  evGAL_1B,
92  evGAL_5X,
93  evGLO_1G,
94  evGLO_2G,
95  evBDS_B1,
96  evBDS_B2,
97  evBDS_B3
98  };
99  std::map<std::string, StringValue_> d_mapStringValues;
100 
101  std::unique_ptr<Gnss_circular_deque<Gnss_Synchro>> d_gnss_synchro_history; // Tracking observable history
102 
103  boost::circular_buffer<uint64_t> d_Rx_clock_buffer; // time history
104 
105  std::vector<bool> d_channel_last_pll_lock;
106  std::vector<double> d_channel_last_pseudorange_smooth;
107  std::vector<double> d_channel_last_carrier_phase_rads;
108 
109  std::string d_dump_filename;
110 
111  std::ofstream d_dump_file;
112 
113  double d_smooth_filter_M;
114 
115  uint32_t d_T_rx_TOW_ms;
116  uint32_t d_T_rx_step_ms;
117  uint32_t d_T_status_report_timer_ms;
118  uint32_t d_nchannels_in;
119  uint32_t d_nchannels_out;
120 
121  bool d_T_rx_TOW_set; // rx time follow GPST
122  bool d_dump;
123  bool d_dump_mat;
124 };
125 
126 #endif // GNSS_SDR_HYBRID_OBSERVABLES_GS_H
This class implements a block that computes observables.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:33
Class that contains all the configuration parameters for generic observables block.