2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file gnss_flowgraph.h
|
2018-04-20 11:20:10 +00:00
|
|
|
* \brief Interface of a GNSS receiver flow graph.
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
2020-06-18 09:49:28 +00:00
|
|
|
* Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es
|
2018-07-03 11:25:43 +00:00
|
|
|
* Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* It contains a signal source,
|
2018-04-20 11:20:10 +00:00
|
|
|
* a signal conditioner, a set of channels, an observables block and a pvt.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
*
|
2020-06-18 09:49:28 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2011-10-01 18:45:20 +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
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-06-18 09:49:28 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GNSS_FLOWGRAPH_H
|
|
|
|
#define GNSS_SDR_GNSS_FLOWGRAPH_H
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2019-07-11 16:39:28 +00:00
|
|
|
#include "channel_status_msg_receiver.h"
|
2019-07-16 15:41:12 +00:00
|
|
|
#include "concurrent_queue.h"
|
2021-06-02 15:13:46 +00:00
|
|
|
#include "galileo_e6_has_msg_receiver.h"
|
2022-06-01 08:33:36 +00:00
|
|
|
#include "galileo_tow_map.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "gnss_sdr_sample_counter.h"
|
|
|
|
#include "gnss_signal.h"
|
|
|
|
#include "pvt_interface.h"
|
2019-07-21 10:55:59 +00:00
|
|
|
#include <gnuradio/blocks/null_sink.h> // for null_sink
|
2019-03-29 16:36:05 +00:00
|
|
|
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
|
|
|
|
#include <pmt/pmt.h> // for pmt_t
|
|
|
|
#include <list> // for list
|
|
|
|
#include <map> // for map
|
|
|
|
#include <memory> // for for shared_ptr, dynamic_pointer_cast
|
|
|
|
#include <mutex> // for mutex
|
|
|
|
#include <string> // for string
|
|
|
|
#include <utility> // for pair
|
|
|
|
#include <vector> // for vector
|
2018-04-13 13:27:14 +00:00
|
|
|
#if ENABLE_FPGA
|
2018-08-10 09:53:40 +00:00
|
|
|
#include "gnss_sdr_fpga_sample_counter.h"
|
2018-04-13 13:27:14 +00:00
|
|
|
#endif
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Core
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Core_Receiver
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2019-03-05 07:59:04 +00:00
|
|
|
class ChannelInterface;
|
|
|
|
class ConfigurationInterface;
|
|
|
|
class GNSSBlockInterface;
|
|
|
|
class Gnss_Satellite;
|
2021-02-09 22:47:34 +00:00
|
|
|
class SignalSourceInterface;
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2018-04-20 11:20:10 +00:00
|
|
|
/*! \brief This class represents a GNSS flow graph.
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
* It contains a signal source,
|
|
|
|
* a signal conditioner, a set of channels, a PVT and an output filter.
|
|
|
|
*/
|
|
|
|
class GNSSFlowgraph
|
|
|
|
{
|
|
|
|
public:
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
2018-04-20 11:20:10 +00:00
|
|
|
* \brief Constructor that initializes the receiver flow graph
|
2011-12-27 21:21:12 +00:00
|
|
|
*/
|
2020-06-19 10:39:28 +00:00
|
|
|
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
2018-04-22 17:49:13 +00:00
|
|
|
* \brief Destructor
|
2011-12-28 21:36:45 +00:00
|
|
|
*/
|
2018-04-22 17:49:13 +00:00
|
|
|
~GNSSFlowgraph();
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Start the flow graph
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void start();
|
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Stop the flow graph
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void stop();
|
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
2018-04-20 11:20:10 +00:00
|
|
|
* \brief Connects the defined blocks in the flow graph
|
2011-12-28 21:36:45 +00:00
|
|
|
*
|
|
|
|
* Signal Source > Signal conditioner > Channels >> Observables >> PVT > Output filter
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void connect();
|
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Disconnect the blocks in the flow graph
|
|
|
|
*/
|
2018-04-22 17:49:13 +00:00
|
|
|
void disconnect();
|
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Wait for a flowgraph to complete.
|
|
|
|
*
|
|
|
|
* Flowgraphs complete when either
|
|
|
|
* (1) all blocks indicate that they are done, or
|
|
|
|
* (2) after stop() has been called to request shutdown.
|
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void wait();
|
2019-07-19 16:49:42 +00:00
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Manage satellite acquisition
|
|
|
|
*
|
|
|
|
* \param[in] who Channel ID
|
|
|
|
*/
|
2019-07-19 16:49:42 +00:00
|
|
|
void acquisition_manager(unsigned int who);
|
2019-07-21 10:55:59 +00:00
|
|
|
|
2011-12-28 21:36:45 +00:00
|
|
|
/*!
|
2018-04-20 11:20:10 +00:00
|
|
|
* \brief Applies an action to the flow graph
|
2011-12-28 21:36:45 +00:00
|
|
|
*
|
|
|
|
* \param[in] who Who generated the action
|
2018-04-20 11:20:10 +00:00
|
|
|
* \param[in] what What is the action. 0: acquisition failed; 1: acquisition success; 2: tracking lost
|
2011-12-28 21:36:45 +00:00
|
|
|
*/
|
2011-10-01 18:45:20 +00:00
|
|
|
void apply_action(unsigned int who, unsigned int what);
|
|
|
|
|
2019-07-21 10:55:59 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set flow graph configuratiob
|
|
|
|
*/
|
2019-09-11 22:31:34 +00:00
|
|
|
void set_configuration(const std::shared_ptr<ConfigurationInterface>& configuration);
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2018-06-17 19:53:37 +00:00
|
|
|
bool connected() const
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
|
|
|
return connected_;
|
|
|
|
}
|
2018-04-20 11:20:10 +00:00
|
|
|
|
2018-06-17 19:53:37 +00:00
|
|
|
bool running() const
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
|
|
|
return running_;
|
|
|
|
}
|
2018-04-20 11:20:10 +00:00
|
|
|
|
2016-04-13 14:19:15 +00:00
|
|
|
/*!
|
2019-07-21 10:55:59 +00:00
|
|
|
* \brief Sends a GNU Radio asynchronous message from telemetry to PVT
|
2016-04-13 14:19:15 +00:00
|
|
|
*
|
|
|
|
* It is used to assist the receiver with external ephemeris data
|
|
|
|
*/
|
2018-12-03 18:01:47 +00:00
|
|
|
bool send_telemetry_msg(const pmt::pmt_t& msg);
|
2018-03-03 01:03:39 +00:00
|
|
|
|
2018-11-05 16:53:53 +00:00
|
|
|
/*!
|
|
|
|
* \brief Returns a smart pointer to the PVT object
|
|
|
|
*/
|
|
|
|
std::shared_ptr<PvtInterface> get_pvt()
|
|
|
|
{
|
|
|
|
return std::dynamic_pointer_cast<PvtInterface>(pvt_);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Priorize visible satellites in the specified vector
|
|
|
|
*/
|
2019-06-29 20:04:03 +00:00
|
|
|
void priorize_satellites(const std::vector<std::pair<int, Gnss_Satellite>>& visible_satellites);
|
2018-11-05 16:53:53 +00:00
|
|
|
|
2021-01-22 16:32:37 +00:00
|
|
|
#if ENABLE_FPGA
|
2019-07-21 10:55:59 +00:00
|
|
|
void start_acquisition_helper();
|
|
|
|
|
|
|
|
void perform_hw_reset();
|
|
|
|
#endif
|
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
private:
|
2018-03-03 01:03:39 +00:00
|
|
|
void init(); // Populates the SV PRN list available for acquisition and tracking
|
2021-01-22 16:32:37 +00:00
|
|
|
int connect_desktop_flowgraph();
|
|
|
|
|
|
|
|
int connect_signal_sources();
|
|
|
|
int connect_signal_conditioners();
|
|
|
|
int connect_channels();
|
|
|
|
int connect_observables();
|
|
|
|
int connect_pvt();
|
|
|
|
int connect_sample_counter();
|
2022-06-01 08:33:36 +00:00
|
|
|
int connect_galileo_tow_map();
|
2021-01-22 16:32:37 +00:00
|
|
|
|
|
|
|
int connect_signal_sources_to_signal_conditioners();
|
|
|
|
int connect_signal_conditioners_to_channels();
|
|
|
|
int connect_channels_to_observables();
|
|
|
|
int connect_observables_to_pvt();
|
|
|
|
int connect_monitors();
|
2021-06-02 15:13:46 +00:00
|
|
|
int connect_gal_e6_has();
|
2021-01-22 16:32:37 +00:00
|
|
|
int connect_gnss_synchro_monitor();
|
|
|
|
int connect_acquisition_monitor();
|
|
|
|
int connect_tracking_monitor();
|
2021-09-05 22:05:29 +00:00
|
|
|
int connect_navdata_monitor();
|
2021-01-22 16:32:37 +00:00
|
|
|
|
|
|
|
#if ENABLE_FPGA
|
|
|
|
int connect_fpga_flowgraph();
|
|
|
|
int connect_fpga_sample_counter();
|
|
|
|
#endif
|
|
|
|
|
2021-12-17 12:24:24 +00:00
|
|
|
int assign_channels();
|
2021-01-22 16:32:37 +00:00
|
|
|
void check_signal_conditioners();
|
|
|
|
|
2012-01-27 11:58:55 +00:00
|
|
|
void set_signals_list();
|
2018-03-03 01:03:39 +00:00
|
|
|
void set_channels_state(); // Initializes the channels state (start acquisition or keep standby)
|
|
|
|
// using the configuration parameters (number of channels and max channels in acquisition)
|
2019-07-11 16:39:28 +00:00
|
|
|
Gnss_Signal search_next_signal(const std::string& searched_signal,
|
|
|
|
bool& is_primary_frequency,
|
|
|
|
bool& assistance_available,
|
|
|
|
float& estimated_doppler,
|
|
|
|
double& RX_time);
|
2019-07-21 10:55:59 +00:00
|
|
|
|
|
|
|
void push_back_signal(const Gnss_Signal& gs);
|
|
|
|
void remove_signal(const Gnss_Signal& gs);
|
2021-01-24 00:49:16 +00:00
|
|
|
void print_help();
|
|
|
|
void check_desktop_conf_in_fpga_env();
|
2019-07-21 10:55:59 +00:00
|
|
|
|
2019-08-12 23:06:47 +00:00
|
|
|
double project_doppler(const std::string& searched_signal, double primary_freq_doppler_hz);
|
2019-10-04 07:17:29 +00:00
|
|
|
bool is_multiband() const;
|
2020-06-19 10:39:28 +00:00
|
|
|
|
|
|
|
std::vector<std::string> split_string(const std::string& s, char delim);
|
2021-01-22 16:32:37 +00:00
|
|
|
std::vector<bool> signal_conditioner_connected_;
|
2020-06-19 10:39:28 +00:00
|
|
|
|
2020-06-25 00:50:07 +00:00
|
|
|
gr::top_block_sptr top_block_;
|
|
|
|
|
|
|
|
std::shared_ptr<ConfigurationInterface> configuration_;
|
|
|
|
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
|
|
|
|
2021-02-09 22:47:34 +00:00
|
|
|
std::vector<std::shared_ptr<SignalSourceInterface>> sig_source_;
|
2015-02-12 17:56:05 +00:00
|
|
|
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
|
2014-04-12 22:32:16 +00:00
|
|
|
std::vector<std::shared_ptr<ChannelInterface>> channels_;
|
2020-06-25 00:50:07 +00:00
|
|
|
std::shared_ptr<GNSSBlockInterface> observables_;
|
|
|
|
std::shared_ptr<GNSSBlockInterface> pvt_;
|
|
|
|
|
|
|
|
std::map<std::string, gr::basic_block_sptr> acq_resamplers_;
|
|
|
|
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
|
|
|
|
|
|
|
|
gr::basic_block_sptr GnssSynchroMonitor_;
|
2020-10-09 18:55:31 +00:00
|
|
|
gr::basic_block_sptr GnssSynchroAcquisitionMonitor_;
|
|
|
|
gr::basic_block_sptr GnssSynchroTrackingMonitor_;
|
2021-09-05 22:05:29 +00:00
|
|
|
gr::basic_block_sptr NavDataMonitor_;
|
2020-06-25 00:50:07 +00:00
|
|
|
channel_status_msg_receiver_sptr channels_status_; // class that receives and stores the current status of the receiver channels
|
2021-06-02 15:13:46 +00:00
|
|
|
galileo_e6_has_msg_receiver_sptr gal_e6_has_rx_;
|
2022-06-01 08:33:36 +00:00
|
|
|
galileo_tow_map_sptr galileo_tow_map_;
|
2021-06-02 15:13:46 +00:00
|
|
|
|
2020-06-25 00:50:07 +00:00
|
|
|
gnss_sdr_sample_counter_sptr ch_out_sample_counter_;
|
|
|
|
#if ENABLE_FPGA
|
|
|
|
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter_;
|
|
|
|
#endif
|
|
|
|
|
2020-06-19 10:39:28 +00:00
|
|
|
std::vector<unsigned int> channels_state_;
|
2018-06-14 21:10:43 +00:00
|
|
|
|
|
|
|
std::list<Gnss_Signal> available_GPS_1C_signals_;
|
|
|
|
std::list<Gnss_Signal> available_GPS_2S_signals_;
|
|
|
|
std::list<Gnss_Signal> available_GPS_L5_signals_;
|
|
|
|
std::list<Gnss_Signal> available_SBAS_1C_signals_;
|
|
|
|
std::list<Gnss_Signal> available_GAL_1B_signals_;
|
|
|
|
std::list<Gnss_Signal> available_GAL_5X_signals_;
|
2020-06-14 15:48:36 +00:00
|
|
|
std::list<Gnss_Signal> available_GAL_7X_signals_;
|
2020-11-07 20:33:26 +00:00
|
|
|
std::list<Gnss_Signal> available_GAL_E6_signals_;
|
2018-06-14 21:10:43 +00:00
|
|
|
std::list<Gnss_Signal> available_GLO_1G_signals_;
|
|
|
|
std::list<Gnss_Signal> available_GLO_2G_signals_;
|
2018-10-22 19:16:38 +00:00
|
|
|
std::list<Gnss_Signal> available_BDS_B1_signals_;
|
2019-01-25 21:43:00 +00:00
|
|
|
std::list<Gnss_Signal> available_BDS_B3_signals_;
|
2020-06-19 10:39:28 +00:00
|
|
|
|
2018-06-14 21:10:43 +00:00
|
|
|
enum StringValue
|
|
|
|
{
|
|
|
|
evGPS_1C,
|
|
|
|
evGPS_2S,
|
|
|
|
evGPS_L5,
|
|
|
|
evSBAS_1C,
|
|
|
|
evGAL_1B,
|
|
|
|
evGAL_5X,
|
2020-06-14 15:48:36 +00:00
|
|
|
evGAL_7X,
|
2020-11-07 20:33:26 +00:00
|
|
|
evGAL_E6,
|
2018-06-14 21:10:43 +00:00
|
|
|
evGLO_1G,
|
2018-10-22 19:16:38 +00:00
|
|
|
evGLO_2G,
|
2019-03-01 19:28:21 +00:00
|
|
|
evBDS_B1,
|
|
|
|
evBDS_B3
|
2018-06-14 21:10:43 +00:00
|
|
|
};
|
|
|
|
std::map<std::string, StringValue> mapStringValues_;
|
2020-06-23 07:47:58 +00:00
|
|
|
|
|
|
|
std::string config_file_;
|
2021-01-24 00:49:16 +00:00
|
|
|
std::string help_hint_;
|
2020-06-23 07:47:58 +00:00
|
|
|
|
|
|
|
std::mutex signal_list_mutex_;
|
|
|
|
|
|
|
|
int sources_count_;
|
2020-07-09 22:37:55 +00:00
|
|
|
int channels_count_;
|
|
|
|
int acq_channels_count_;
|
|
|
|
int max_acq_channels_;
|
2020-06-23 07:47:58 +00:00
|
|
|
|
|
|
|
bool connected_;
|
|
|
|
bool running_;
|
|
|
|
bool multiband_;
|
|
|
|
bool enable_monitor_;
|
2020-10-09 18:55:31 +00:00
|
|
|
bool enable_acquisition_monitor_;
|
|
|
|
bool enable_tracking_monitor_;
|
2021-09-05 22:05:29 +00:00
|
|
|
bool enable_navdata_monitor_;
|
2021-02-23 15:48:18 +00:00
|
|
|
bool enable_fpga_offloading_;
|
2021-09-20 16:02:17 +00:00
|
|
|
bool enable_e6_has_rx_;
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GNSS_FLOWGRAPH_H
|