1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00
gnss-sdr/src/tests/unit-tests/control-plane/gnss_flowgraph_test.cc

255 lines
14 KiB
C++
Raw Normal View History

/*!
* \file gnss_flowgraph_test.cc
* \brief This file implements tests for a flowgraph
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
* Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
*
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
*
2020-07-28 14:57:15 +00:00
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
*
* GNSS-SDR is a software defined Global Navigation
* Satellite Systems receiver
*
* This file is part of GNSS-SDR.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
2020-07-28 14:57:15 +00:00
* -----------------------------------------------------------------------------
*/
#include "acquisition_interface.h"
#include "channel.h"
#include "channel_interface.h"
#include "concurrent_queue.h"
#include "file_configuration.h"
#include "file_signal_source.h"
#include "gnss_block_interface.h"
#include "gnss_flowgraph.h"
#include "in_memory_configuration.h"
#include "pass_through.h"
#include "tracking_interface.h"
#include <gtest/gtest.h>
TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopOldNotation /*unused*/)
{
std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
2014-12-21 21:46:57 +00:00
config->set_property("GNSS-SDR.SUPL_gps_enabled", "false");
2018-02-20 14:44:45 +00:00
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
config->set_property("SignalSource.sampling_frequency", "4000000");
config->set_property("SignalSource.implementation", "File_Signal_Source");
config->set_property("SignalSource.item_type", "gr_complex");
2014-12-21 21:46:57 +00:00
config->set_property("SignalSource.repeat", "true");
std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
config->set_property("SignalSource.filename", filename);
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("Channels_1C.count", "1");
2014-12-21 21:46:57 +00:00
config->set_property("Channels.in_acquisition", "1");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C.threshold", "1");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("Observables.implementation", "Hybrid_Observables");
2017-07-12 19:25:15 +00:00
config->set_property("PVT.implementation", "RTKLIB_PVT");
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
2014-12-21 21:46:57 +00:00
EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected());
EXPECT_NO_THROW(flowgraph->start());
EXPECT_TRUE(flowgraph->running());
flowgraph->stop();
EXPECT_FALSE(flowgraph->running());
}
2014-12-21 21:46:57 +00:00
TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStop /*unused*/)
2015-07-20 20:11:15 +00:00
{
std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
2018-02-20 14:44:45 +00:00
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
2015-07-20 20:11:15 +00:00
config->set_property("SignalSource.sampling_frequency", "4000000");
config->set_property("SignalSource.implementation", "File_Signal_Source");
config->set_property("SignalSource.item_type", "gr_complex");
config->set_property("SignalSource.repeat", "true");
std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
config->set_property("SignalSource.filename", filename);
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("Channels_1C.count", "8");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Channel.signal", "1C");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C.threshold", "1");
config->set_property("Acquisition_1C.doppler_max", "5000");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("Observables.implementation", "Hybrid_Observables");
2017-07-12 19:25:15 +00:00
config->set_property("PVT.implementation", "RTKLIB_PVT");
2015-07-20 20:11:15 +00:00
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
2015-07-20 20:11:15 +00:00
EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected());
EXPECT_NO_THROW(flowgraph->start());
EXPECT_TRUE(flowgraph->running());
flowgraph->stop();
EXPECT_FALSE(flowgraph->running());
}
TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopGalileoE1B /*unused*/)
2015-07-20 20:11:15 +00:00
{
std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
2018-02-20 14:44:45 +00:00
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
2015-07-20 20:11:15 +00:00
config->set_property("SignalSource.sampling_frequency", "4000000");
config->set_property("SignalSource.implementation", "File_Signal_Source");
config->set_property("SignalSource.item_type", "gr_complex");
config->set_property("SignalSource.repeat", "true");
std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
config->set_property("SignalSource.filename", filename);
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("Channels_1B.count", "8");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Channel.signal", "1B");
config->set_property("Acquisition_1B.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B.threshold", "1");
config->set_property("Acquisition_1B.doppler_max", "5000");
config->set_property("Tracking_1B.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("TelemetryDecoder_1B.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("Observables.implementation", "Hybrid_Observables");
2017-07-12 19:25:15 +00:00
config->set_property("PVT.implementation", "RTKLIB_PVT");
2015-07-20 20:11:15 +00:00
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
2015-07-20 20:11:15 +00:00
EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected());
EXPECT_NO_THROW(flowgraph->start());
EXPECT_TRUE(flowgraph->running());
flowgraph->stop();
EXPECT_FALSE(flowgraph->running());
}
TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopHybrid /*unused*/)
2015-07-20 20:11:15 +00:00
{
std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
2018-02-20 14:44:45 +00:00
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
2015-07-20 20:11:15 +00:00
config->set_property("SignalSource.sampling_frequency", "4000000");
config->set_property("SignalSource.implementation", "File_Signal_Source");
config->set_property("SignalSource.item_type", "gr_complex");
config->set_property("SignalSource.repeat", "true");
std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat";
config->set_property("SignalSource.filename", filename);
config->set_property("SignalConditioner.implementation", "Pass_Through");
config->set_property("Channels_1C.count", "8");
config->set_property("Channels_1B.count", "8");
config->set_property("Channels.in_acquisition", "1");
config->set_property("Acquisition_1C0.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C0.threshold", "1");
config->set_property("Acquisition_1C0.doppler_max", "5000");
config->set_property("Acquisition_1C1.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C1.threshold", "1");
config->set_property("Acquisition_1C1.doppler_max", "5000");
config->set_property("Acquisition_1C2.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C2.threshold", "1");
config->set_property("Acquisition_1C2.doppler_max", "5000");
config->set_property("Acquisition_1C3.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C3.threshold", "1");
config->set_property("Acquisition_1C3.doppler_max", "5000");
config->set_property("Acquisition_1C4.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C4.threshold", "1");
config->set_property("Acquisition_1C4.doppler_max", "5000");
config->set_property("Acquisition_1C5.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C5.threshold", "1");
config->set_property("Acquisition_1C5.doppler_max", "5000");
config->set_property("Acquisition_1C6.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C6.threshold", "1");
config->set_property("Acquisition_1C6.doppler_max", "5000");
config->set_property("Acquisition_1C7.implementation", "GPS_L1_CA_PCPS_Acquisition");
config->set_property("Acquisition_1C7.threshold", "1");
config->set_property("Acquisition_1C7.doppler_max", "5000");
config->set_property("Acquisition_1B8.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B8.threshold", "1");
config->set_property("Acquisition_1B8.doppler_max", "5000");
config->set_property("Acquisition_1B9.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B9.threshold", "1");
config->set_property("Acquisition_1B9.doppler_max", "5000");
config->set_property("Acquisition_1B10.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B10.threshold", "1");
config->set_property("Acquisition_1B10.doppler_max", "5000");
config->set_property("Acquisition_1B11.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B11.threshold", "1");
config->set_property("Acquisition_1B11.doppler_max", "5000");
config->set_property("Acquisition_1B12.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B12.threshold", "1");
config->set_property("Acquisition_1B12.doppler_max", "5000");
config->set_property("Acquisition_1B13.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B13.threshold", "1");
config->set_property("Acquisition_1B13.doppler_max", "5000");
config->set_property("Acquisition_1B14.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B14.threshold", "1");
config->set_property("Acquisition_1B14.doppler_max", "5000");
config->set_property("Acquisition_1B15.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
config->set_property("Acquisition_1B15.threshold", "1");
config->set_property("Acquisition_1B15.doppler_max", "5000");
config->set_property("Tracking_1C0.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C1.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C2.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C3.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C4.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C5.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C6.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C7.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1B8.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B9.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B10.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B11.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B12.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B13.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B14.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("Tracking_1B15.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
config->set_property("TelemetryDecoder_1C0.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C1.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C2.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C3.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C4.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C5.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C6.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1C7.implementation", "GPS_L1_CA_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B8.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B9.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B10.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B11.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B12.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B13.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B14.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("TelemetryDecoder_1B15.implementation", "Galileo_E1B_Telemetry_Decoder");
config->set_property("Observables.implementation", "Hybrid_Observables");
2017-07-12 19:25:15 +00:00
config->set_property("PVT.implementation", "RTKLIB_PVT");
2015-07-20 20:11:15 +00:00
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
2015-07-20 20:11:15 +00:00
EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected());
EXPECT_NO_THROW(flowgraph->start());
EXPECT_TRUE(flowgraph->running());
flowgraph->stop();
EXPECT_FALSE(flowgraph->running());
}