From 410269069a4a8a62c0d8449fe0ed037497a1e406 Mon Sep 17 00:00:00 2001 From: Damian Miralles Date: Sun, 14 Jul 2019 20:09:52 -0500 Subject: [PATCH] bds: Bug fixes in carrier wavelength computation Changed wavelength computation to native method within RTKLIb. The native method should also help in the PVT computation of GLONASS satellites as it considers the freq. offset when computing the wavelength. This also fixes typo in tracking stage for MEO satellites of the BDS constellation. Note: A similar approach to carrier wavelength computation should be applied to the obs_data in rtk_solver. In theory, static allocation should not be needed for the types. --- conf/gnss-sdr_BDS_B1I_GPS_L1_CA_byte.conf | 274 ------------------ conf/gnss-sdr_BDS_B1I_byte.conf | 11 +- conf/gnss-sdr_BDS_B3I_byte.conf | 4 +- src/algorithms/PVT/libs/rtklib_solver.cc | 25 +- src/algorithms/libs/rtklib/rtklib_pntpos.cc | 7 +- .../beidou_b1i_telemetry_decoder_gs.cc | 2 +- .../gnuradio_blocks/dll_pll_veml_tracking.cc | 4 +- 7 files changed, 21 insertions(+), 306 deletions(-) delete mode 100644 conf/gnss-sdr_BDS_B1I_GPS_L1_CA_byte.conf diff --git a/conf/gnss-sdr_BDS_B1I_GPS_L1_CA_byte.conf b/conf/gnss-sdr_BDS_B1I_GPS_L1_CA_byte.conf deleted file mode 100644 index a3c320c93..000000000 --- a/conf/gnss-sdr_BDS_B1I_GPS_L1_CA_byte.conf +++ /dev/null @@ -1,274 +0,0 @@ -; This is a GNSS-SDR configuration file -; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/ - -; 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_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. -GNSS-SDR.internal_fs_sps=25000000 -Receiver.sources_count=2 - -;######### CONTROL_THREAD CONFIG ############ -ControlThread.wait_for_flowgraph=false - -;######### SIGNAL_SOURCE CONFIG ############ -;# Signal Source config for GPS, Galileo signals -SignalSource0.implementation=File_Signal_Source -SignalSource0.filename=/home/dmiralles/Documents/GNSS-Metadata-Standard/install/GPSL1-GalileoE1.dat -SignalSource0.item_type=byte -SignalSource0.sampling_frequency=25000000 -SignalSource0.samples=0 -SignalSource0.repeat=false -SignalSource0.dump=false -SignalSource0.enable_throttle_control=false - -;# Signal Source config for BDS signals -SignalSource1.implementation=File_Signal_Source -SignalSource1.filename=/home/dmiralles/Documents/GNSS-Metadata-Standard/install/BdsB1IStr01.dat -SignalSource1.item_type=byte -SignalSource1.sampling_frequency=25000000 -SignalSource1.samples=0 -SignalSource1.repeat=false -SignalSource1.dump=false -SignalSource1.enable_throttle_control=false - -;######### SIGNAL_CONDITIONER CONFIG ############ -;# Signal Conditioner config for GPS, Galileo signals -SignalConditioner0.implementation=Signal_Conditioner -DataTypeAdapter0.implementation=Byte_To_Short -InputFilter0.implementation=Freq_Xlating_Fir_Filter -InputFilter0.input_item_type=short -InputFilter0.output_item_type=gr_complex -InputFilter0.taps_item_type=float -InputFilter0.number_of_taps=5 -InputFilter0.number_of_bands=2 -InputFilter0.band1_begin=0.0 -InputFilter0.band1_end=0.70 -InputFilter0.band2_begin=0.80 -InputFilter0.band2_end=1.0 -InputFilter0.ampl1_begin=1.0 -InputFilter0.ampl1_end=1.0 -InputFilter0.ampl2_begin=0.0 -InputFilter0.ampl2_end=0.0 -InputFilter0.band1_error=1.0 -InputFilter0.band2_error=1.0 -InputFilter0.filter_type=bandpass -InputFilter0.grid_density=16 -InputFilter0.sampling_frequency=25000000 -InputFilter0.IF=6250000 -Resampler0.implementation=Pass_Through -Resampler0.sample_freq_in=25000000 -Resampler0.sample_freq_out=25000000 -Resampler0.item_type=gr_complex - -;# Signal Conditioner config for BDS signals -SignalConditioner1.implementation=Signal_Conditioner -DataTypeAdapter1.implementation=Byte_To_Short -InputFilter1.implementation=Freq_Xlating_Fir_Filter -InputFilter1.input_item_type=short -InputFilter1.output_item_type=gr_complex -InputFilter1.taps_item_type=float -InputFilter1.number_of_taps=5 -InputFilter1.number_of_bands=2 -InputFilter1.band1_begin=0.0 -InputFilter1.band1_end=0.70 -InputFilter1.band2_begin=0.80 -InputFilter1.band2_end=1.0 -InputFilter1.ampl1_begin=1.0 -InputFilter1.ampl1_end=1.0 -InputFilter1.ampl2_begin=0.0 -InputFilter1.ampl2_end=0.0 -InputFilter1.band1_error=1.0 -InputFilter1.band2_error=1.0 -InputFilter1.filter_type=bandpass -InputFilter1.grid_density=16 -InputFilter1.sampling_frequency=25000000 -InputFilter1.IF=6250000 -Resampler1.implementation=Pass_Through -Resampler1.sample_freq_in=25000000 -Resampler1.sample_freq_out=25000000 -Resampler1.item_type=gr_complex - -;######### CHANNELS GLOBAL CONFIG ############ -Channels_1C.count=7 -Channels_1B.count=7 -Channels_B1.count=10 -Channels.in_acquisition=10 - -;# Preparing collection for GPS satellites -Channel0.RF_channel_ID=0 -Channel1.RF_channel_ID=0 -Channel2.RF_channel_ID=0 -Channel3.RF_channel_ID=0 -Channel4.RF_channel_ID=0 -Channel5.RF_channel_ID=0 -Channel6.RF_channel_ID=0 -Channel0.signal=1C -Channel0.satellite = 2 -Channel1.signal=1C -Channel1.satellite = 5 -Channel2.signal=1C -Channel2.satellite = 6 -Channel3.signal=1C -Channel3.satellite = 7 -Channel4.signal=1C -Channel4.satellite = 13 -Channel5.signal=1C -Channel5.satellite = 19 -Channel6.signal=1C -Channel6.satellite = 29 - -;# Preparing collection for Galileo satellites -Channel7.RF_channel_ID=0 -Channel8.RF_channel_ID=0 -Channel9.RF_channel_ID=0 -Channel10.RF_channel_ID=0 -Channel11.RF_channel_ID=0 -Channel12.RF_channel_ID=0 -Channel13.RF_channel_ID=0 -Channel7.signal=1B -Channel7.satellite = 2 -Channel8.signal=1B -Channel8.satellite = 5 -Channel9.signal=1B -Channel9.satellite = 6 -Channel10.signal=1B -Channel10.satellite = 7 -Channel11.signal=1B -Channel11.satellite = 13 -Channel12.signal=1B -Channel12.satellite = 19 -Channel13.signal=1B -Channel13.satellite = 29 - -;# Preparing collection for BDS satellites -Channel14.RF_channel_ID=1 -Channel15.RF_channel_ID=1 -Channel16.RF_channel_ID=1 -Channel17.RF_channel_ID=1 -Channel18.RF_channel_ID=1 -Channel19.RF_channel_ID=1 -Channel20.RF_channel_ID=1 -Channel21.RF_channel_ID=1 -Channel22.RF_channel_ID=1 -Channel23.RF_channel_ID=1 - -Channel14.signal=B1 -Channel14.satellite = 6 -Channel15.signal=B1 -Channel15.satellite = 8 -Channel16.signal=B1 -Channel16.satellite = 9 -Channel17.signal=B1 -Channel17.satellite = 13 -Channel18.signal=B1 -Channel18.satellite = 17 -Channel19.signal=B1 -Channel19.satellite = 1 -Channel20.signal=B1 -Channel20.satellite = 2 -Channel21.signal=B1 -Channel21.satellite = 3 -Channel22.signal=B1 -Channel22.satellite = 4 -Channel23.signal=B1 -Channel23.satellite = 5 - -;######### ACQUISITION GLOBAL CONFIG ############ -;# Acquisition config for BDS signals -Acquisition_B1.implementation=BEIDOU_B1I_PCPS_Acquisition -Acquisition_B1.item_type=gr_complex -Acquisition_B1.coherent_integration_time_ms=1 -Acquisition_B1.threshold=0.0038 -Acquisition_B1.doppler_max=15000 -Acquisition_B1.doppler_step=100 -Acquisition_B1.dump=true -Acquisition_B1.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/bds_b1i_acq -Acquisition_B1.blocking=false; -Acquisition_B1.use_CFAR_algorithm=true; -Acquisition_B1.bit_transition_flag = false; - -;# Acquisition config for GPS signals -Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition -Acquisition_1C.item_type=gr_complex -Acquisition_1C.coherent_integration_time_ms=1 -Acquisition_1C.threshold=0.0038 -Acquisition_1C.doppler_max=15000 -Acquisition_1C.doppler_step=100 -Acquisition_1C.dump=true -Acquisition_1C.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gps_l1ca_acq -Acquisition_1C.blocking=false; -Acquisition_1C.use_CFAR_algorithm=true; -Acquisition_1C.bit_transition_flag = false; - -;# Acquisition config for Galileo signals -Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition -Acquisition_1B.item_type=gr_complex -Acquisition_1B.coherent_integration_time_ms=4 -Acquisition_1B.threshold=0.0038 -Acquisition_1B.doppler_max=15000 -Acquisition_1B.doppler_step=100 -Acquisition_1B.dump=true -Acquisition_1B.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gal_e1b_acq -Acquisition_1B.blocking=false; -Acquisition_1B.use_CFAR_algorithm=true; -Acquisition_1B.bit_transition_flag = false; - -;######### TRACKING GLOBAL CONFIG ############ -Tracking_B1.implementation=BEIDOU_B1I_DLL_PLL_Tracking -Tracking_B1.item_type=gr_complex -Tracking_B1.pll_bw_hz=25.0; -Tracking_B1.dll_bw_hz=2.50; -Tracking_B1.dump=true; -Tracking_B1.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/bds_b1i_trk_ch_ - -Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -Tracking_1C.item_type=gr_complex -Tracking_1C.pll_bw_hz=25.0; -Tracking_1C.dll_bw_hz=2.50; -Tracking_1C.dump=true; -Tracking_1C.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gps_l1ca_trk_ch_ - -Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking -Tracking_1B.item_type=gr_complex -Tracking_1B.pll_bw_hz=25.0; -Tracking_1B.dll_bw_hz=2.50; -Tracking_1B.dump=true; -Tracking_1B.dump_filename=/home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/gal_e1b_trk_ch_ - -;######### TELEMETRY DECODER GPS CONFIG ############ -TelemetryDecoder_B1.implementation=BEIDOU_B1I_Telemetry_Decoder -TelemetryDecoder_B1.dump=false - -TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder -TelemetryDecoder_1C.dump=false - -TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder -TelemetryDecoder_1B.dump=false - -;######### OBSERVABLES CONFIG ############ -Observables.implementation=Hybrid_Observables -Observables.dump=true -Observables.dump_filename=./observables.dat - - -;######### PVT CONFIG ############ -PVT.implementation=RTKLIB_PVT -PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=OFF ; 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=true -PVT.dump_filename = /home/dmiralles/Documents/Research/Publications/INSIDE_GNSS/bds_leg_pvt/Data/pvt_l1 -PVT.kml_output_enabled = false; -PVT.xml_output_enabled = false; -PVT.gpx_output_enabled = false; -PVT.rinex_output_enabled = false; -PVT.rtcm_output_enabled = false; -PVT.nmea_output_enabled = false; -PVT.geojson_output_enabled = false; diff --git a/conf/gnss-sdr_BDS_B1I_byte.conf b/conf/gnss-sdr_BDS_B1I_byte.conf index 1f8dffee4..df8f889a3 100644 --- a/conf/gnss-sdr_BDS_B1I_byte.conf +++ b/conf/gnss-sdr_BDS_B1I_byte.conf @@ -91,25 +91,25 @@ Tracking_B1.implementation=BEIDOU_B1I_DLL_PLL_Tracking Tracking_B1.item_type=gr_complex Tracking_B1.pll_bw_hz=25.0; Tracking_B1.dll_bw_hz=2.50; -Tracking_B1.dump=true; +Tracking_B1.dump=false; Tracking_B1.dump_filename=./epl_tracking_ch_ ;######### TELEMETRY DECODER GPS CONFIG ############ TelemetryDecoder_B1.implementation=BEIDOU_B1I_Telemetry_Decoder -TelemetryDecoder_B1.dump=true +TelemetryDecoder_B1.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -Observables.dump=true +Observables.dump=false Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=OFF ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX +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 @@ -121,3 +121,6 @@ PVT.flag_rtcm_server=false PVT.flag_rtcm_tty_port=false PVT.rtcm_dump_devname=/dev/pts/1 PVT.dump=true +PVT.rinex_version=3 +PVT.rinex_output_enabled=true +PVT.gpx_output_enabled=true diff --git a/conf/gnss-sdr_BDS_B3I_byte.conf b/conf/gnss-sdr_BDS_B3I_byte.conf index a2c8b1e56..47986b2da 100644 --- a/conf/gnss-sdr_BDS_B3I_byte.conf +++ b/conf/gnss-sdr_BDS_B3I_byte.conf @@ -100,14 +100,14 @@ TelemetryDecoder_B3.dump=false ;######### OBSERVABLES CONFIG ############ Observables.implementation=Hybrid_Observables -Observables.dump=true +Observables.dump=false Observables.dump_filename=./observables.dat ;######### PVT CONFIG ############ PVT.implementation=RTKLIB_PVT PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic -PVT.iono_model=OFF ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX +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 diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 283584b7e..611628cf8 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -414,8 +414,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ int glo_valid_obs = 0; // GLONASS L1/L2 valid observations counter std::array obs_data{}; - std::array eph_data{}; - std::array geph_data{}; + std::vector eph_data(MAXOBS); + std::vector geph_data(MAXOBS); // Workaround for NAV/CNAV clash problem bool gps_dual_band = false; @@ -754,7 +754,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs], gnss_observables_iter->second, beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET, - 1); // Band 3 (L2/G2/B3) + 2); // Band 3 (L2/G2/B3) found_B1I_obs = true; break; } @@ -772,7 +772,7 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, beidou_ephemeris_iter->second.i_BEIDOU_week + BEIDOU_DNAV_BDT2GPST_WEEK_NUM_OFFSET, - 1); // Band 2 (L2/G2) + 2); // Band 2 (L2/G2) valid_obs++; } } @@ -884,21 +884,8 @@ bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_ nav_data.leaps = beidou_dnav_utc_model.d_DeltaT_LS; } - for (auto &lambda_ : nav_data.lam) - { - lambda_[0] = SPEED_OF_LIGHT / FREQ1; // L1/E1 - lambda_[1] = SPEED_OF_LIGHT / FREQ2; // L2 - lambda_[2] = SPEED_OF_LIGHT / FREQ5; // L5/E5 - - // Keep update on sat number - sat++; - if (sat > NSYSGPS + NSYSGLO + NSYSGAL + NSYSQZS and sat < NSYSGPS + NSYSGLO + NSYSGAL + NSYSQZS + NSYSBDS) - { - lambda_[0] = SPEED_OF_LIGHT / FREQ1_BDS; // B1I - lambda_[1] = SPEED_OF_LIGHT / FREQ3_BDS; // B3I - lambda_[2] = SPEED_OF_LIGHT / FREQ5; // L5/E5 - } - } + /* update carrier wave length using native function call in RTKlib */ + uniqnav(&nav_data); result = rtkpos(&rtk_, obs_data.data(), valid_obs + glo_valid_obs, &nav_data); diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 901161d58..fac0decc2 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -166,9 +166,8 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, return 0.0; } - - /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ - if (sys == SYS_GAL or sys == SYS_SBS) + /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS/BDS */ + if (sys == SYS_GAL or sys == SYS_SBS or sys == SYS_BDS) { j = 2; } @@ -285,7 +284,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel, if (sys == SYS_BDS) { P2 += P2_C2; /* C2->P2 */ - PC = P2; // no tgd corrections for B3I + PC = P2; // no tgd corrections for B3I } else if (sys == SYS_GAL or sys == SYS_GLO or sys == SYS_BDS) // Gal. E5a single freq. { diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc index b6ab145b3..a70e0ec47 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_gs.cc @@ -267,7 +267,7 @@ void beidou_b1i_telemetry_decoder_gs::decode_subframe(float *frame_symbols) std::shared_ptr tmp_obj = std::make_shared(d_nav.get_iono()); this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Iono have been received in channel" << d_channel << " from satellite " << d_satellite; - std::cout << "New BEIDOU B1I DNAV Iono message received in channel " << d_channel << ": Iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; + std::cout << TEXT_YELLOW << "New BEIDOU B1I DNAV Iono message received in channel " << d_channel << ": Iono model parameters from satellite " << d_satellite << TEXT_RESET << std::endl; } if (d_nav.have_new_almanac() == true) { diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 36b81a656..9681fd272 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -665,7 +665,7 @@ void dll_pll_veml_tracking::start_tracking() d_symbols_per_bit = BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT; //todo: enable after fixing beidou symbol synchronization d_correlation_length_ms = 1; d_code_samples_per_chip = 1; - d_secondary = false; + d_secondary = true; trk_parameters.track_pilot = false; // synchronize and remove data secondary code d_secondary_code_length = static_cast(BEIDOU_B1I_SECONDARY_CODE_LENGTH); @@ -685,7 +685,7 @@ void dll_pll_veml_tracking::start_tracking() d_symbols_per_bit = BEIDOU_B3I_GEO_TELEMETRY_SYMBOLS_PER_BIT; //todo: enable after fixing beidou symbol synchronization d_correlation_length_ms = 1; d_code_samples_per_chip = 1; - d_secondary = true; + d_secondary = false; trk_parameters.track_pilot = false; // set the preamble in the secondary code acquisition d_secondary_code_length = static_cast(BEIDOU_B3I_GEO_PREAMBLE_LENGTH_SYMBOLS);