1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Merge branch 'rinex_fix' of https://github.com/gnss-sdr/gnss-sdr into rinex_fix

This commit is contained in:
Carles Fernandez 2017-02-02 20:40:37 +01:00
commit 94514bbe19
12 changed files with 411 additions and 171 deletions

View File

@ -234,6 +234,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/tests/unit-tests/signal-processing-blocks/libs
${CMAKE_SOURCE_DIR}/src/tests/common-files
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}

View File

@ -0,0 +1,48 @@
/*!
* \file signal_generator_flags.h
* \brief Helper file for unit testing
* \author Carles Fernandez-Prades, 2017. cfernandez(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_SIGNAL_GENERATOR_FLAGS_H_
#define GNSS_SDR_SIGNAL_GENERATOR_FLAGS_H_
#include <gflags/gflags.h>
DEFINE_string(generator_binary, std::string(SW_GENERATOR_BIN), "Path of software-defined signal generator binary");
DEFINE_string(rinex_nav_file, std::string(DEFAULT_RINEX_NAV), "Input RINEX navigation file");
DEFINE_int32(duration, 100, "Duration of the experiment [in seconds, max = 300]");
DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver position [log,lat,height]");
DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format");
DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file");
DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file");
DEFINE_int32(fs_gen_hz, 2600000, "Samppling frequency [Hz]");
DEFINE_int32(test_satellite_PRN, 1, "PRN of the satellite under test (must be visible during the observation time)");
#endif

View File

@ -50,15 +50,16 @@
#include "concurrent_queue.h"
#include "control_thread.h"
#include "in_memory_configuration.h"
#include "signal_generator_flags.h"
DEFINE_string(generator_binary, std::string(SW_GENERATOR_BIN), "Path of software-defined signal generator binary");
DEFINE_string(rinex_nav_file, std::string(DEFAULT_RINEX_NAV), "Input RINEX navigation file");
DEFINE_int32(duration, 100, "Duration of the experiment [in seconds, max = 300]");
DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver position [log,lat,height]");
DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format");
DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file");
DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file");
DECLARE_string(generator_binary);
DECLARE_string(rinex_nav_file);
DECLARE_int32(duration);
DECLARE_string(static_position);
DECLARE_string(dynamic_position);
DECLARE_string(filename_rinex_obs);
DECLARE_string(filename_raw_data);
// For GPS NAVIGATION (L1)
concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
@ -237,11 +238,14 @@ int Obs_Gps_L1_System_Test::configure_receiver()
// Set the Signal Conditioner
config->set_property("SignalConditioner.implementation", "Signal_Conditioner");
config->set_property("DataTypeAdapter.implementation", "Ibyte_To_Complex");
//config->set_property("DataTypeAdapter.implementation", "Ibyte_To_Complex");
config->set_property("DataTypeAdapter.implementation", "Ibyte_To_Cshort");
config->set_property("InputFilter.implementation", "Fir_Filter");
config->set_property("InputFilter.dump", "false");
config->set_property("InputFilter.input_item_type", "gr_complex");
config->set_property("InputFilter.output_item_type", "gr_complex");
//config->set_property("InputFilter.input_item_type", "gr_complex");
//config->set_property("InputFilter.output_item_type", "gr_complex");
config->set_property("InputFilter.input_item_type", "cshort");
config->set_property("InputFilter.output_item_type", "cshort");
config->set_property("InputFilter.taps_item_type", "float");
config->set_property("InputFilter.number_of_taps", std::to_string(number_of_taps));
config->set_property("InputFilter.number_of_bands", std::to_string(number_of_bands));
@ -261,7 +265,8 @@ int Obs_Gps_L1_System_Test::configure_receiver()
config->set_property("InputFilter.IF", std::to_string(zero));
config->set_property("Resampler.implementation", "Pass_Through");
config->set_property("Resampler.dump", "false");
config->set_property("Resampler.item_type", "gr_complex");
//config->set_property("Resampler.item_type", "gr_complex");
config->set_property("Resampler.item_type", "cshort");
config->set_property("Resampler.sample_freq_in", std::to_string(sampling_rate_internal));
config->set_property("Resampler.sample_freq_out", std::to_string(sampling_rate_internal));
@ -271,8 +276,10 @@ int Obs_Gps_L1_System_Test::configure_receiver()
config->set_property("Channel.signal", "1C");
// Set Acquisition
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Tong_Acquisition");
config->set_property("Acquisition_1C.item_type", "gr_complex");
//config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Tong_Acquisition");
config->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
//config->set_property("Acquisition_1C.item_type", "gr_complex");
config->set_property("Acquisition_1C.item_type", "cshort");
config->set_property("Acquisition_1C.if", std::to_string(zero));
config->set_property("Acquisition_1C.coherent_integration_time_ms", std::to_string(coherent_integration_time_ms));
config->set_property("Acquisition_1C.threshold", std::to_string(threshold));
@ -285,9 +292,10 @@ int Obs_Gps_L1_System_Test::configure_receiver()
config->set_property("Acquisition_1C.tong_max_dwells", std::to_string(tong_max_dwells));
// Set Tracking
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
//config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
config->set_property("Tracking_1C.item_type", "gr_complex");
//config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
config->set_property("Tracking_1C.implementation", "GPS_L1_CA_DLL_PLL_C_Aid_Tracking");
//config->set_property("Tracking_1C.item_type", "gr_complex");
config->set_property("Tracking_1C.item_type", "cshort");
config->set_property("Tracking_1C.if", std::to_string(zero));
config->set_property("Tracking_1C.dump", "false");
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");

View File

@ -1,4 +1,4 @@
# Copyright (C) 2012-2015 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2017 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#

View File

@ -1,29 +1,60 @@
//
// Created by javier on 1/2/2017.
//
/*!
* \file tlm_dump_reader.cc
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "tlm_dump_reader.h"
bool tlm_dump_reader::read_binary_obs()
{
try {
try
{
d_dump_file.read((char *) &TOW_at_current_symbol, sizeof(double));
d_dump_file.read((char *) &Prn_timestamp_ms, sizeof(double));
d_dump_file.read((char *) &d_TOW_at_Preamble, sizeof(double));
}
catch (const std::ifstream::failure &e) {
catch (const std::ifstream::failure &e)
{
return false;
}
return true;
}
bool tlm_dump_reader::restart() {
bool tlm_dump_reader::restart()
{
if (d_dump_file.is_open())
{
d_dump_file.clear();
d_dump_file.seekg(0, std::ios::beg);
return true;
}else{
}
else
{
return false;
}
}
@ -39,12 +70,15 @@ long int tlm_dump_reader::num_epochs()
size = tmpfile.tellg();
long int nepoch=size / epoch_size_bytes;
return nepoch;
}else{
}
else
{
return 0;
}
}
bool tlm_dump_reader::open_obs_file(std::string out_file) {
bool tlm_dump_reader::open_obs_file(std::string out_file)
{
if (d_dump_file.is_open() == false)
{
try
@ -60,12 +94,15 @@ bool tlm_dump_reader::open_obs_file(std::string out_file) {
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str()<< std::endl;
return false;
}
}else{
}
else
{
return false;
}
}
tlm_dump_reader::~tlm_dump_reader() {
tlm_dump_reader::~tlm_dump_reader()
{
if (d_dump_file.is_open() == true)
{
d_dump_file.close();

View File

@ -1,9 +1,35 @@
//
// Created by javier on 23/1/2017.
//
/*!
* \file tlm_dump_reader.h
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SIM_tlm_dump_reader_H
#define GNSS_SIM_tlm_dump_reader_H
#ifndef GNSS_SDR_tlm_dump_reader_H
#define GNSS_SDR_tlm_dump_reader_H
#include <iostream>
#include <fstream>
@ -31,4 +57,4 @@ private:
};
#endif //GNSS_SIM_tlm_dump_reader_H
#endif //GNSS_SDR_tlm_dump_reader_H

View File

@ -1,6 +1,32 @@
//
// Created by javier on 1/2/2017.
//
/*!
* \file tracking_dump_reader.cc
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "tracking_dump_reader.h"
@ -28,19 +54,23 @@ bool tracking_dump_reader::read_binary_obs()
d_dump_file.read((char *) &aux2, sizeof(double));
}
catch (const std::ifstream::failure &e) {
catch (const std::ifstream::failure &e)
{
return false;
}
return true;
}
bool tracking_dump_reader::restart() {
bool tracking_dump_reader::restart()
{
if (d_dump_file.is_open())
{
d_dump_file.clear();
d_dump_file.seekg(0, std::ios::beg);
return true;
}else{
}
else
{
return false;
}
}
@ -59,12 +89,15 @@ long int tracking_dump_reader::num_epochs()
size = tmpfile.tellg();
long int nepoch = size / epoch_size_bytes;
return nepoch;
}else{
}
else
{
return 0;
}
}
bool tracking_dump_reader::open_obs_file(std::string out_file) {
bool tracking_dump_reader::open_obs_file(std::string out_file)
{
if (d_dump_file.is_open() == false)
{
try
@ -85,7 +118,8 @@ bool tracking_dump_reader::open_obs_file(std::string out_file) {
}
}
tracking_dump_reader::~tracking_dump_reader() {
tracking_dump_reader::~tracking_dump_reader()
{
if (d_dump_file.is_open() == true)
{
d_dump_file.close();

View File

@ -1,9 +1,35 @@
//
// Created by javier on 23/1/2017.
//
/*!
* \file tracking_dump_reader.h
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SIM_tracking_dump_reader_H
#define GNSS_SIM_tracking_dump_reader_H
#ifndef GNSS_SDR_tracking_dump_reader_H
#define GNSS_SDR_tracking_dump_reader_H
#include <iostream>
#include <fstream>
@ -60,4 +86,4 @@ private:
};
#endif //GNSS_SIM_tracking_dump_reader_H
#endif //GNSS_SDR_tracking_dump_reader_H

View File

@ -1,31 +1,62 @@
//
// Created by javier on 1/2/2017.
//
/*!
* \file tracking_true_obs_reader.cc
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "tracking_true_obs_reader.h"
bool tracking_true_obs_reader::read_binary_obs()
{
try {
try
{
d_dump_file.read((char *) &signal_timestamp_s, sizeof(double));
d_dump_file.read((char *) &acc_carrier_phase_cycles, sizeof(double));
d_dump_file.read((char *) &doppler_l1_hz, sizeof(double));
d_dump_file.read((char *) &prn_delay_chips, sizeof(double));
d_dump_file.read((char *) &tow, sizeof(double));
}
catch (const std::ifstream::failure &e) {
catch (const std::ifstream::failure &e)
{
return false;
}
return true;
}
bool tracking_true_obs_reader::restart() {
bool tracking_true_obs_reader::restart()
{
if (d_dump_file.is_open())
{
d_dump_file.clear();
d_dump_file.seekg(0, std::ios::beg);
return true;
}else{
}
else
{
return false;
}
}
@ -41,12 +72,15 @@ long int tracking_true_obs_reader::num_epochs()
size = tmpfile.tellg();
long int nepoch = size / epoch_size_bytes;
return nepoch;
}else{
}
else
{
return 0;
}
}
bool tracking_true_obs_reader::open_obs_file(std::string out_file) {
bool tracking_true_obs_reader::open_obs_file(std::string out_file)
{
if (d_dump_file.is_open() == false)
{
try
@ -62,12 +96,15 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file) {
std::cout << "Problem opening Observables dump Log file: " << d_dump_filename.c_str() << std::endl;
return false;
}
}else{
}
else
{
return false;
}
}
tracking_true_obs_reader::~tracking_true_obs_reader() {
tracking_true_obs_reader::~tracking_true_obs_reader()
{
if (d_dump_file.is_open() == true)
{
d_dump_file.close();

View File

@ -1,9 +1,35 @@
//
// Created by javier on 23/1/2017.
//
/*!
* \file tracking_true_obs_reader.h
* \brief Helper file for unit testing
* \author Javier Arribas, 2017. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2017 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SIM_tracking_true_obs_reader_H
#define GNSS_SIM_tracking_true_obs_reader_H
#ifndef GNSS_SDR_tracking_true_obs_reader_H
#define GNSS_SDR_tracking_true_obs_reader_H
#include <iostream>
#include <fstream>
@ -33,4 +59,4 @@ private:
};
#endif //GNSS_SIM_tracking_true_obs_reader_H
#endif //GNSS_SDR_tracking_true_obs_reader_H

View File

@ -49,7 +49,6 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/skiphead.h>
#include <gtest/gtest.h>
#include "GPS_L1_CA.h"
#include "gnss_block_factory.h"
#include "gnss_block_interface.h"
@ -58,24 +57,22 @@
#include "in_memory_configuration.h"
#include "gnss_synchro.h"
#include "gps_l1_ca_telemetry_decoder.h"
#include "../libs/tracking_true_obs_reader.h"
#include "../libs/tracking_dump_reader.h"
#include "../libs/tlm_dump_reader.h"
#include "tracking_true_obs_reader.h"
#include "tracking_dump_reader.h"
#include "tlm_dump_reader.h"
#include "gps_l1_ca_dll_pll_tracking.h"
#include "gps_l1_ca_dll_pll_c_aid_tracking.h"
#include "signal_generator_flags.h"
DEFINE_string(generator_binary, std::string(SW_GENERATOR_BIN), "Path of software-defined signal generator binary");
DEFINE_string(rinex_nav_file, std::string(DEFAULT_RINEX_NAV), "Input RINEX navigation file");
DEFINE_int32(duration, 20, "Duration of the experiment [in seconds]");
DEFINE_int32(fs_gen_hz, 2600000, "Samppling frequency [Hz]");
DEFINE_string(static_position, "30.286502,120.032669,100", "Static receiver position [log,lat,height]");
DEFINE_string(dynamic_position, "", "Observer positions file, in .csv or .nmea format");
DEFINE_string(filename_rinex_obs, "sim.16o", "Filename of output RINEX navigation file");
DEFINE_string(filename_raw_data, "signal_out.bin", "Filename of output raw data file");
DEFINE_int32(test_satellite_PRN,1, "PRN of the satellite under test (must be visible during the observation time)");
DECLARE_string(generator_binary);
DECLARE_string(rinex_nav_file);
DECLARE_int32(duration); // 20
DECLARE_int32(fs_gen_hz);
DECLARE_string(static_position);
DECLARE_string(dynamic_position);
DECLARE_string(filename_rinex_obs);
DECLARE_string(filename_raw_data);
DECLARE_int32(test_satellite_PRN);
// ######## GNURADIO BLOCK MESSAGE RECEVER FOR TRACKING MESSAGES #########
class GpsL1CADllPllTelemetryDecoderTest_msg_rx;

View File

@ -181,7 +181,7 @@ TEST_F(GpsL2MDllPllTrackingTest, ValidationOfResults)
ASSERT_NO_THROW( {
//gr::analog::sig_source_c::sptr source = gr::analog::sig_source_c::make(fs_in, gr::analog::GR_SIN_WAVE, 1000, 1, gr_complex(0));
std::string path = std::string(TEST_PATH);
std::string file = path + "/data/gps_l2c_m_prn7_5msps.dat";
std::string file = path + "signal_samples/gps_l2c_m_prn7_5msps.dat";
const char * file_name = file.c_str();
gr::blocks::file_source::sptr file_source = gr::blocks::file_source::make(sizeof(gr_complex), file_name, false);
boost::shared_ptr<gr::block> valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue);