diff --git a/.gitignore b/.gitignore index cbccacdac..a128f1558 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,7 @@ thirdparty/ .settings .project .cproject +.idea +cmake-build-debug/ /install .DS_Store diff --git a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf index 51f5b0096..a7b6f6551 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_ibyte.conf @@ -61,7 +61,7 @@ Tracking_1G.dump=true; Tracking_1G.dump_filename=/archive/glo_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ -TelemetryDecoder_1G.implementation=GLONASS_L1_CA_Telemetry_Decoder +TelemetryDecoder_1G.implementation=GPS_L1_CA_Telemetry_Decoder ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables diff --git a/conf/gnss-sdr_GLONASS_L1_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_ibyte.conf deleted file mode 100644 index 0b16fa3d8..000000000 --- a/conf/gnss-sdr_GLONASS_L1_ibyte.conf +++ /dev/null @@ -1,103 +0,0 @@ -; You can define your own receiver and invoke it by doing -; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf -; - -[GNSS-SDR] - -;######### GLOBAL OPTIONS ################## -;internal_fs_hz: Internal signal sampling frequency after the signal conditioning stage [Hz]. -GNSS-SDR.internal_fs_hz=6625000 - -;######### CONTROL_THREAD CONFIG ############ -ControlThread.wait_for_flowgraph=false - -;######### SIGNAL_SOURCE CONFIG ############ -SignalSource.implementation=File_Signal_Source -SignalSource.filename=/home/dmiralles/Documents/GSOC/GSOC2017/gnss-sdr/data/dmirallesNT1065_L2_20160831_fs6625e6_60e3_schar_1H.bin -SignalSource.item_type=ibyte -SignalSource.sampling_frequency=6625000 -SignalSource.freq=1602000000 -SignalSource.samples=0 -SignalSource.repeat=false -SignalSource.sample_type=iq -SignalSource.seconds_to_skip=0 -SignalSource.dump=false -SignalSource.dump_filename=../data/signal_source.dat -SignalSource.enable_throttle_control=false - - -;######### SIGNAL_CONDITIONER CONFIG ############ -SignalConditioner.implementation=Signal_Conditioner - -;DataTypeAdapter.implementation=Ishort_To_Complex -DataTypeAdapter.implementation=Ibyte_To_Complex -InputFilter.implementation=Pass_Through -;InputFilter.input_item_type=gr_complex -;InputFilter.output_item_type=gr_complex -InputFilter.item_type=gr_complex -;Resampler.implementation=Pass_Through -;Resampler.item_type=gr_complex -Resampler.implementation=Pass_Through -;Resampler.sample_freq_in=4000000 -;Resampler.sample_freq_out=2000000 -;Resampler.item_type=gr_complex -Resampler.item_type=gr_complex - -;######### CHANNELS GLOBAL CONFIG ############ -Channels_1R.count=8 ;Assuming here that identifier `1r=R` defines GLONASS SP signals -Channels.in_acquisition=1 -Channel.signal=1R -;Channel.item_type=cshort - - -;######### ACQUISITION GLOBAL CONFIG ############ -Acquisition_1R.dump=false -Acquisition_1R.dump_filename=./acq_dump.dat -Acquisition_1R.item_type=cshort -Acquisition_1R.if=0 -Acquisition_1R.sampled_ms=1 -Acquisition_1R.implementation=GLONASS_L1_CA_PCPS_Acquisition -Acquisition_1R.threshold=0.008 -;Acquisition_1C.pfa=0.000001 -Acquisition_1R.doppler_max=10000 -Acquisition_1R.doppler_step=250 -Acquisition_1R.tong_init_val=2 -Acquisition_1R.tong_max_val=10 -Acquisition_1R.tong_max_dwells=20 - -;######### TRACKING GLOBAL CONFIG ############ -Tracking_1R.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking -Tracking_1R.item_type=cshort -Tracking_1R.if=0 -Tracking_1R.dump=false -Tracking_1R.dump_filename=../data/epl_tracking_ch_ -Tracking_1R.pll_bw_hz=40.0; -Tracking_1R.dll_bw_hz=4.0; -Tracking_1R.order=3; - -;######### TELEMETRY DECODER GPS CONFIG ############ -TelemetryDecoder_1R.implementation=GLONASS_L1_CA_Telemetry_Decoder -TelemetryDecoder_1R.dump=false -TelemetryDecoder_1R.decimation_factor=1; - -;######### OBSERVABLES CONFIG ############ -Observables.implementation=Hybrid_Observables -Observables.dump=false -Observables.dump_filename=./observables.dat - - -;######### PVT CONFIG ############ -PVT.implementation=RTKLIB_PVT -PVT.positioning_mode=PPP_Static ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX -PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad -PVT.output_rate_ms=100 -PVT.display_rate_ms=500 -PVT.dump_filename=./PVT -PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; -PVT.flag_nmea_tty_port=false; -PVT.nmea_dump_devname=/dev/pts/4 -PVT.flag_rtcm_server=false -PVT.flag_rtcm_tty_port=false -PVT.rtcm_dump_devname=/dev/pts/1 -PVT.dump=false diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc index cd314a342..6911cc958 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc @@ -194,8 +194,8 @@ bool pcps_acquisition_cc::is_fdma() // Dealing with FDMA system if( strcmp(d_gnss_synchro->Signal,"1G") == 0 ) { - d_freq += DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN); - LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << DFRQ1_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN) << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; + d_freq += d_old_freq * GLONASS_PRN.at(d_gnss_synchro->PRN); + LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_old_freq * GLONASS_PRN.at(d_gnss_synchro->PRN) << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl; return true; } else diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 4529a1fba..6fae5b7b4 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -735,19 +735,19 @@ void GNSSFlowgraph::set_signals_list() } } - if (configuration_->property("Channels_1G.count", 0) > 0 ) - { - /* - * Loop to create the list of GLONASS L1 C/A signals - */ - for (available_gnss_prn_iter = available_glonass_prn.begin(); - available_gnss_prn_iter != available_glonass_prn.end(); - available_gnss_prn_iter++) - { - available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Glonass"), - *available_gnss_prn_iter), std::string("1G"))); - } - } + if (configuration_->property("Channels_1G.count", 0) > 0 ) + { + /* + * Loop to create the list of GLONASS L1 C/A signals + */ + for (available_gnss_prn_iter = available_glonass_prn.begin(); + available_gnss_prn_iter != available_glonass_prn.end(); + available_gnss_prn_iter++) + { + available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("Glonass"), + *available_gnss_prn_iter), std::string("1G"))); + } + } /* * Ordering the list of signals from configuration file */ diff --git a/src/utils/matlab/glonass_l1_ca_dll_pll_plot_sample.m b/src/utils/matlab/glonass_ca_dll_pll_plot_sample.m similarity index 89% rename from src/utils/matlab/glonass_l1_ca_dll_pll_plot_sample.m rename to src/utils/matlab/glonass_ca_dll_pll_plot_sample.m index 18965a31d..2e2c9b070 100644 --- a/src/utils/matlab/glonass_l1_ca_dll_pll_plot_sample.m +++ b/src/utils/matlab/glonass_ca_dll_pll_plot_sample.m @@ -1,5 +1,5 @@ % /*! -% * \file glonass_l1_ca_dll_pll_plot_sample.m +% * \file glonass_ca_dll_pll_plot_sample.m % * \brief Read GNSS-SDR Tracking dump binary file using the provided % function and plot some internal variables % * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com @@ -30,7 +30,7 @@ close all; clear all; -if ~exist('glonass_l1_ca_dll_pll_read_tracking_dump.m','file') +if ~exist('glonass_ca_dll_pll_read_tracking_dump.m','file') addpath('./libs') end @@ -43,7 +43,7 @@ path = '/archive/'; %% CHANGE THIS PATH for N=1:1:channels tracking_log_path = [path 'glo_tracking_ch_' num2str(N+first_channel-1) '.dat']; %% CHANGE epl_tracking_ch_ BY YOUR dump_filename - GNSS_tracking(N)= gps_l1_ca_dll_pll_read_tracking_dump(tracking_log_path); + GNSS_tracking(N)= glonass_ca_dll_pll_read_tracking_dump(tracking_log_path); end % GNSS-SDR format conversion to MATLAB GPS receiver @@ -69,5 +69,5 @@ for N=1:1:channels % Use original MATLAB tracking plot function settings.numberOfChannels = channels; settings.msToProcess = length(GNSS_tracking(N).E); - plotTracking(N,trackResults,settings) + plotTracking(N,trackResults,settings); end diff --git a/src/utils/matlab/libs/glonass_ca_dll_pll_read_tracking_dump.m b/src/utils/matlab/libs/glonass_ca_dll_pll_read_tracking_dump.m new file mode 100644 index 000000000..098ee11f7 --- /dev/null +++ b/src/utils/matlab/libs/glonass_ca_dll_pll_read_tracking_dump.m @@ -0,0 +1,191 @@ +% /*! +% * \file glonass_ca_dll_pll_read_tracking_dump.m +% * \brief Read GNSS-SDR Tracking dump binary file into MATLAB. +% * \author Damian Miralles, 2017. dmiralles2009(at)gmail.com +% * ------------------------------------------------------------------------- +% * +% * Copyright (C) 2010-2011 (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 . +% * +% * ------------------------------------------------------------------------- +% */ +function [GNSS_tracking] = glonass_ca_dll_pll_read_tracking_dump (filename, count) + + %% usage: gps_l1_ca_dll_pll_read_tracking_dump_64bits (filename, [count]) + %% + %% open GNSS-SDR tracking binary log file .dat and return the contents + %% + + narginchk (1,2); + num_float_vars=5; + num_unsigned_long_int_vars=1; + num_double_vars=11; + num_unsigned_int_vars=1; + double_size_bytes=8; + unsigned_long_int_size_bytes=8; + float_size_bytes=4; + long_int_size_bytes=4; + + skip_bytes_each_read=float_size_bytes*num_float_vars+unsigned_long_int_size_bytes*num_unsigned_long_int_vars+double_size_bytes*num_double_vars+long_int_size_bytes*num_unsigned_int_vars; + bytes_shift=0; + + if (nargin < 2) + %count = Inf; + file_stats = dir(filename); + %round num bytes to read to integer number of samples (to protect the script from binary + %dump end file transitory) + count = (file_stats.bytes - mod(file_stats.bytes,skip_bytes_each_read))/skip_bytes_each_read; + end + %loops_counter = fread (f, count, 'uint32',4*12); + f = fopen (filename, 'rb'); + if (f < 0) + else + v1 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); + bytes_shift=bytes_shift+float_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved float + v2 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); + bytes_shift=bytes_shift+float_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved float + v3 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); + bytes_shift=bytes_shift+float_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved float + v4 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); + bytes_shift=bytes_shift+float_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved float + v5 = fread (f, count, 'float',skip_bytes_each_read-float_size_bytes); + bytes_shift=bytes_shift+float_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved unsigned_long_int + v6 = fread (f, count, 'uint64',skip_bytes_each_read-unsigned_long_int_size_bytes); + bytes_shift=bytes_shift+unsigned_long_int_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v7 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v8 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v9 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v10 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v11 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v12 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v13 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v14 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v15 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v16 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v17 = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes); + bytes_shift=bytes_shift+double_size_bytes; + fseek(f,bytes_shift,'bof'); % move to next interleaved double + v18 = fread (f, count, 'uint32',skip_bytes_each_read-double_size_bytes); + fclose (f); + + %%%%%%%% output vars %%%%%%%% + +% // EPR +% d_dump_file.write(reinterpret_cast(&tmp_E), sizeof(float)); +% d_dump_file.write(reinterpret_cast(&tmp_P), sizeof(float)); +% d_dump_file.write(reinterpret_cast(&tmp_L), sizeof(float)); +% // PROMPT I and Q (to analyze navigation symbols) +% d_dump_file.write(reinterpret_cast(&prompt_I), sizeof(float)); +% d_dump_file.write(reinterpret_cast(&prompt_Q), sizeof(float)); +% // PRN start sample stamp +% //tmp_float=(float)d_sample_counter; +% d_dump_file.write(reinterpret_cast(&d_sample_counter), sizeof(unsigned long int)); +% // accumulated carrier phase +% d_dump_file.write(reinterpret_cast(&d_acc_carrier_phase_rad), sizeof(double)); +% +% // carrier and code frequency +% d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); +% d_dump_file.write(reinterpret_cast(&d_code_freq_chips), sizeof(double)); +% +% //PLL commands +% d_dump_file.write(reinterpret_cast(&carr_phase_error_secs_Ti), sizeof(double)); +% d_dump_file.write(reinterpret_cast(&d_carrier_doppler_hz), sizeof(double)); +% +% //DLL commands +% d_dump_file.write(reinterpret_cast(&code_error_chips_Ti), sizeof(double)); +% d_dump_file.write(reinterpret_cast(&code_error_filt_chips), sizeof(double)); +% +% // CN0 and carrier lock test +% d_dump_file.write(reinterpret_cast(&d_CN0_SNV_dB_Hz), sizeof(double)); +% d_dump_file.write(reinterpret_cast(&d_carrier_lock_test), sizeof(double)); +% +% // AUX vars (for debug purposes) +% tmp_double = d_rem_code_phase_samples; +% d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); +% tmp_double = static_cast(d_sample_counter + d_current_prn_length_samples); +% d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); +% // PRN +% unsigned int prn_ = d_acquisition_gnss_synchro->PRN; +% d_dump_file.write(reinterpret_cast(&prn_), sizeof(unsigned int)); + E=v1; + P=v2; + L=v3; + prompt_I=v4; + prompt_Q=v5; + PRN_start_sample=v6; + acc_carrier_phase_rad=v7; + carrier_doppler_hz=v8; + code_freq_hz=v9; + carr_error=v10; + carr_nco=v11; + code_error=v12; + code_nco=v13; + CN0_SNV_dB_Hz=v14; + carrier_lock_test=v15; + var1=v16; + var2=v17; + PRN=v18; + + GNSS_tracking.E=E; + GNSS_tracking.P=P; + GNSS_tracking.L=L; + GNSS_tracking.prompt_I=prompt_I; + GNSS_tracking.prompt_Q=prompt_Q; + GNSS_tracking.PRN_start_sample=PRN_start_sample; + GNSS_tracking.acc_carrier_phase_rad=acc_carrier_phase_rad; + GNSS_tracking.carrier_doppler_hz=carrier_doppler_hz; + GNSS_tracking.code_freq_hz=code_freq_hz; + GNSS_tracking.carr_error=carr_error; + GNSS_tracking.carr_nco=carr_nco; + GNSS_tracking.code_error=code_error; + GNSS_tracking.code_nco=code_nco; + GNSS_tracking.CN0_SNV_dB_Hz=CN0_SNV_dB_Hz; + GNSS_tracking.carrier_lock_test=carrier_lock_test; + GNSS_tracking.d_rem_code_phase_samples=var1; + GNSS_tracking.var2=var2; + GNSS_tracking.PRN=PRN; + end +