mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Merge branch 'glonass' of https://github.com/gnss-sdr/gnss-sdr into glonass_dec
This commit is contained in:
commit
09c5225981
@ -375,7 +375,7 @@ $ sudo make install
|
||||
|
||||
###### Build FMCOMMS2 based SDR Hardware support (OPTIONAL):
|
||||
|
||||
Install the [libiio](https://github.com/analogdevicesinc/libiio.git) (>=v0.11), [libad9361](https://github.com/analogdevicesinc/libad9361-iio.git) (>=v0.1-1) libraries and [gr-iio](https://github.com/analogdevicesinc/gr-iio.git) (>v0.2) gnuradio block:
|
||||
Install the [libiio](https://github.com/analogdevicesinc/libiio.git) (>=v0.11), [libad9361](https://github.com/analogdevicesinc/libad9361-iio.git) (>=v0.1-1) libraries and [gr-iio](https://github.com/analogdevicesinc/gr-iio.git) (>v0.3) gnuradio block:
|
||||
|
||||
~~~~~~
|
||||
$ sudo apt-get install libxml2-dev bison flex
|
||||
@ -1046,9 +1046,12 @@ Each channel must be assigned to a GNSS signal, according to the following ident
|
||||
| **Signal** | **Identifier** |
|
||||
|:------------------|:---------------:|
|
||||
| GPS L1 C/A | 1C |
|
||||
| Galileo E1b/c | 1B |
|
||||
| Glonass L1 C/A | 1G |
|
||||
| GPS L2 L2C(M) | 2S |
|
||||
| Galileo E1B | 1B |
|
||||
| Galileo E5a (I+Q) | 5X |
|
||||
| GPS L5 | L5 |
|
||||
| Galileo E5a | 5X |
|
||||
|
||||
|
||||
|
||||
Example: Eight GPS L1 C/A channels.
|
||||
|
@ -41,17 +41,10 @@ GNSS-SDR.SUPL_LAC=861
|
||||
GNSS-SDR.SUPL_CI=40184
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] or [Osmosdr_Signal_Source]
|
||||
SignalSource.implementation=Osmosdr_Signal_Source
|
||||
|
||||
SignalSource.AGC_enabled=false
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
;SignalSource.filename=/datalogger/signals/RTL-SDR/cap_-90dBm_IF15_RF40_EzCap.dat
|
||||
SignalSource.filename=/datalogger/signals/Agilent/New York/2msps.dat
|
||||
;SignalSource.filename=/datalogger/signals/RTL-SDR/geo/pmt4_no_amp.dat
|
||||
;SignalSource.filename=/datalogger/signals/RTL-SDR/geo/pmt4_no_amp_mini.dat
|
||||
;SignalSource.filename=/datalogger/signals/RTL-SDR/mozoncillo/cap_mozon_ezcap.dat
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=gr_complex
|
||||
@ -59,18 +52,26 @@ SignalSource.item_type=gr_complex
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=2000000
|
||||
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#gain: Front-end Gain in [dB]
|
||||
SignalSource.gain=40
|
||||
SignalSource.rf_gain=40
|
||||
SignalSource.if_gain=30
|
||||
SignalSource.AGC_enabled=false
|
||||
|
||||
;#subdevice: UHD subdevice specification (for USRP1 use A:0 or B:0)
|
||||
SignalSource.subdevice=B:0
|
||||
;# Please note that the new RTL-SDR Blog V3 dongles ship a < 1 PPM
|
||||
;# temperature compensated oscillator (TCXO), which is well suited for GNSS
|
||||
;# signal processing, and a 4.5 V powered bias-tee to feed an active antenna.
|
||||
;# Whether the bias-tee is turned off before reception depends on which version
|
||||
;# of gr-osmosdr was used when compiling GNSS-SDR. With an old version
|
||||
;# (for example, v0.1.4-8), the utility rtl_biast may be used to switch the
|
||||
;# bias-tee, and then call gnss-sdr.
|
||||
;# See https://github.com/rtlsdrblog/rtl_biast
|
||||
;# After reception the bias-tee is switched off automatically by the program.
|
||||
;# With newer versions of gr-osmosdr (>= 0.1.4-13), the bias-tee can be
|
||||
;# activated by uncommenting the following line:
|
||||
;SignalSource.osmosdr_args=rtl,bias=1
|
||||
|
||||
;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
|
||||
;#samples: Number of samples to be processed. Notice that 0 means infinite samples.
|
||||
SignalSource.samples=0
|
||||
|
||||
;#repeat: Repeat the processing file.
|
||||
|
@ -26,10 +26,10 @@ Resampler.item_type=gr_complex
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channel.signal=1G
|
||||
Channels.in_acquisition=1
|
||||
Channels.in_acquisition=2
|
||||
Channels_1G.count=8
|
||||
|
||||
Channel0.satellite=24 ; k=
|
||||
Channel0.satellite=24 ; k=2
|
||||
Channel1.satellite=1 ; k=1
|
||||
Channel2.satellite=2 ; k=-4
|
||||
Channel3.satellite=20 ; k=-5
|
||||
@ -53,9 +53,9 @@ Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking
|
||||
Tracking_1G.item_type=gr_complex
|
||||
Tracking_1G.if=0
|
||||
Tracking_1G.early_late_space_chips=0.5
|
||||
Tracking_1G.pll_bw_hz=25.0;
|
||||
Tracking_1G.pll_bw_hz=40.0;
|
||||
Tracking_1G.dll_bw_hz=3.0;
|
||||
Tracking_1G.pll_bw_narrow_hz = 20.0;
|
||||
Tracking_1G.pll_bw_narrow_hz = 25.0;
|
||||
Tracking_1G.dll_bw_narrow_hz = 2.0;
|
||||
Tracking_1G.extend_correlation_ms = 1;
|
||||
Tracking_1G.dump=true;
|
||||
|
@ -27,13 +27,11 @@ GNSS-SDR.SUPL_CI=0x31b0
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=Fmcomms2_Signal_Source
|
||||
;SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat
|
||||
SignalSource.item_type=gr_complex
|
||||
SignalSource.device_address=10.42.0.196
|
||||
SignalSource.sampling_frequency=2000000
|
||||
SignalSource.freq=1575420000
|
||||
SignalSource.bandwidth=2000000
|
||||
SignalSource.decimation=0
|
||||
SignalSource.rx1_enable=true
|
||||
SignalSource.gain_mode_rx1=manual
|
||||
SignalSource.rf_port_select=A_BALANCED
|
||||
|
@ -27,13 +27,11 @@ GNSS-SDR.SUPL_CI=0x31b0
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=Plutosdr_Signal_Source
|
||||
;SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat
|
||||
SignalSource.item_type=gr_complex
|
||||
SignalSource.device_address=192.168.2.1
|
||||
SignalSource.sampling_frequency=3000000
|
||||
SignalSource.freq=1575420000
|
||||
SignalSource.bandwidth=2600000
|
||||
SignalSource.decimation=0
|
||||
SignalSource.gain_mode=manual
|
||||
SignalSource.gain=30
|
||||
SignalSource.samples=0
|
||||
|
@ -27,9 +27,8 @@ GNSS-SDR.SUPL_CI=0x31b0
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=Osmosdr_Signal_Source
|
||||
;SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat
|
||||
SignalSource.item_type=gr_complex
|
||||
;FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
|
||||
; FOR USE GNSS-SDR WITH RTLSDR DONGLES USER MUST SET THE CALIBRATED SAMPLE RATE HERE
|
||||
; i.e. using front-end-cal as reported here:http://www.cttc.es/publication/turning-a-television-into-a-gnss-receiver/
|
||||
SignalSource.sampling_frequency=2000000
|
||||
SignalSource.freq=1575420000
|
||||
@ -43,6 +42,19 @@ SignalSource.dump=false
|
||||
SignalSource.dump_filename=../data/signal_source.dat
|
||||
SignalSource.enable_throttle_control=false
|
||||
|
||||
;# Please note that the new RTL-SDR Blog V3 dongles ship a < 1 PPM
|
||||
;# temperature compensated oscillator (TCXO), which is well suited for GNSS
|
||||
;# signal processing, and a 4.5 V powered bias-tee to feed an active antenna.
|
||||
;# Whether the bias-tee is turned off before reception depends on which version
|
||||
;# of gr-osmosdr was used when compiling GNSS-SDR. With an old version
|
||||
;# (for example, v0.1.4-8), the utility rtl_biast may be used to switch the
|
||||
;# bias-tee, and then call gnss-sdr.
|
||||
;# See https://github.com/rtlsdrblog/rtl_biast
|
||||
;# After reception the bias-tee is switched off automatically by the program.
|
||||
;# With newer versions of gr-osmosdr (>= 0.1.4-13), the bias-tee can be
|
||||
;# activated by uncommenting the following line:
|
||||
;SignalSource.osmosdr_args=rtl,bias=1
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
|
||||
|
269
conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf
Normal file
269
conf/gnss-sdr_galileo_E1_extended_correlator_byte.conf
Normal file
@ -0,0 +1,269 @@
|
||||
; Default configuration file
|
||||
; 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=20000000
|
||||
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
;SignalSource.filename=/home/javier/signals/L125_III1b_210s_L1_2msps.bin ; <- PUT YOUR FILE HERE
|
||||
|
||||
SignalSource.filename=/media/javier/SISTEMA/signals/fraunhofer/L125_III1b_210s_L1.bin
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=byte
|
||||
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=20000000
|
||||
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
|
||||
SignalSource.samples=0
|
||||
|
||||
;#repeat: Repeat the processing file. Disable this option in this version
|
||||
SignalSource.repeat=false
|
||||
|
||||
;#dump: Dump the Signal source data to a file. Disable this option in this version
|
||||
SignalSource.dump=false
|
||||
|
||||
SignalSource.dump_filename=../data/signal_source.dat
|
||||
|
||||
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
|
||||
; it helps to not overload the CPU, but the processing time will be longer.
|
||||
SignalSource.enable_throttle_control=false
|
||||
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
;## It holds blocks to change data type, filter and resample input data.
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Signal_Conditioner]
|
||||
;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
|
||||
;######### DATA_TYPE_ADAPTER CONFIG ############
|
||||
;## Changes the type of input data. Please disable it in this version.
|
||||
;#implementation: [Pass_Through] disables this block
|
||||
DataTypeAdapter.implementation=Ibyte_To_Complex
|
||||
|
||||
;######### INPUT_FILTER CONFIG ############
|
||||
;## Filter the input data. Can be combined with frequency translation for IF signals
|
||||
|
||||
InputFilter.implementation=Pass_Through
|
||||
|
||||
|
||||
;######### RESAMPLER CONFIG ############
|
||||
;## Resamples the input data.
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Direct_Resampler]
|
||||
;#[Pass_Through] disables this block
|
||||
;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation
|
||||
;Resampler.implementation=Direct_Resampler
|
||||
Resampler.implementation=Pass_Through
|
||||
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_1C.count=0
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_1B.count=1
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
|
||||
;#signal:
|
||||
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
|
||||
Channel1.signal=1B
|
||||
Channel2.signal=1B
|
||||
Channel3.signal=1B
|
||||
Channel4.signal=1B
|
||||
Channel5.signal=1B
|
||||
Channel6.signal=1B
|
||||
Channel7.signal=1B
|
||||
Channel8.signal=1B
|
||||
Channel9.signal=1B
|
||||
Channel10.signal=1B
|
||||
Channel11.signal=1B
|
||||
Channel12.signal=1B
|
||||
Channel13.signal=1B
|
||||
Channel14.signal=1B
|
||||
Channel15.signal=1B
|
||||
|
||||
|
||||
;######### GPS ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1C.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1C.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1C.sampled_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.use_CFAR_algorithm=false;
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1C.threshold=18
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1C.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1C.doppler_step=500
|
||||
|
||||
|
||||
;######### GALILEO ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1B.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1B.dump_filename=../data/acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1B.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1B.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1B.sampled_ms=4
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
Acquisition_1B.acquire_pilot=true
|
||||
Acquisition_1B.use_CFAR_algorithm=false
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1B.threshold=21
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1B.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1B.doppler_step=125
|
||||
Acquisition_1B.bit_transition_flag=true
|
||||
|
||||
;######### TRACKING GPS CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
|
||||
Tracking_1C.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1C.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1C.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1C.dump_filename=../data/epl_tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.pll_bw_hz=30.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.dll_bw_hz=2.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1C.order=3;
|
||||
|
||||
;######### TRACKING GALILEO CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples.
|
||||
Tracking_1B.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1B.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1B.dump=true
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1B.dump_filename=../data/veml_tracking_ch_
|
||||
|
||||
Tracking_1B.track_pilot=true
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_hz=4.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_hz=0.5;
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_narrow_hz=2.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_narrow_hz=0.25;
|
||||
|
||||
Tracking_1B.extend_correlation_symbols=4;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1B.order=3;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_chips=0.6;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_narrow_chips=0.06;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_narrow_chips=0.25;
|
||||
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
;#decimation factor
|
||||
TelemetryDecoder_1C.decimation_factor=4;
|
||||
|
||||
;######### TELEMETRY DECODER GALILEO CONFIG ############
|
||||
;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
|
||||
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
|
||||
TelemetryDecoder_1B.dump=false
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
;#implementation:
|
||||
Observables.implementation=Hybrid_Observables
|
||||
|
||||
;#dump: Enable or disable the Observables internal binary data file logging [true] or [false]
|
||||
Observables.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename.
|
||||
Observables.dump_filename=./observables.dat
|
||||
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
;#implementation: Position Velocity and Time (PVT) implementation:
|
||||
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
|
||||
|
||||
;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms]
|
||||
PVT.output_rate_ms=100;
|
||||
|
||||
;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms.
|
||||
PVT.display_rate_ms=500;
|
||||
|
||||
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
|
||||
PVT.dump=false
|
||||
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
|
||||
;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
|
||||
PVT.dump_filename=./PVT
|
333
conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf
Normal file
333
conf/gnss-sdr_galileo_E1_extended_correlator_labsat.conf
Normal file
@ -0,0 +1,333 @@
|
||||
; Default configuration file
|
||||
; 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=5456000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
;#implementation: Use [File_Signal_Source] [Nsr_File_Signal_Source] or [UHD_Signal_Source] or [GN3S_Signal_Source] (experimental)
|
||||
SignalSource.implementation=Labsat_Signal_Source
|
||||
|
||||
SignalSource.selected_channel=1
|
||||
|
||||
;#filename: path to file with the captured GNSS signal samples to be processed
|
||||
;# Labsat sile source automatically increments the file name when the signal is splitted in several files
|
||||
;# the adapter adds "_0000.LS3" to this base path and filename. Next file will be "_0001.LS3" and so on
|
||||
;# in this example, the first file complete path will be ../signals/GPS_025_0000.LS3
|
||||
|
||||
SignalSource.filename=../signals/GPS_025 ; <- PUT YOUR FILE HERE
|
||||
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
SignalSource.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Original Signal sampling frequency in [Hz]
|
||||
SignalSource.sampling_frequency=16368000
|
||||
|
||||
;#freq: RF front-end center frequency in [Hz]
|
||||
SignalSource.freq=1575420000
|
||||
|
||||
;#samples: Number of samples to be processed. Notice that 0 indicates the entire file.
|
||||
SignalSource.samples=0
|
||||
|
||||
;#repeat: Repeat the processing file. Disable this option in this version
|
||||
SignalSource.repeat=false
|
||||
|
||||
;#dump: Dump the Signal source data to a file. Disable this option in this version
|
||||
SignalSource.dump=false
|
||||
|
||||
SignalSource.dump_filename=../data/signal_source.dat
|
||||
|
||||
|
||||
;#enable_throttle_control: Enabling this option tells the signal source to keep the delay between samples in post processing.
|
||||
; it helps to not overload the CPU, but the processing time will be longer.
|
||||
SignalSource.enable_throttle_control=false
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
;## It holds blocks to change data type, filter and resample input data.
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Signal_Conditioner]
|
||||
;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
|
||||
;######### DATA_TYPE_ADAPTER CONFIG ############
|
||||
;## Changes the type of input data.
|
||||
;#implementation: [Pass_Through] disables this block
|
||||
DataTypeAdapter.implementation=Pass_Through
|
||||
DataTypeAdapter.item_type=gr_complex
|
||||
|
||||
;######### INPUT_FILTER CONFIG ############
|
||||
;## Filter the input data. Can be combined with frequency translation for IF signals
|
||||
|
||||
;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
|
||||
;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation
|
||||
;# that shifts IF down to zero Hz.
|
||||
|
||||
InputFilter.implementation=Freq_Xlating_Fir_Filter
|
||||
|
||||
;#dump: Dump the filtered data to a file.
|
||||
InputFilter.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename.
|
||||
InputFilter.dump_filename=../data/input_filter.dat
|
||||
|
||||
;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation.
|
||||
;#These options are based on parameters of gnuradio's function: gr_remez.
|
||||
;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse
|
||||
;#reponse given a set of band edges, the desired reponse on those bands,
|
||||
;#and the weight given to the error in those bands.
|
||||
|
||||
;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
|
||||
InputFilter.input_item_type=gr_complex
|
||||
|
||||
;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
|
||||
InputFilter.output_item_type=gr_complex
|
||||
|
||||
;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
|
||||
InputFilter.taps_item_type=float
|
||||
|
||||
;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
|
||||
InputFilter.number_of_taps=5
|
||||
|
||||
;#number_of _bands: Number of frequency bands in the filter.
|
||||
InputFilter.number_of_bands=2
|
||||
|
||||
;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
|
||||
;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
|
||||
;#The number of band_begin and band_end elements must match the number of bands
|
||||
|
||||
InputFilter.band1_begin=0.0
|
||||
InputFilter.band1_end=0.45
|
||||
InputFilter.band2_begin=0.55
|
||||
InputFilter.band2_end=1.0
|
||||
|
||||
;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
|
||||
;#The number of ampl_begin and ampl_end elements must match the number of bands
|
||||
|
||||
InputFilter.ampl1_begin=1.0
|
||||
InputFilter.ampl1_end=1.0
|
||||
InputFilter.ampl2_begin=0.0
|
||||
InputFilter.ampl2_end=0.0
|
||||
|
||||
;#band_error: weighting applied to each band (usually 1).
|
||||
;#The number of band_error elements must match the number of bands
|
||||
InputFilter.band1_error=1.0
|
||||
InputFilter.band2_error=1.0
|
||||
|
||||
;#filter_type: one of "bandpass", "hilbert" or "differentiator"
|
||||
InputFilter.filter_type=bandpass
|
||||
|
||||
;#grid_density: determines how accurately the filter will be constructed.
|
||||
;The minimum value is 16; higher values are slower to compute the filter.
|
||||
InputFilter.grid_density=16
|
||||
|
||||
;# Original sampling frequency stored in the signal file
|
||||
InputFilter.sampling_frequency=16368000
|
||||
|
||||
;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
|
||||
;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz
|
||||
|
||||
InputFilter.IF=0
|
||||
|
||||
;# Decimation factor after the frequency tranaslating block
|
||||
InputFilter.decimation_factor=3
|
||||
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
;#count: Number of available GPS satellite channels.
|
||||
Channels_1C.count=0
|
||||
;#count: Number of available Galileo satellite channels.
|
||||
Channels_1B.count=6
|
||||
;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
|
||||
Channels.in_acquisition=1
|
||||
|
||||
;#signal:
|
||||
;#if the option is disabled by default is assigned "1C" GPS L1 C/A
|
||||
Channel0.signal=1B
|
||||
Channel1.signal=1B
|
||||
Channel2.signal=1B
|
||||
Channel3.signal=1B
|
||||
Channel4.signal=1B
|
||||
Channel5.signal=1B
|
||||
Channel6.signal=1B
|
||||
Channel7.signal=1B
|
||||
Channel8.signal=1B
|
||||
Channel9.signal=1B
|
||||
Channel10.signal=1B
|
||||
Channel11.signal=1B
|
||||
Channel12.signal=1B
|
||||
Channel13.signal=1B
|
||||
Channel14.signal=1B
|
||||
Channel15.signal=1B
|
||||
|
||||
|
||||
;######### GPS ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1C.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1C.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1C.sampled_ms=1
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.use_CFAR_algorithm=false;
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1C.threshold=22
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1C.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1C.doppler_step=250
|
||||
|
||||
|
||||
;######### GALILEO ACQUISITION CONFIG ############
|
||||
|
||||
;#dump: Enable or disable the acquisition internal data file logging [true] or [false]
|
||||
Acquisition_1B.dump=false
|
||||
;#filename: Log path and filename
|
||||
Acquisition_1B.dump_filename=../data/acq_dump.dat
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
|
||||
Acquisition_1B.item_type=gr_complex
|
||||
;#if: Signal intermediate frequency in [Hz]
|
||||
Acquisition_1B.if=0
|
||||
;#sampled_ms: Signal block duration for the acquisition signal detection [ms]
|
||||
Acquisition_1B.sampled_ms=4
|
||||
;#implementation: Acquisition algorithm selection for this channel: [GPS_L1_CA_PCPS_Acquisition] or [Galileo_E1_PCPS_Ambiguous_Acquisition]
|
||||
Acquisition_1B.implementation=Galileo_E1_PCPS_Ambiguous_Acquisition
|
||||
Acquisition_1B.acquire_pilot=true
|
||||
Acquisition_1B.use_CFAR_algorithm=false
|
||||
;#threshold: Acquisition threshold
|
||||
Acquisition_1B.threshold=22
|
||||
;#doppler_max: Maximum expected Doppler shift [Hz]
|
||||
Acquisition_1B.doppler_max=5000
|
||||
;#doppler_max: Doppler step in the grid search [Hz]
|
||||
Acquisition_1B.doppler_step=125
|
||||
Acquisition_1B.bit_transition_flag=true
|
||||
|
||||
;######### TRACKING GPS CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples. Use only [gr_complex] in this version.
|
||||
Tracking_1C.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1C.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1C.dump=true
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1C.dump_filename=../data/epl_tracking_ch_
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.pll_bw_hz=40.0;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1C.dll_bw_hz=2.0;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1C.order=3;
|
||||
|
||||
;######### TRACKING GALILEO CONFIG ############
|
||||
|
||||
;#implementation: Selected tracking algorithm: [GPS_L1_CA_DLL_PLL_Tracking] or [GPS_L1_CA_DLL_PLL_C_Aid_Tracking] or [GPS_L1_CA_TCP_CONNECTOR_Tracking] or [Galileo_E1_DLL_PLL_VEML_Tracking]
|
||||
Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking
|
||||
;#item_type: Type and resolution for each of the signal samples.
|
||||
Tracking_1B.item_type=gr_complex
|
||||
|
||||
;#sampling_frequency: Signal Intermediate Frequency in [Hz]
|
||||
Tracking_1B.if=0
|
||||
|
||||
;#dump: Enable or disable the Tracking internal binary data file logging [true] or [false]
|
||||
Tracking_1B.dump=true
|
||||
|
||||
;#dump_filename: Log path and filename. Notice that the tracking channel will add "x.dat" where x is the channel number.
|
||||
Tracking_1B.dump_filename=../data/veml_tracking_ch_
|
||||
|
||||
Tracking_1B.track_pilot=true
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_hz=7.5;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_hz=0.5;
|
||||
|
||||
;#pll_bw_hz: PLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.pll_bw_narrow_hz=2.5;
|
||||
|
||||
;#dll_bw_hz: DLL loop filter bandwidth [Hz]
|
||||
Tracking_1B.dll_bw_narrow_hz=0.25;
|
||||
|
||||
Tracking_1B.extend_correlation_symbols=4;
|
||||
|
||||
;#order: PLL/DLL loop filter order [2] or [3]
|
||||
Tracking_1B.order=3;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_chips=0.6;
|
||||
|
||||
;#early_late_space_chips: correlator early-late space [chips]. Use [0.5] for GPS and [0.15] for Galileo
|
||||
Tracking_1B.early_late_space_narrow_chips=0.15;
|
||||
|
||||
;#very_early_late_space_chips: only for [Galileo_E1_DLL_PLL_VEML_Tracking], correlator very early-late space [chips]. Use [0.6]
|
||||
Tracking_1B.very_early_late_space_narrow_chips=0.30;
|
||||
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
;#implementation: Use [GPS_L1_CA_Telemetry_Decoder] for GPS L1 C/A
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
|
||||
;######### TELEMETRY DECODER GALILEO CONFIG ############
|
||||
;#implementation: Use [Galileo_E1B_Telemetry_Decoder] for Galileo E1B
|
||||
TelemetryDecoder_1B.implementation=Galileo_E1B_Telemetry_Decoder
|
||||
TelemetryDecoder_1B.dump=false
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
;#implementation:
|
||||
Observables.implementation=Hybrid_Observables
|
||||
|
||||
;#dump: Enable or disable the Observables internal binary data file logging [true] or [false]
|
||||
Observables.dump=false
|
||||
|
||||
;#dump_filename: Log path and filename.
|
||||
Observables.dump_filename=./observables.dat
|
||||
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
;#implementation: Position Velocity and Time (PVT) implementation:
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
|
||||
PVT.positioning_mode=Single ; 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
|
||||
|
||||
;#output_rate_ms: Period between two PVT outputs. Notice that the minimum period is equal to the tracking integration time (for GPS CA L1 is 1ms) [ms]
|
||||
PVT.output_rate_ms=100;
|
||||
|
||||
;#display_rate_ms: Position console print (std::out) interval [ms]. Notice that output_rate_ms<=display_rate_ms.
|
||||
PVT.display_rate_ms=500;
|
||||
|
||||
;#dump: Enable or disable the PVT internal binary data file logging [true] or [false]
|
||||
PVT.dump=false
|
||||
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
|
||||
;#dump_filename: Log path and filename without extension. Notice that PVT will add ".dat" to the binary dump and ".kml" to GoogleEarth dump.
|
||||
PVT.dump_filename=./PVT
|
@ -154,41 +154,45 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
*/
|
||||
int gps_1C_count = configuration->property("Channels_1C.count", 0);
|
||||
int gps_2S_count = configuration->property("Channels_2S.count", 0);
|
||||
int gps_L5_count = configuration->property("Channels_L5.count", 0);
|
||||
int gal_1B_count = configuration->property("Channels_1B.count", 0);
|
||||
int gal_E5a_count = configuration->property("Channels_5X.count", 0); // GPS L5 or Galileo E5a ?
|
||||
int gal_E5a_count = configuration->property("Channels_5X.count", 0);
|
||||
int gal_E5b_count = configuration->property("Channels_7X.count", 0);
|
||||
int glo_1G_count = configuration->property("Channels_1G.count", 0);
|
||||
|
||||
unsigned int type_of_receiver = 0;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 1;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 2;
|
||||
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 4;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 5;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 6;
|
||||
// *******************WARNING!!!!!!!***********
|
||||
// GPS L5 only configurable for single frequency, single system at the moment!!!!!!
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 1;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 2;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 3;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 4;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 5;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 6;
|
||||
|
||||
if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 7;
|
||||
//if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 9;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 10;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 11;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 12;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 7;
|
||||
//if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 9;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 10;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 11;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 12;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 14;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 15;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 17;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 18;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 21;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2R_count != 0)) type_of_receiver = 24;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_1G_count != 0)) type_of_receiver = 25;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 26;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 27;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 28;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 14;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 15;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 17;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 18;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 21;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2R_count != 0)) type_of_receiver = 24;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_1G_count != 0)) type_of_receiver = 25;
|
||||
if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 26;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 27;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 28;
|
||||
//RTKLIB PVT solver options
|
||||
// Settings 1
|
||||
int positioning_mode = -1;
|
||||
@ -214,8 +218,8 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
|
||||
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) num_bands = 1;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) ) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0)) ) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0))) num_bands = 3;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3;
|
||||
|
||||
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
|
||||
if( (number_of_frequencies < 1) || (number_of_frequencies > 3) )
|
||||
@ -296,7 +300,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int earth_tide = configuration->property(role + ".earth_tide", 0);
|
||||
|
||||
int nsys = 0;
|
||||
if ((gps_1C_count > 0) || (gps_2S_count > 0)) nsys += SYS_GPS;
|
||||
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS;
|
||||
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL;
|
||||
if ((glo_1G_count > 0)) nsys += SYS_GLO;
|
||||
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
|
@ -123,7 +123,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
|
||||
gps_cnav_ephemeris = boost::any_cast<std::shared_ptr<Gps_CNAV_Ephemeris>>(pmt::any_ref(msg));
|
||||
// update/insert new ephemeris record to the global ephemeris map
|
||||
d_ls_pvt->gps_cnav_ephemeris_map[gps_cnav_ephemeris->i_satellite_PRN] = *gps_cnav_ephemeris;
|
||||
LOG(INFO) << "New GPS CNAV ephemeris record has arrived ";
|
||||
DLOG(INFO) << "New GPS CNAV ephemeris record has arrived ";
|
||||
}
|
||||
else if(pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gps_CNAV_Iono>) )
|
||||
{
|
||||
@ -386,7 +386,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
|
||||
msgctl(sysv_msqid, IPC_RMID, NULL);
|
||||
|
||||
//save GPS L2CM ephemeris to XML file
|
||||
std::string file_name="eph_GPS_L2CM.xml";
|
||||
std::string file_name = "eph_GPS_L2CM_L5.xml";
|
||||
|
||||
if (d_ls_pvt->gps_cnav_ephemeris_map.size() > 0)
|
||||
{
|
||||
@ -396,7 +396,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
|
||||
boost::archive::xml_oarchive xml(ofs);
|
||||
xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map);
|
||||
ofs.close();
|
||||
LOG(INFO) << "Saved GPS L2CM Ephemeris map data";
|
||||
LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data";
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
@ -405,7 +405,7 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "Failed to save GPS L2CM Ephemeris, map is empty";
|
||||
LOG(WARNING) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty";
|
||||
}
|
||||
|
||||
//save GPS L1 CA ephemeris to XML file
|
||||
@ -522,9 +522,6 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
bool flag_write_RTCM_1019_output = false;
|
||||
bool flag_write_RTCM_1020_output = false;
|
||||
bool flag_write_RTCM_1045_output = false;
|
||||
bool flag_write_RTCM_1077_output = false;
|
||||
bool flag_write_RTCM_1087_output = false;
|
||||
bool flag_write_RTCM_1097_output = false;
|
||||
bool flag_write_RTCM_MSM_output = false;
|
||||
bool flag_write_RINEX_obs_output = false;
|
||||
bool flag_write_RINEX_nav_output = false;
|
||||
@ -549,7 +546,8 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
|| ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1B") == 0))
|
||||
|| ((tmp_eph_iter_gal->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("5X") == 0))
|
||||
|| ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("1G") == 0))
|
||||
|| ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0)))
|
||||
|| ((tmp_eph_iter_glo_gnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("2G") == 0))
|
||||
|| ((tmp_eph_iter_cnav->second.i_satellite_PRN == in[i][epoch].PRN) && (std::string(in[i][epoch].Signal).compare("L5") == 0)))
|
||||
{
|
||||
// store valid observables in a map.
|
||||
gnss_observables_map.insert(std::pair<int,Gnss_Synchro>(i, in[i][epoch]));
|
||||
@ -629,17 +627,14 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
|
||||
if ((std::fabs(current_RX_time - last_RTCM_1077_output_time) * 1000.0 >= static_cast<double>(d_rtcm_MT1077_rate_ms)) && (d_rtcm_MT1077_rate_ms != 0) )
|
||||
{
|
||||
flag_write_RTCM_1077_output = true;
|
||||
last_RTCM_1077_output_time = current_RX_time;
|
||||
}
|
||||
if ((std::fabs(current_RX_time - last_RTCM_1087_output_time) * 1000.0 >= static_cast<double>(d_rtcm_MT1087_rate_ms)) && (d_rtcm_MT1087_rate_ms != 0) )
|
||||
{
|
||||
flag_write_RTCM_1087_output = true;
|
||||
last_RTCM_1087_output_time = current_RX_time;
|
||||
}
|
||||
if ((std::fabs(current_RX_time - last_RTCM_1097_output_time) * 1000.0 >= static_cast<double>(d_rtcm_MT1097_rate_ms)) && (d_rtcm_MT1097_rate_ms != 0) )
|
||||
{
|
||||
flag_write_RTCM_1097_output = true;
|
||||
last_RTCM_1097_output_time = current_RX_time;
|
||||
}
|
||||
|
||||
@ -669,8 +664,8 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
if(first_fix == true)
|
||||
{
|
||||
std::cout << "First position fix at " << boost::posix_time::to_simple_string(d_ls_pvt->get_position_UTC_time())
|
||||
<< " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
|
||||
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
|
||||
<< " UTC is Lat = " << d_ls_pvt->get_latitude() << " [deg], Long = " << d_ls_pvt->get_longitude()
|
||||
<< " [deg], Height= " << d_ls_pvt->get_height() << " [m]" << std::endl;
|
||||
ttff_msgbuf ttff;
|
||||
ttff.mtype = 1;
|
||||
end = std::chrono::system_clock::now();
|
||||
@ -721,7 +716,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
std::map<int, Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
|
||||
std::map<int, Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
|
||||
std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_ephemeris_iter;
|
||||
std::map<int, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter;
|
||||
std::map<int, Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter;
|
||||
std::map<int, Gnss_Synchro>::const_iterator gnss_observables_iter;
|
||||
|
||||
if (!b_rinex_header_written) // & we have utc data in nav message!
|
||||
@ -729,7 +724,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
|
||||
gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
|
||||
|
||||
if(type_of_rx == 1) // GPS L1 C/A only
|
||||
{
|
||||
@ -750,6 +745,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
}
|
||||
}
|
||||
if(type_of_rx == 3) // GPS L5 only
|
||||
{
|
||||
if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
|
||||
{
|
||||
rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time);
|
||||
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
}
|
||||
}
|
||||
if(type_of_rx == 4) // Galileo E1B only
|
||||
{
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
|
||||
@ -877,12 +881,12 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
std::string glo_signal("1G");
|
||||
rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
|
||||
if(d_rinex_version == 3)
|
||||
rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
|
||||
rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
|
||||
if(d_rinex_version == 2)
|
||||
{
|
||||
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
|
||||
rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
|
||||
}
|
||||
{
|
||||
rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
|
||||
rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
|
||||
}
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
}
|
||||
}
|
||||
@ -898,15 +902,15 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
}
|
||||
if(type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
|
||||
{
|
||||
if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) )
|
||||
{
|
||||
std::string glo_signal("1G");
|
||||
rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
|
||||
rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
}
|
||||
}
|
||||
{
|
||||
if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) )
|
||||
{
|
||||
std::string glo_signal("1G");
|
||||
rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
|
||||
rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
|
||||
b_rinex_header_written = true; // do not write header anymore
|
||||
}
|
||||
}
|
||||
}
|
||||
if(b_rinex_header_written) // The header is already written, we can now log the navigation message data
|
||||
{
|
||||
@ -920,6 +924,10 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
{
|
||||
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
|
||||
}
|
||||
if(type_of_rx == 3) // GPS L5 only
|
||||
{
|
||||
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
|
||||
}
|
||||
if( (type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) ) // Galileo
|
||||
{
|
||||
rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
|
||||
@ -942,13 +950,13 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
|
||||
{
|
||||
if(d_rinex_version == 3)
|
||||
rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
if(d_rinex_version == 2)
|
||||
{
|
||||
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
|
||||
rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
if(d_rinex_version == 3)
|
||||
rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
if(d_rinex_version == 2)
|
||||
{
|
||||
rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
|
||||
rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
|
||||
}
|
||||
if(type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
|
||||
@ -956,9 +964,9 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
if(type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
|
||||
{
|
||||
rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
{
|
||||
rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
|
||||
}
|
||||
}
|
||||
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
|
||||
@ -994,6 +1002,19 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
b_rinex_header_updated = true;
|
||||
}
|
||||
}
|
||||
if(type_of_rx == 3) // GPS L5
|
||||
{
|
||||
if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())
|
||||
{
|
||||
rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
}
|
||||
if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
|
||||
{
|
||||
rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
|
||||
rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
|
||||
b_rinex_header_updated = true;
|
||||
}
|
||||
}
|
||||
if(type_of_rx == 4) // Galileo E1B only
|
||||
{
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||
@ -1128,7 +1149,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
{
|
||||
if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) )
|
||||
{
|
||||
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
}
|
||||
if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0))
|
||||
{
|
||||
@ -1155,7 +1176,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
{
|
||||
if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()) )
|
||||
{
|
||||
rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
|
||||
}
|
||||
if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
|
||||
{
|
||||
@ -1412,7 +1433,7 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
|
||||
{
|
||||
gal_channel = i;
|
||||
gal_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1556,30 +1577,30 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
b_rtcm_writing_started = true;
|
||||
}
|
||||
if((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS
|
||||
{
|
||||
for(std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
|
||||
}
|
||||
{
|
||||
for(std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
|
||||
}
|
||||
|
||||
std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
|
||||
std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
|
||||
|
||||
if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
b_rtcm_writing_started = true;
|
||||
}
|
||||
if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
b_rtcm_writing_started = true;
|
||||
}
|
||||
if(type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
|
||||
{
|
||||
if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
if(d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
|
||||
}
|
||||
}
|
||||
if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ )
|
||||
{
|
||||
@ -1587,108 +1608,104 @@ int rtklib_pvt_cc::work (int noutput_items, gr_vector_const_void_star &input_ite
|
||||
}
|
||||
}
|
||||
|
||||
//gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
|
||||
//galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
|
||||
unsigned int i = 0;
|
||||
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
|
||||
{
|
||||
std::string system(&gnss_observables_iter->second.System, 1);
|
||||
if(gps_channel == 0)
|
||||
{
|
||||
if(system.compare("G") == 0)
|
||||
{
|
||||
// This is a channel with valid GPS signal
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
|
||||
{
|
||||
gps_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(glo_channel == 0)
|
||||
{
|
||||
if(system.compare("R") == 0)
|
||||
{
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
glo_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
//gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
|
||||
//galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
|
||||
unsigned int i = 0;
|
||||
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
|
||||
{
|
||||
std::string system(&gnss_observables_iter->second.System, 1);
|
||||
if(gps_channel == 0)
|
||||
{
|
||||
if(system.compare("G") == 0)
|
||||
{
|
||||
// This is a channel with valid GPS signal
|
||||
gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
|
||||
{
|
||||
gps_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(glo_channel == 0)
|
||||
{
|
||||
if(system.compare("R") == 0)
|
||||
{
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
glo_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
b_rtcm_writing_started = true;
|
||||
if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
b_rtcm_writing_started = true;
|
||||
}
|
||||
if(type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B
|
||||
{
|
||||
if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
|
||||
}
|
||||
}
|
||||
if(d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int i = 0;
|
||||
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
|
||||
{
|
||||
std::string system(&gnss_observables_iter->second.System, 1);
|
||||
if(gal_channel == 0)
|
||||
{
|
||||
if(system.compare("E") == 0)
|
||||
{
|
||||
// This is a channel with valid GPS signal
|
||||
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
|
||||
{
|
||||
gal_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(glo_channel == 0)
|
||||
{
|
||||
if(system.compare("R") == 0)
|
||||
{
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
|
||||
{
|
||||
glo_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
{
|
||||
if(d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(std::map<int,Glonass_Gnav_Ephemeris>::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
|
||||
}
|
||||
}
|
||||
if(d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
|
||||
{
|
||||
for(galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++ )
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int i = 0;
|
||||
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
|
||||
{
|
||||
std::string system(&gnss_observables_iter->second.System, 1);
|
||||
if(gal_channel == 0)
|
||||
{
|
||||
if(system.compare("E") == 0)
|
||||
{
|
||||
// This is a channel with valid GPS signal
|
||||
galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
|
||||
{
|
||||
gal_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(glo_channel == 0)
|
||||
{
|
||||
if(system.compare("R") == 0)
|
||||
{
|
||||
glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
|
||||
{
|
||||
glo_channel = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
|
||||
{
|
||||
d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -621,7 +621,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line 6 leap seconds
|
||||
// For leap second information, see http://www.endruntechnologies.com/leap.htm
|
||||
line.clear();
|
||||
@ -642,6 +641,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
@ -743,7 +743,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line 6 leap seconds
|
||||
// For leap second information, see http://www.endruntechnologies.com/leap.htm
|
||||
line.clear();
|
||||
@ -764,6 +763,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
@ -828,7 +828,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line system time correction
|
||||
line.clear();
|
||||
line += std::string("GAUT");
|
||||
@ -874,6 +873,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& gali
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
@ -921,7 +921,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line ionospheric info 1
|
||||
line.clear();
|
||||
line += std::string("GAL ");
|
||||
@ -936,7 +935,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line system time correction
|
||||
line.clear();
|
||||
line += std::string("GAUT");
|
||||
@ -961,7 +959,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line 6 leap seconds
|
||||
// For leap second information, see http://www.endruntechnologies.com/leap.htm
|
||||
line.clear();
|
||||
@ -982,6 +979,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Galileo_Iono& iono
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono & iono, const Gps_CNAV_Utc_Model & utc_model)
|
||||
{
|
||||
std::string line;
|
||||
@ -1097,6 +1095,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_CNAV_Iono & io
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model)
|
||||
{
|
||||
std::string line;
|
||||
@ -1120,7 +1119,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
|
||||
line += std::string("G: GPS");
|
||||
line += std::string(14, ' ');
|
||||
// ...
|
||||
|
||||
}
|
||||
|
||||
line += std::string("RINEX VERSION / TYPE");
|
||||
@ -1266,7 +1264,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- End of Header
|
||||
line.clear();
|
||||
line += std::string(60, ' ');
|
||||
@ -1275,6 +1272,7 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
@ -1322,7 +1320,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line ionospheric info 1
|
||||
line.clear();
|
||||
line += std::string("GAL ");
|
||||
@ -1386,7 +1383,6 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- Line 6 leap seconds
|
||||
// For leap second information, see http://www.endruntechnologies.com/leap.htm
|
||||
line.clear();
|
||||
@ -1589,6 +1585,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Glonass_Gnav_Utc_
|
||||
std::cout << "The RINEX Navigation file header has been updated with UTC info." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::vector<std::string> data;
|
||||
@ -1684,6 +1681,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
|
||||
std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& iono)
|
||||
{
|
||||
std::vector<std::string> data;
|
||||
@ -2039,7 +2037,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2253,7 +2250,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp
|
||||
{
|
||||
data.push_back(line_str);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2274,11 +2270,12 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gp
|
||||
std::cout << "The RINEX Navigation file header has been updated with UTC and IONO info." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac)
|
||||
{
|
||||
if(glonass_gnav_almanac.i_satellite_freq_channel){} //Avoid compiler warning
|
||||
//Avoid compiler warning, there is not time system correction between Galileo and GLONASS
|
||||
if(galileo_almanac.A_0G_10){}
|
||||
if(galileo_almanac.A_0G_10){}
|
||||
std::vector<std::string> data;
|
||||
std::string line_aux;
|
||||
|
||||
@ -2373,7 +2370,6 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephemeris>& eph_map)
|
||||
{
|
||||
std::string line;
|
||||
@ -2382,7 +2378,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
for(gps_ephemeris_iter = eph_map.cbegin();
|
||||
gps_ephemeris_iter != eph_map.cend();
|
||||
gps_ephemeris_iter++)
|
||||
{
|
||||
{
|
||||
// -------- SV / EPOCH / SV CLK
|
||||
boost::posix_time::ptime p_utc_time = Rinex_Printer::compute_GPS_time(gps_ephemeris_iter->second, gps_ephemeris_iter->second.d_Toc);
|
||||
std::string timestring = boost::posix_time::to_iso_string(p_utc_time);
|
||||
@ -2490,7 +2486,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 1
|
||||
line.clear();
|
||||
|
||||
@ -2524,7 +2519,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 2
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -2549,8 +2543,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 3
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -2575,8 +2567,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 4
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -2601,8 +2591,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 5
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -2653,7 +2641,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_Ephe
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 7
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -2747,7 +2734,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 1
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2771,7 +2757,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 2
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2787,7 +2772,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 3
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2801,7 +2785,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 4
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2817,7 +2800,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 5
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2834,7 +2816,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 6
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2849,7 +2830,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Gps_CNAV
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 7
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2912,7 +2892,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 1
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2926,7 +2905,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 2
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2940,7 +2918,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 3
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2954,7 +2931,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 4
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2968,7 +2944,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 5
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -2989,7 +2964,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 6
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -3029,7 +3003,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 7
|
||||
line.clear();
|
||||
line += std::string(5, ' ');
|
||||
@ -3055,7 +3028,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Glonass_
|
||||
for(glonass_gnav_ephemeris_iter = eph_map.begin();
|
||||
glonass_gnav_ephemeris_iter != eph_map.end();
|
||||
glonass_gnav_ephemeris_iter++)
|
||||
{
|
||||
{
|
||||
// -------- SV / EPOCH / SV CLK
|
||||
boost::posix_time::ptime p_utc_time = glonass_gnav_ephemeris_iter->second.glot_to_utc(glonass_gnav_ephemeris_iter->second.d_t_b, 0.0);
|
||||
std::string timestring = boost::posix_time::to_iso_string(p_utc_time);
|
||||
@ -3164,7 +3137,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Glonass_
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 1
|
||||
line.clear();
|
||||
// TODO Why is this happening here?. The extra space maybe is intended to help with readability
|
||||
@ -3191,7 +3163,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Glonass_
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 2
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -3217,8 +3188,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Glonass_
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
|
||||
// -------- BROADCAST ORBIT - 3
|
||||
line.clear();
|
||||
if (version == 2)
|
||||
@ -3247,6 +3216,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int,Glonass_
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Gps_Ephemeris>& gps_eph_map, const std::map<int, Galileo_Ephemeris>& galileo_eph_map)
|
||||
{
|
||||
version = 3;
|
||||
@ -3262,12 +3232,14 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Gps_Eph
|
||||
Rinex_Printer::log_rinex_nav(out, glonass_gnav_eph_map);
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Gps_CNAV_Ephemeris>& gps_eph_map, const std::map<int, Glonass_Gnav_Ephemeris>& glonass_gnav_eph_map)
|
||||
{
|
||||
Rinex_Printer::log_rinex_nav(out, gps_eph_map);
|
||||
Rinex_Printer::log_rinex_nav(out, glonass_gnav_eph_map);
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo_Ephemeris>& galileo_eph_map, const std::map<int, Glonass_Gnav_Ephemeris>& glonass_gnav_eph_map)
|
||||
{
|
||||
version = 3;
|
||||
@ -3277,7 +3249,6 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int, Galileo
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double d_TOW_first_observation, const std::string glonass_bands)
|
||||
{
|
||||
if(eph.d_m){} //Avoid compiler warning
|
||||
@ -4847,6 +4818,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::fstream & out, const Gps_CNAV_Ephemeris & eph, const double d_TOW_first_observation)
|
||||
{
|
||||
std::string line;
|
||||
@ -5734,7 +5706,6 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps
|
||||
number_of_observations_gal = number_of_observations_gal + 4;
|
||||
}
|
||||
|
||||
|
||||
line += satelliteSystem["Galileo"];
|
||||
line += std::string(2, ' ');
|
||||
line += Rinex_Printer::rightJustify(std::to_string(number_of_observations_gal), 3);
|
||||
@ -6044,7 +6015,6 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeris& eph, const double obs_time, const std::map<int,Gnss_Synchro>& observables, const std::string glonass_band)
|
||||
{
|
||||
// RINEX observations timestamps are GPS timestamps.
|
||||
@ -6128,7 +6098,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
for(observables_iter = observables.begin();
|
||||
observables_iter != observables.end();
|
||||
observables_iter++)
|
||||
@ -7160,7 +7129,6 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c
|
||||
Rinex_Printer::lengthCheck(line);
|
||||
out << line << std::endl;
|
||||
|
||||
|
||||
for(observables_iter = observables.cbegin();
|
||||
observables_iter != observables.cend();
|
||||
observables_iter++)
|
||||
|
@ -204,20 +204,20 @@ public:
|
||||
boost::posix_time::ptime compute_Galileo_time(const Galileo_Ephemeris & eph, const double obs_time);
|
||||
|
||||
/*!
|
||||
* \brief Computes the UTC Time and returns a boost::posix_time::ptime object
|
||||
* \details Function used as a method to convert the observation time into UTC time which is used
|
||||
* as the default time for RINEX files
|
||||
* \param eph GLONASS GNAV Ephemeris object
|
||||
* \param obs_time Observation time in GPS seconds of week
|
||||
*/
|
||||
boost::posix_time::ptime compute_UTC_time(const Glonass_Gnav_Ephemeris & eph, const double obs_time);
|
||||
* \brief Computes the UTC Time and returns a boost::posix_time::ptime object
|
||||
* \details Function used as a method to convert the observation time into UTC time which is used
|
||||
* as the default time for RINEX files
|
||||
* \param eph GLONASS GNAV Ephemeris object
|
||||
* \param obs_time Observation time in GPS seconds of week
|
||||
*/
|
||||
boost::posix_time::ptime compute_UTC_time(const Glonass_Gnav_Ephemeris & eph, const double obs_time);
|
||||
|
||||
/*!
|
||||
* \brief Computes number of leap seconds of GPS relative to UTC
|
||||
* \param eph GLONASS GNAV Ephemeris object
|
||||
* \param gps_obs_time Observation time in GPS seconds of week
|
||||
*/
|
||||
double get_leap_second(const Glonass_Gnav_Ephemeris& eph, const double gps_obs_time);
|
||||
/*!
|
||||
* \brief Computes number of leap seconds of GPS relative to UTC
|
||||
* \param eph GLONASS GNAV Ephemeris object
|
||||
* \param gps_obs_time Observation time in GPS seconds of week
|
||||
*/
|
||||
double get_leap_second(const Glonass_Gnav_Ephemeris& eph, const double gps_obs_time);
|
||||
|
||||
/*!
|
||||
* \brief Writes data from the GPS L1 C/A navigation message into the RINEX file
|
||||
|
@ -150,7 +150,7 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second);
|
||||
//convert observation from GNSS-SDR class to RTKLIB structure
|
||||
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
|
||||
obs_data[valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
galileo_ephemeris_iter->second.WN_5,
|
||||
0);
|
||||
@ -262,7 +262,10 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
//convert ephemeris from GNSS-SDR class to RTKLIB structure
|
||||
eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
|
||||
//convert observation from GNSS-SDR class to RTKLIB structure
|
||||
obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}};
|
||||
unsigned char default_code_ = static_cast<unsigned char>(CODE_NONE);
|
||||
obsd_t newobs = {{0,0}, '0', '0', {}, {},
|
||||
{default_code_, default_code_, default_code_},
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
@ -275,6 +278,53 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
||||
}
|
||||
}
|
||||
//GPS L5
|
||||
if(sig_.compare("L5") == 0)
|
||||
{
|
||||
gps_cnav_ephemeris_iter = gps_cnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (gps_cnav_ephemeris_iter != gps_cnav_ephemeris_map.cend())
|
||||
{
|
||||
// 1. Find the same satellite in GPS L1 band
|
||||
gps_ephemeris_iter = gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
|
||||
if (gps_ephemeris_iter != gps_ephemeris_map.cend())
|
||||
{
|
||||
// 2. If found, replace the existing GPS L1 ephemeris with the GPS L5 ephemeris
|
||||
// (more precise!), and attach the L5 observation to the L1 observation in RTKLIB structure
|
||||
for (int i = 0; i < valid_obs; i++)
|
||||
{
|
||||
if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
|
||||
{
|
||||
eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
|
||||
obs_data[i+glo_valid_obs] = insert_obs_to_rtklib(obs_data[i],
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
2);//Band 3 (L5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3. If not found, insert the GPS L5 ephemeris and the observation
|
||||
//convert ephemeris from GNSS-SDR class to RTKLIB structure
|
||||
eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
|
||||
//convert observation from GNSS-SDR class to RTKLIB structure
|
||||
unsigned char default_code_ = static_cast<unsigned char>(CODE_NONE);
|
||||
obsd_t newobs = {{0,0}, '0', '0', {}, {},
|
||||
{default_code_, default_code_, default_code_},
|
||||
{}, {0.0, 0.0, 0.0}, {}};
|
||||
obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs,
|
||||
gnss_observables_iter->second,
|
||||
gps_cnav_ephemeris_iter->second.i_GPS_week,
|
||||
2);//Band 3 (L5)
|
||||
valid_obs++;
|
||||
}
|
||||
}
|
||||
else // the ephemeris are not available for this SV
|
||||
{
|
||||
DLOG(INFO) << "No ephemeris data for SV " << gnss_observables_iter->second.PRN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'R': //TODO This should be using rtk lib nomenclature
|
||||
@ -374,9 +424,10 @@ bool rtklib_solver::get_PVT(const std::map<int,Gnss_Synchro> & gnss_observables_
|
||||
}
|
||||
|
||||
result = rtkpos(&rtk_, obs_data, valid_obs + glo_valid_obs, &nav_data);
|
||||
|
||||
if(result == 0)
|
||||
{
|
||||
LOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
|
||||
DLOG(INFO) << "RTKLIB rtkpos error message: " << rtk_.errbuf;
|
||||
this->set_time_offset_s(0.0); //reset rx time estimation
|
||||
this->set_num_valid_observations(0);
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
acquire_pilot_ = configuration_->property(role + ".acquire_pilot", false); //will be true in future versions
|
||||
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
|
||||
@ -95,7 +96,6 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_,
|
||||
dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -252,8 +252,19 @@ void GalileoE1PcpsAmbiguousAcquisition::set_local_code()
|
||||
|
||||
std::complex<float> * code = new std::complex<float>[code_length_];
|
||||
|
||||
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
|
||||
if (acquire_pilot_ == true)
|
||||
{
|
||||
//set local signal generator to Galileo E1 pilot component (1C)
|
||||
char pilot_signal[3] = "1C";
|
||||
galileo_e1_code_gen_complex_sampled(code, pilot_signal,
|
||||
cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
galileo_e1_code_gen_complex_sampled(code, gnss_synchro_->Signal,
|
||||
cboc, gnss_synchro_->PRN, fs_in_, 0, false);
|
||||
}
|
||||
|
||||
|
||||
for (unsigned int i = 0; i < sampled_ms_ / 4; i++)
|
||||
{
|
||||
|
@ -146,6 +146,7 @@ private:
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
bool acquire_pilot_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
|
@ -1,3 +1,36 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_pcps_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Glonass L1 C/A signals
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
*
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* 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 "glonass_l1_ca_pcps_acquisition.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <glog/logging.h>
|
||||
@ -7,10 +40,11 @@
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
@ -55,12 +89,14 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition(
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_sc_->unique_id() << ")";
|
||||
|
||||
}else{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
acquisition_cc_ = pcps_make_acquisition_cc(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
|
||||
}
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
@ -260,7 +296,7 @@ float GlonassL1CaPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
frequency_bins = (2*doppler_max_ + doppler_step_)/doppler_step_;
|
||||
|
||||
|
@ -1,3 +1,35 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_pcps_acquisition.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Glonass L1 C/A signals
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
*
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* 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_GLONASS_L1_CA_PCPS_ACQUISITION_H_
|
||||
#define GNSS_SDR_GLONASS_L1_CA_PCPS_ACQUISITION_H_
|
||||
|
@ -130,13 +130,9 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
// For dumping samples into a file
|
||||
d_dump = dump;
|
||||
d_dump_filename = dump_filename;
|
||||
|
||||
d_gnss_synchro = 0;
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
|
||||
d_done = false;
|
||||
d_blocking = blocking;
|
||||
d_new_data_available = false;
|
||||
d_worker_active = false;
|
||||
d_data_buffer = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_fft_size * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
@ -163,19 +159,6 @@ pcps_acquisition_cc::~pcps_acquisition_cc()
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
|
||||
// Let the worker thread know that we are done and then wait to join
|
||||
if( d_worker_thread.joinable() )
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lk( d_mutex );
|
||||
d_done = true;
|
||||
d_cond.notify_one();
|
||||
}
|
||||
|
||||
d_worker_thread.join();
|
||||
}
|
||||
|
||||
volk_gnsssdr_free( d_data_buffer );
|
||||
}
|
||||
|
||||
@ -259,9 +242,6 @@ void pcps_acquisition_cc::init()
|
||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
update_local_carrier(d_grid_doppler_wipeoffs[doppler_index], d_fft_size, d_freq + doppler);
|
||||
}
|
||||
|
||||
d_new_data_available = false;
|
||||
d_done = false;
|
||||
d_worker_active = false;
|
||||
}
|
||||
|
||||
@ -293,6 +273,7 @@ void pcps_acquisition_cc::set_state(int state)
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_active = true;
|
||||
}
|
||||
else if (d_state == 0)
|
||||
{}
|
||||
@ -339,7 +320,7 @@ void pcps_acquisition_cc::send_negative_acquisition()
|
||||
}
|
||||
|
||||
|
||||
int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
int pcps_acquisition_cc::general_work(int noutput_items __attribute__((unused)),
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items __attribute__((unused)))
|
||||
{
|
||||
@ -354,193 +335,157 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
* 6. Declare positive or negative acquisition using a message port
|
||||
*/
|
||||
|
||||
switch (d_state)
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
if(!d_active || d_worker_active)
|
||||
{
|
||||
d_sample_counter += d_fft_size * ninput_items[0];
|
||||
consume_each(ninput_items[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch(d_state)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (d_active)
|
||||
{
|
||||
//restart acquisition variables
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_state = 1;
|
||||
}
|
||||
|
||||
//restart acquisition variables
|
||||
d_gnss_synchro->Acq_delay_samples = 0.0;
|
||||
d_gnss_synchro->Acq_doppler_hz = 0.0;
|
||||
d_gnss_synchro->Acq_samplestamp_samples = 0;
|
||||
d_well_count = 0;
|
||||
d_mag = 0.0;
|
||||
d_input_power = 0.0;
|
||||
d_test_statistics = 0.0;
|
||||
d_state = 1;
|
||||
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
|
||||
consume_each(ninput_items[0]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
std::unique_lock<std::mutex> lk( d_mutex );
|
||||
|
||||
int num_items_consumed = 1;
|
||||
|
||||
if( d_worker_active )
|
||||
// Copy the data to the core and let it know that new data is available
|
||||
memcpy(d_data_buffer, input_items[0], d_fft_size * sizeof(gr_complex));
|
||||
if(d_blocking)
|
||||
{
|
||||
if( d_blocking )
|
||||
{
|
||||
// Should never get here:
|
||||
std::string msg = "pcps_acquisition_cc: Entered general work with worker active in blocking mode, should never happen";
|
||||
LOG(WARNING) << msg;
|
||||
std::cout << msg << std::endl;
|
||||
d_cond.wait( lk, [&]{ return !this->d_worker_active; } );
|
||||
}
|
||||
else
|
||||
{
|
||||
num_items_consumed = ninput_items[0];
|
||||
d_sample_counter += d_fft_size * num_items_consumed;
|
||||
}
|
||||
lk.unlock();
|
||||
acquisition_core(d_sample_counter);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy the data to the core and let it know that new data is available
|
||||
memcpy( d_data_buffer, input_items[0], d_fft_size * sizeof( gr_complex ) );
|
||||
d_new_data_available = true;
|
||||
d_cond.notify_one();
|
||||
|
||||
if( d_blocking )
|
||||
{
|
||||
d_cond.wait( lk, [&]{ return !this->d_new_data_available; } );
|
||||
|
||||
}
|
||||
gr::thread::thread d_worker(&pcps_acquisition_cc::acquisition_core, this, d_sample_counter);
|
||||
d_worker_active = true;
|
||||
}
|
||||
|
||||
consume_each(num_items_consumed);
|
||||
|
||||
d_sample_counter += d_fft_size;
|
||||
consume_each(1);
|
||||
break;
|
||||
} // case 1, switch d_state
|
||||
|
||||
} // switch d_state
|
||||
|
||||
return noutput_items;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_cc::acquisition_core( void )
|
||||
void pcps_acquisition_cc::acquisition_core( unsigned long int samp_count )
|
||||
{
|
||||
d_worker_active = false;
|
||||
while( 1 )
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
|
||||
// initialize acquisition algorithm
|
||||
int doppler;
|
||||
uint32_t indext = 0;
|
||||
float magt = 0.0;
|
||||
const gr_complex *in = d_data_buffer; //Get the input samples pointer
|
||||
|
||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
d_well_count++;
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << samp_count << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step
|
||||
<< ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" );
|
||||
|
||||
lk.unlock();
|
||||
if (d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk( d_mutex );
|
||||
d_cond.wait( lk, [&]{ return this->d_new_data_available or this->d_done; } );
|
||||
d_worker_active = !d_done;
|
||||
unsigned long int sample_counter = d_sample_counter; // sample counter
|
||||
lk.unlock();
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
|
||||
if( d_done )
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in, d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
|
||||
|
||||
// 3- Perform the FFT-based convolution (parallel time search)
|
||||
// Compute the FFT of the carrier wiped--off incoming signal
|
||||
d_fft_if->execute();
|
||||
|
||||
// Multiply carrier wiped--off, Fourier transformed incoming signal
|
||||
// with the local FFT'd code reference using SIMD operations with VOLK library
|
||||
volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(), d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
|
||||
|
||||
// compute the inverse FFT
|
||||
d_ifft->execute();
|
||||
|
||||
// Search maximum
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
break;
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
|
||||
// initialize acquisition algorithm
|
||||
int doppler;
|
||||
uint32_t indext = 0;
|
||||
float magt = 0.0;
|
||||
const gr_complex *in = d_data_buffer; //Get the input samples pointer
|
||||
|
||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
d_input_power = 0.0;
|
||||
d_mag = 0.0;
|
||||
d_well_count++;
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << sample_counter << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step
|
||||
<< ", use_CFAR_algorithm_flag: " << ( d_use_CFAR_algorithm_flag ? "true" : "false" );
|
||||
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, d_fft_size);
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
d_mag = magt;
|
||||
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in,
|
||||
d_grid_doppler_wipeoffs[doppler_index], d_fft_size);
|
||||
|
||||
// 3- Perform the FFT-based convolution (parallel time search)
|
||||
// Compute the FFT of the carrier wiped--off incoming signal
|
||||
d_fft_if->execute();
|
||||
|
||||
// Multiply carrier wiped--off, Fourier transformed incoming signal
|
||||
// with the local FFT'd code reference using SIMD operations with VOLK library
|
||||
volk_32fc_x2_multiply_32fc(d_ifft->get_inbuf(),
|
||||
d_fft_if->get_outbuf(), d_fft_codes, d_fft_size);
|
||||
|
||||
// compute the inverse FFT
|
||||
d_ifft->execute();
|
||||
|
||||
// Search maximum
|
||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
|
||||
volk_gnsssdr_32f_index_max_32u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
if (!d_use_CFAR_algorithm_flag)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag == false)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
// new maximum test statistics (d_mag/d_input_power) with the value in
|
||||
// d_test_statistics. When the second dwell is being processed, the value
|
||||
// of d_mag/d_input_power could be lower than d_test_statistics (i.e,
|
||||
// the maximum test statistics in the previous dwell is greater than
|
||||
// current d_mag/d_input_power). Note that d_test_statistics is not
|
||||
// restarted between consecutive dwells in multidwell operation.
|
||||
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
|
||||
d_gnss_synchro->Acq_samplestamp_samples = sample_counter;
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
//d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
}
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
}
|
||||
|
||||
// Record results to file if required
|
||||
if (d_dump)
|
||||
{
|
||||
std::stringstream filename;
|
||||
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
|
||||
filename.str("");
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
// new maximum test statistics (d_mag/d_input_power) with the value in
|
||||
// d_test_statistics. When the second dwell is being processed, the value
|
||||
// of d_mag/d_input_power could be lower than d_test_statistics (i.e,
|
||||
// the maximum test statistics in the previous dwell is greater than
|
||||
// current d_mag/d_input_power). Note that d_test_statistics is not
|
||||
// restarted between consecutive dwells in multidwell operation.
|
||||
|
||||
boost::filesystem::path p = d_dump_filename;
|
||||
filename << p.parent_path().string()
|
||||
if (d_test_statistics < (d_mag / d_input_power) || !d_bit_transition_flag)
|
||||
{
|
||||
d_gnss_synchro->Acq_delay_samples = static_cast<double>(indext % d_samples_per_code);
|
||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler);
|
||||
d_gnss_synchro->Acq_samplestamp_samples = samp_count;
|
||||
|
||||
// 5- Compute the test statistics and compare to the threshold
|
||||
//d_test_statistics = 2 * d_fft_size * d_mag / d_input_power;
|
||||
d_test_statistics = d_mag / d_input_power;
|
||||
}
|
||||
}
|
||||
// Record results to file if required
|
||||
if (d_dump)
|
||||
{
|
||||
std::stringstream filename;
|
||||
std::streamsize n = 2 * sizeof(float) * (d_fft_size); // complex file write
|
||||
filename.str("");
|
||||
boost::filesystem::path p = d_dump_filename;
|
||||
filename << p.parent_path().string()
|
||||
<< boost::filesystem::path::preferred_separator
|
||||
<< p.stem().string()
|
||||
<< "_" << d_gnss_synchro->System
|
||||
@ -549,15 +494,32 @@ void pcps_acquisition_cc::acquisition_core( void )
|
||||
<< doppler
|
||||
<< p.extension().string();
|
||||
|
||||
DLOG(INFO) << "Writing ACQ out to " << filename.str();
|
||||
DLOG(INFO) << "Writing ACQ out to " << filename.str();
|
||||
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||
d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
d_dump_file.close();
|
||||
}
|
||||
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||
d_dump_file.write(reinterpret_cast<char*>(d_ifft->get_outbuf()), n); //write directly |abs(x)|^2 in this Doppler bin?
|
||||
d_dump_file.close();
|
||||
}
|
||||
|
||||
if (!d_bit_transition_flag)
|
||||
}
|
||||
lk.lock();
|
||||
if (!d_bit_transition_flag)
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_state = 0; // Positive acquisition
|
||||
d_active = false;
|
||||
send_positive_acquisition();
|
||||
}
|
||||
else if (d_well_count == d_max_dwells)
|
||||
{
|
||||
d_state = 0;
|
||||
d_active = false;
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_well_count == d_max_dwells) // d_max_dwells = 2
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
@ -565,66 +527,13 @@ void pcps_acquisition_cc::acquisition_core( void )
|
||||
d_active = false;
|
||||
send_positive_acquisition();
|
||||
}
|
||||
else if (d_well_count == d_max_dwells)
|
||||
else
|
||||
{
|
||||
d_state = 0;
|
||||
d_state = 0; // Negative acquisition
|
||||
d_active = false;
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (d_well_count == d_max_dwells) // d_max_dwells = 2
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
{
|
||||
d_state = 0; // Positive acquisition
|
||||
d_active = false;
|
||||
send_positive_acquisition();
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 0; // Negative acquisition
|
||||
d_active = false;
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lk.lock();
|
||||
d_worker_active = false;
|
||||
d_new_data_available = false;
|
||||
lk.unlock();
|
||||
d_cond.notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool pcps_acquisition_cc::start( void )
|
||||
{
|
||||
d_worker_active = false;
|
||||
d_done = false;
|
||||
|
||||
// Start the worker thread and wait for it to acknowledge:
|
||||
d_worker_thread = std::move( std::thread( &pcps_acquisition_cc::acquisition_core, this ) );
|
||||
|
||||
return gr::block::start();
|
||||
}
|
||||
|
||||
|
||||
bool pcps_acquisition_cc::stop( void )
|
||||
{
|
||||
// Let the worker thread know that we are done and then wait to join
|
||||
if( d_worker_thread.joinable() )
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lk( d_mutex );
|
||||
d_done = true;
|
||||
d_cond.notify_one();
|
||||
}
|
||||
|
||||
d_worker_thread.join();
|
||||
}
|
||||
return gr::block::stop();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
* <li> Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* <li> Marc Molina, 2013. marc.molina.pena@gmail.com
|
||||
* <li> Cillian O'Driscoll, 2017. cillian(at)ieee.org
|
||||
* <li> Antonio Ramos, 2017. antonio.ramos@cttc.es
|
||||
* </ul>
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -53,14 +54,10 @@
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <condition_variable>
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/gr_complex.h>
|
||||
#include <gnuradio/fft/fft.h>
|
||||
#include "gnss_synchro.h"
|
||||
#include "GLONASS_L1_CA.h" //GLONASS_TWO_PI
|
||||
|
||||
class pcps_acquisition_cc;
|
||||
|
||||
@ -102,7 +99,7 @@ private:
|
||||
void update_grid_doppler_wipeoffs();
|
||||
bool is_fdma();
|
||||
|
||||
void acquisition_core( void );
|
||||
void acquisition_core( unsigned long int samp_count );
|
||||
|
||||
void send_negative_acquisition();
|
||||
void send_positive_acquisition();
|
||||
@ -113,7 +110,6 @@ private:
|
||||
int d_samples_per_code;
|
||||
//unsigned int d_doppler_resolution;
|
||||
float d_threshold;
|
||||
std::string d_satellite_str;
|
||||
unsigned int d_doppler_max;
|
||||
unsigned int d_doppler_step;
|
||||
unsigned int d_sampled_ms;
|
||||
@ -141,16 +137,8 @@ private:
|
||||
bool d_dump;
|
||||
unsigned int d_channel;
|
||||
std::string d_dump_filename;
|
||||
|
||||
std::thread d_worker_thread;
|
||||
std::mutex d_mutex;
|
||||
|
||||
std::condition_variable d_cond;
|
||||
bool d_done;
|
||||
bool d_new_data_available;
|
||||
bool d_worker_active;
|
||||
bool d_blocking;
|
||||
|
||||
gr_complex *d_data_buffer;
|
||||
|
||||
public:
|
||||
@ -255,15 +243,6 @@ public:
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
/*!
|
||||
* Called by the flowgraph when processing is about to start.
|
||||
*/
|
||||
bool start( void );
|
||||
|
||||
/*!
|
||||
* Called by the flowgraph when processing is done.
|
||||
*/
|
||||
bool stop( void );
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_PCPS_ACQUISITION_CC_H_*/
|
||||
|
@ -40,7 +40,7 @@ using google::LogMessage;
|
||||
Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
std::shared_ptr<GNSSBlockInterface> pass_through, std::shared_ptr<AcquisitionInterface> acq,
|
||||
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
|
||||
std::string role, std::string implementation, boost::shared_ptr<gr::msg_queue> queue)
|
||||
std::string role, std::string implementation, gr::msg_queue::sptr queue)
|
||||
{
|
||||
pass_through_ = pass_through;
|
||||
acq_ = acq;
|
||||
@ -50,6 +50,7 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
implementation_ = implementation;
|
||||
channel_ = channel;
|
||||
queue_ = queue;
|
||||
channel_fsm_ = std::make_shared<ChannelFsm>();
|
||||
|
||||
flag_enable_fpga = configuration->property("Channel.enable_FPGA", false);
|
||||
acq_->set_channel(channel_);
|
||||
@ -89,24 +90,21 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".repeat_satellite", false);
|
||||
DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_;
|
||||
|
||||
channel_fsm_.set_acquisition(acq_);
|
||||
channel_fsm_.set_tracking(trk_);
|
||||
channel_fsm_.set_channel(channel_);
|
||||
channel_fsm_.set_queue(queue_);
|
||||
channel_fsm_->set_acquisition(acq_);
|
||||
channel_fsm_->set_tracking(trk_);
|
||||
channel_fsm_->set_channel(channel_);
|
||||
channel_fsm_->set_queue(queue_);
|
||||
|
||||
connected_ = false;
|
||||
|
||||
gnss_signal_ = Gnss_Signal(implementation_);
|
||||
|
||||
channel_msg_rx = channel_msg_receiver_make_cc(&channel_fsm_, repeat_);
|
||||
channel_msg_rx = channel_msg_receiver_make_cc(channel_fsm_, repeat_);
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
Channel::~Channel()
|
||||
{
|
||||
channel_fsm_.terminate();
|
||||
}
|
||||
Channel::~Channel(){}
|
||||
|
||||
|
||||
void Channel::connect(gr::top_block_sptr top_block)
|
||||
@ -139,7 +137,6 @@ void Channel::connect(gr::top_block_sptr top_block)
|
||||
top_block->msg_connect(nav_->get_left_block(), pmt::mp("preamble_timestamp_s"), trk_->get_right_block(), pmt::mp("preamble_timestamp_s"));
|
||||
DLOG(INFO) << "MSG FEEDBACK CHANNEL telemetry_decoder -> tracking";
|
||||
|
||||
//std::cout<<"has port: "<<trk_->get_right_block()->has_msg_port(pmt::mp("events"))<<std::endl;
|
||||
top_block->msg_connect(acq_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
|
||||
top_block->msg_connect(trk_->get_right_block(), pmt::mp("events"), channel_msg_rx, pmt::mp("events"));
|
||||
|
||||
@ -187,6 +184,7 @@ gr::basic_block_sptr Channel::get_right_block()
|
||||
|
||||
void Channel::set_signal(const Gnss_Signal& gnss_signal)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
gnss_signal_ = gnss_signal;
|
||||
std::string str_aux = gnss_signal_.get_signal_str();
|
||||
const char * str = str_aux.c_str(); // get a C style null terminated string
|
||||
@ -201,6 +199,14 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal)
|
||||
|
||||
void Channel::start_acquisition()
|
||||
{
|
||||
channel_fsm_.Event_start_acquisition();
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
bool result = false;
|
||||
result = channel_fsm_->Event_start_acquisition();
|
||||
if(!result)
|
||||
{
|
||||
LOG(WARNING) << "Invalid channel event";
|
||||
return;
|
||||
}
|
||||
DLOG(INFO) << "Channel start_acquisition()";
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gnuradio/block.h>
|
||||
#include "channel_interface.h"
|
||||
@ -63,8 +64,7 @@ public:
|
||||
Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
std::shared_ptr<GNSSBlockInterface> pass_through, std::shared_ptr<AcquisitionInterface> acq,
|
||||
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
|
||||
std::string role, std::string implementation,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
std::string role, std::string implementation, gr::msg_queue::sptr queue);
|
||||
//! Virtual destructor
|
||||
virtual ~Channel();
|
||||
|
||||
@ -79,6 +79,7 @@ public:
|
||||
inline std::string implementation() override { return implementation_; }
|
||||
|
||||
inline size_t item_size() override { return 0; }
|
||||
|
||||
inline Gnss_Signal get_signal() const override { return gnss_signal_; }
|
||||
|
||||
void start_acquisition() override; //!< Start the State Machine
|
||||
@ -104,8 +105,9 @@ private:
|
||||
Gnss_Signal gnss_signal_;
|
||||
bool connected_;
|
||||
bool repeat_;
|
||||
ChannelFsm channel_fsm_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
std::shared_ptr<ChannelFsm> channel_fsm_;
|
||||
gr::msg_queue::sptr queue_;
|
||||
std::mutex mx;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_CHANNEL_H_*/
|
||||
|
@ -1,11 +1,12 @@
|
||||
/*!
|
||||
* \file channel_fsm.cc
|
||||
* \brief Implementation of a State Machine for channel using boost::statechart
|
||||
* \author Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
||||
* \brief Implementation of a State Machine for channel
|
||||
* \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es
|
||||
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@ -29,109 +30,16 @@
|
||||
*/
|
||||
|
||||
#include "channel_fsm.h"
|
||||
#include <memory>
|
||||
#include <boost/statechart/simple_state.hpp>
|
||||
#include <boost/statechart/state.hpp>
|
||||
#include <boost/statechart/transition.hpp>
|
||||
#include <boost/statechart/custom_reaction.hpp>
|
||||
#include <boost/mpl/list.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include "control_message_factory.h"
|
||||
|
||||
|
||||
struct Ev_channel_start_acquisition: sc::event<Ev_channel_start_acquisition>
|
||||
{};
|
||||
|
||||
struct Ev_channel_valid_acquisition: sc::event<Ev_channel_valid_acquisition>
|
||||
{};
|
||||
|
||||
struct Ev_channel_failed_acquisition_repeat: sc::event<Ev_channel_failed_acquisition_repeat>
|
||||
{};
|
||||
|
||||
struct Ev_channel_failed_acquisition_no_repeat: sc::event<Ev_channel_failed_acquisition_no_repeat>
|
||||
{};
|
||||
|
||||
struct Ev_channel_failed_tracking_standby: sc::event<Ev_channel_failed_tracking_standby>
|
||||
{};
|
||||
|
||||
//struct Ev_channel_failed_tracking_reacq: sc::event<Ev_channel_failed_tracking_reacq>
|
||||
//{};
|
||||
|
||||
struct channel_idle_fsm_S0: public sc::state<channel_idle_fsm_S0, ChannelFsm>
|
||||
{
|
||||
public:
|
||||
// sc::transition(event, next state)
|
||||
typedef sc::transition<Ev_channel_start_acquisition, channel_acquiring_fsm_S1> reactions;
|
||||
channel_idle_fsm_S0(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_Idle_S0 " << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct channel_acquiring_fsm_S1: public sc::state<channel_acquiring_fsm_S1, ChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef mpl::list<sc::transition<Ev_channel_failed_acquisition_no_repeat, channel_waiting_fsm_S3>,
|
||||
sc::transition<Ev_channel_failed_acquisition_repeat, channel_acquiring_fsm_S1>,
|
||||
sc::transition<Ev_channel_valid_acquisition, channel_tracking_fsm_S2> > reactions;
|
||||
|
||||
channel_acquiring_fsm_S1(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_Acq_S1 " << std::endl;
|
||||
context<ChannelFsm> ().start_acquisition();
|
||||
}
|
||||
~channel_acquiring_fsm_S1()
|
||||
{
|
||||
//std::cout << "Exit Channel_Acq_S1 " << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct channel_tracking_fsm_S2: public sc::state<channel_tracking_fsm_S2, ChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef mpl::list<sc::transition<Ev_channel_failed_tracking_standby, channel_idle_fsm_S0>,
|
||||
sc::transition<Ev_channel_start_acquisition, channel_acquiring_fsm_S1>> reactions;
|
||||
|
||||
channel_tracking_fsm_S2(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_tracking_S2 " << std::endl;
|
||||
context<ChannelFsm> ().start_tracking();
|
||||
}
|
||||
|
||||
~channel_tracking_fsm_S2()
|
||||
{
|
||||
//std::cout << "Exit Channel_tracking_S2 " << std::endl;
|
||||
context<ChannelFsm> ().notify_stop_tracking();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct channel_waiting_fsm_S3: public sc::state<channel_waiting_fsm_S3, ChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef sc::transition<Ev_channel_start_acquisition,
|
||||
channel_acquiring_fsm_S1> reactions;
|
||||
|
||||
channel_waiting_fsm_S3(my_context ctx) :
|
||||
my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_waiting_S3 " << std::endl;
|
||||
context<ChannelFsm> ().request_satellite();
|
||||
}
|
||||
// ~channel_waiting_fsm_S3(){}
|
||||
};
|
||||
|
||||
|
||||
|
||||
ChannelFsm::ChannelFsm()
|
||||
{
|
||||
acq_ = nullptr;
|
||||
trk_ = nullptr;
|
||||
channel_ = 0;
|
||||
initiate(); //start the FSM
|
||||
d_state = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -141,62 +49,115 @@ ChannelFsm::ChannelFsm(std::shared_ptr<AcquisitionInterface> acquisition) :
|
||||
{
|
||||
trk_ = nullptr;
|
||||
channel_ = 0;
|
||||
initiate(); //start the FSM
|
||||
d_state = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ChannelFsm::Event_start_acquisition()
|
||||
bool ChannelFsm::Event_start_acquisition()
|
||||
{
|
||||
this->process_event(Ev_channel_start_acquisition());
|
||||
//std::cout<<"Ev_channel_start_acquisition launched"<<std::endl;
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
if((d_state == 1) || (d_state == 2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 1;
|
||||
start_acquisition();
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::Event_valid_acquisition()
|
||||
bool ChannelFsm::Event_valid_acquisition()
|
||||
{
|
||||
this->process_event(Ev_channel_valid_acquisition());
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
if(d_state != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 2;
|
||||
start_tracking();
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev valid acquisition";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ChannelFsm::Event_failed_acquisition_repeat()
|
||||
bool ChannelFsm::Event_failed_acquisition_repeat()
|
||||
{
|
||||
this->process_event(Ev_channel_failed_acquisition_repeat());
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
if(d_state != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 1;
|
||||
start_acquisition();
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition repeat";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelFsm::Event_failed_acquisition_no_repeat()
|
||||
|
||||
bool ChannelFsm::Event_failed_acquisition_no_repeat()
|
||||
{
|
||||
this->process_event(Ev_channel_failed_acquisition_no_repeat());
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
if(d_state != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 3;
|
||||
request_satellite();
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev failed acquisition no repeat";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Something is wrong here, we are using a memory after it ts freed
|
||||
void ChannelFsm::Event_failed_tracking_standby()
|
||||
bool ChannelFsm::Event_failed_tracking_standby()
|
||||
{
|
||||
this->process_event(Ev_channel_failed_tracking_standby());
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
if(d_state != 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_state = 0;
|
||||
notify_stop_tracking();
|
||||
DLOG(INFO) << "CH = " << channel_ << ". Ev failed tracking standby";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//void ChannelFsm::Event_failed_tracking_reacq() {
|
||||
// this->process_event(Ev_channel_failed_tracking_reacq());
|
||||
//}
|
||||
|
||||
void ChannelFsm::set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
acq_ = acquisition;
|
||||
}
|
||||
|
||||
void ChannelFsm::set_tracking(std::shared_ptr<TrackingInterface> tracking)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
trk_ = tracking;
|
||||
}
|
||||
|
||||
void ChannelFsm::set_queue(boost::shared_ptr<gr::msg_queue> queue)
|
||||
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
queue_ = queue;
|
||||
}
|
||||
|
||||
void ChannelFsm::set_channel(unsigned int channel)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(mx);
|
||||
channel_ = channel;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*!
|
||||
* \file channel_fsm.h
|
||||
* \brief Interface of the State Machine for channel using boost::statechart
|
||||
* \author Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
||||
*
|
||||
* \brief Interface of the State Machine for channel
|
||||
* \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es
|
||||
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@ -32,26 +32,17 @@
|
||||
#ifndef GNSS_SDR_CHANNEL_FSM_H
|
||||
#define GNSS_SDR_CHANNEL_FSM_H
|
||||
|
||||
|
||||
#include <boost/statechart/state_machine.hpp>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "acquisition_interface.h"
|
||||
#include "tracking_interface.h"
|
||||
#include "telemetry_decoder_interface.h"
|
||||
|
||||
|
||||
namespace sc = boost::statechart;
|
||||
namespace mpl = boost::mpl;
|
||||
|
||||
struct channel_idle_fsm_S0;
|
||||
struct channel_acquiring_fsm_S1;
|
||||
struct channel_tracking_fsm_S2;
|
||||
struct channel_waiting_fsm_S3;
|
||||
|
||||
/*!
|
||||
* \brief This class implements a State Machine for channel using boost::statechart
|
||||
* \brief This class implements a State Machine for channel
|
||||
*/
|
||||
class ChannelFsm: public sc::state_machine<ChannelFsm, channel_idle_fsm_S0>
|
||||
class ChannelFsm
|
||||
{
|
||||
public:
|
||||
ChannelFsm();
|
||||
@ -59,26 +50,29 @@ public:
|
||||
|
||||
void set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition);
|
||||
void set_tracking(std::shared_ptr<TrackingInterface> tracking);
|
||||
void set_queue(boost::shared_ptr<gr::msg_queue> queue);
|
||||
void set_queue(gr::msg_queue::sptr queue);
|
||||
void set_channel(unsigned int channel);
|
||||
|
||||
//FSM EVENTS
|
||||
bool Event_start_acquisition();
|
||||
bool Event_valid_acquisition();
|
||||
bool Event_failed_acquisition_repeat();
|
||||
bool Event_failed_acquisition_no_repeat();
|
||||
bool Event_failed_tracking_standby();
|
||||
|
||||
private:
|
||||
|
||||
void start_acquisition();
|
||||
void start_tracking();
|
||||
void request_satellite();
|
||||
void notify_stop_tracking();
|
||||
|
||||
//FSM EVENTS
|
||||
void Event_start_acquisition();
|
||||
void Event_valid_acquisition();
|
||||
void Event_failed_acquisition_repeat();
|
||||
void Event_failed_acquisition_no_repeat();
|
||||
//void Event_gps_failed_tracking_reacq();
|
||||
void Event_failed_tracking_standby();
|
||||
|
||||
private:
|
||||
std::shared_ptr<AcquisitionInterface> acq_;
|
||||
std::shared_ptr<TrackingInterface> trk_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
gr::msg_queue::sptr queue_;
|
||||
unsigned int channel_;
|
||||
unsigned int d_state;
|
||||
std::mutex mx;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_CHANNEL_FSM_H*/
|
||||
|
@ -37,37 +37,34 @@
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat)
|
||||
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat)
|
||||
{
|
||||
return channel_msg_receiver_cc_sptr(new channel_msg_receiver_cc(channel_fsm, repeat));
|
||||
}
|
||||
|
||||
void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
bool result = false;
|
||||
try
|
||||
{
|
||||
long int message = pmt::to_long(msg);
|
||||
switch (message)
|
||||
{
|
||||
case 1: //positive acquisition
|
||||
//DLOG(INFO) << "Channel " << channel_ << " ACQ SUCCESS satellite " <<
|
||||
// gnss_synchro_.System << " " << gnss_synchro_.PRN;
|
||||
d_channel_fsm->Event_valid_acquisition();
|
||||
result = d_channel_fsm->Event_valid_acquisition();
|
||||
break;
|
||||
case 2: //negative acquisition
|
||||
//DLOG(INFO) << "Channel " << channel_
|
||||
// << " ACQ FAILED satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
|
||||
if (d_repeat == true)
|
||||
{
|
||||
d_channel_fsm->Event_failed_acquisition_repeat();
|
||||
result = d_channel_fsm->Event_failed_acquisition_repeat();
|
||||
}
|
||||
else
|
||||
{
|
||||
d_channel_fsm->Event_failed_acquisition_no_repeat();
|
||||
result = d_channel_fsm->Event_failed_acquisition_no_repeat();
|
||||
}
|
||||
break;
|
||||
case 3: // tracking loss of lock event
|
||||
d_channel_fsm->Event_failed_tracking_standby();
|
||||
result = d_channel_fsm->Event_failed_tracking_standby();
|
||||
break;
|
||||
default:
|
||||
LOG(WARNING) << "Default case, invalid message.";
|
||||
@ -78,10 +75,14 @@ void channel_msg_receiver_cc::msg_handler_events(pmt::pmt_t msg)
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry Bad any cast!";
|
||||
}
|
||||
if(!result)
|
||||
{
|
||||
LOG(WARNING) << "msg_handler_telemetry invalid event";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
channel_msg_receiver_cc::channel_msg_receiver_cc(ChannelFsm* channel_fsm, bool repeat) :
|
||||
channel_msg_receiver_cc::channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat) :
|
||||
gr::block("channel_msg_receiver_cc", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
|
||||
{
|
||||
this->message_port_register_in(pmt::mp("events"));
|
||||
|
@ -38,7 +38,7 @@ class channel_msg_receiver_cc;
|
||||
|
||||
typedef boost::shared_ptr<channel_msg_receiver_cc> channel_msg_receiver_cc_sptr;
|
||||
|
||||
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat);
|
||||
channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
|
||||
/*!
|
||||
* \brief GNU Radio block that receives asynchronous channel messages from acquisition and tracking blocks
|
||||
@ -46,11 +46,11 @@ channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fs
|
||||
class channel_msg_receiver_cc : public gr::block
|
||||
{
|
||||
private:
|
||||
ChannelFsm* d_channel_fsm;
|
||||
std::shared_ptr<ChannelFsm> d_channel_fsm;
|
||||
bool d_repeat; // todo: change FSM to include repeat value
|
||||
friend channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(ChannelFsm* channel_fsm, bool repeat);
|
||||
friend channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
void msg_handler_events(pmt::pmt_t msg);
|
||||
channel_msg_receiver_cc(ChannelFsm* channel_fsm, bool repeat);
|
||||
channel_msg_receiver_cc(std::shared_ptr<ChannelFsm> channel_fsm, bool repeat);
|
||||
|
||||
public:
|
||||
~channel_msg_receiver_cc (); //!< Default destructor
|
||||
|
@ -186,7 +186,7 @@ void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
|
||||
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn);
|
||||
make_l5i(_code, _prn - 1);
|
||||
}
|
||||
|
||||
for (signed int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
|
||||
@ -206,7 +206,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _
|
||||
int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn);
|
||||
make_l5i(_code, _prn - 1);
|
||||
}
|
||||
|
||||
signed int _samplesPerCode, _codeValueIndex;
|
||||
@ -253,7 +253,7 @@ void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
|
||||
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn);
|
||||
make_l5q(_code, _prn - 1);
|
||||
}
|
||||
|
||||
for (signed int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
|
||||
@ -273,7 +273,7 @@ void gps_l5q_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _
|
||||
int32_t* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn);
|
||||
make_l5q(_code, _prn - 1);
|
||||
}
|
||||
|
||||
signed int _samplesPerCode, _codeValueIndex;
|
||||
|
@ -35,7 +35,7 @@ obsd_t insert_obs_to_rtklib(obsd_t & rtklib_obs, const Gnss_Synchro & gnss_synch
|
||||
{
|
||||
rtklib_obs.D[band] = gnss_synchro.Carrier_Doppler_hz;
|
||||
rtklib_obs.P[band] = gnss_synchro.Pseudorange_m;
|
||||
rtklib_obs.L[band] = gnss_synchro.Carrier_phase_rads / (2.0 * PI);
|
||||
rtklib_obs.L[band] = gnss_synchro.Carrier_phase_rads / PI_2;
|
||||
switch(band)
|
||||
{
|
||||
case 0:
|
||||
@ -209,8 +209,6 @@ eph_t eph_to_rtklib(const Gps_Ephemeris & gps_eph)
|
||||
rtklib_sat.toc = gpst2time(rtklib_sat.week, toc);
|
||||
rtklib_sat.ttr = gpst2time(rtklib_sat.week, tow);
|
||||
|
||||
//printf("EPHEMERIS TIME [%i]: %s,%f\n\r",rtklib_sat.sat,time_str(rtklib_sat.toe,3),rtklib_sat.toe.sec);
|
||||
|
||||
return rtklib_sat;
|
||||
}
|
||||
|
||||
@ -227,7 +225,7 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris & gps_cnav_eph)
|
||||
rtklib_sat.OMG0 = gps_cnav_eph.d_OMEGA0;
|
||||
// Compute the angle between the ascending node and the Greenwich meridian
|
||||
const double OMEGA_DOT_REF = -2.6e-9; // semicircles / s, see IS-GPS-200H pp. 164
|
||||
double d_OMEGA_DOT = OMEGA_DOT_REF * GPS_L2_PI + gps_cnav_eph.d_DELTA_OMEGA_DOT;
|
||||
double d_OMEGA_DOT = OMEGA_DOT_REF * PI + gps_cnav_eph.d_DELTA_OMEGA_DOT;
|
||||
rtklib_sat.OMGd = d_OMEGA_DOT;
|
||||
rtklib_sat.omg = gps_cnav_eph.d_OMEGA;
|
||||
rtklib_sat.i0 = gps_cnav_eph.d_i_0;
|
||||
|
@ -97,7 +97,13 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
|
||||
|
||||
|
||||
/* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */
|
||||
if (NFREQ >= 3 && (sys & (SYS_GAL | SYS_SBS))) j = 2;
|
||||
if (sys & (SYS_GAL | SYS_SBS)) {j = 2;}
|
||||
|
||||
if (sys == SYS_GPS)
|
||||
{
|
||||
if(obs->code[1] != CODE_NONE) {j = 1;}
|
||||
else if(obs->code[2] != CODE_NONE) {j = 2;}
|
||||
}
|
||||
|
||||
if (NFREQ<2 || lam[i] == 0.0 || lam[j] == 0.0)
|
||||
{
|
||||
@ -132,7 +138,7 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
|
||||
P2_C2 = nav->cbias[obs->sat-1][2];
|
||||
|
||||
/* if no P1-P2 DCB, use TGD instead */
|
||||
if (P1_P2 == 0.0 && (sys & (SYS_GPS | SYS_GAL | SYS_QZS)))
|
||||
if (P1_P2 == 0.0 && (sys & (SYS_GPS | SYS_GAL | SYS_QZS))) //CHECK!
|
||||
{
|
||||
P1_P2 = (1.0 - gamma_) * gettgd(obs->sat, nav);
|
||||
}
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include <utility>
|
||||
#include <armadillo>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <gnuradio/block_detail.h>
|
||||
#include <gnuradio/buffer.h>
|
||||
#include <glog/logging.h>
|
||||
#include <matio.h>
|
||||
#include "Galileo_E1.h"
|
||||
@ -52,8 +54,8 @@ hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels, bo
|
||||
|
||||
|
||||
hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history) :
|
||||
gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
|
||||
gr::block("hybrid_observables_cc", gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
// initialize internal vars
|
||||
d_dump = dump;
|
||||
@ -66,11 +68,6 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels, bool dump,
|
||||
{
|
||||
d_gnss_synchro_history_queue.push_back(std::deque<Gnss_Synchro>());
|
||||
}
|
||||
// todo: this is a gnuradio scheduler hack.
|
||||
// Migrate the queues to gnuradio set_history to see if the scheduler can handle
|
||||
// the multiple output flow
|
||||
d_max_noutputs = 100;
|
||||
this->set_min_noutput_items(100);
|
||||
|
||||
// ############# ENABLE DATA FILE LOG #################
|
||||
if (d_dump == true)
|
||||
@ -313,7 +310,7 @@ bool Hybrid_valueCompare_gnss_synchro_sample_counter(const Gnss_Synchro& a, unsi
|
||||
|
||||
bool Hybrid_valueCompare_gnss_synchro_receiver_time(const Gnss_Synchro& a, double b)
|
||||
{
|
||||
return (((double)a.Tracking_sample_counter+a.Code_phase_samples)/(double)a.fs) < (b);
|
||||
return ((static_cast<double>(a.Tracking_sample_counter) + static_cast<double>(a.Code_phase_samples)) / static_cast<double>(a.fs) ) < (b);
|
||||
}
|
||||
|
||||
|
||||
@ -329,7 +326,27 @@ bool Hybrid_valueCompare_gnss_synchro_d_TOW(const Gnss_Synchro& a, double b)
|
||||
}
|
||||
|
||||
|
||||
int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused)),
|
||||
void hybrid_observables_cc::forecast (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items_required)
|
||||
{
|
||||
bool zero_samples = true;
|
||||
for(unsigned int i = 0; i < d_nchannels; i++)
|
||||
{
|
||||
int items = detail()->input(i)->items_available();
|
||||
if (items > 0) zero_samples = false;
|
||||
ninput_items_required[i] = items; // set the required available samples in each call
|
||||
}
|
||||
|
||||
if (zero_samples == true)
|
||||
{
|
||||
for(unsigned int i = 0; i < d_nchannels; i++)
|
||||
{
|
||||
ninput_items_required[i] = 1; // set the required available samples in each call
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int hybrid_observables_cc::general_work (int noutput_items ,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
@ -353,7 +370,7 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
|
||||
*/
|
||||
for (unsigned int i = 0; i < d_nchannels; i++)
|
||||
{
|
||||
n_consume[i] = ninput_items[i];// full throttle
|
||||
n_consume[i] = ninput_items[i]; // full throttle
|
||||
for (int j = 0; j < n_consume[i]; j++)
|
||||
{
|
||||
d_gnss_synchro_history_queue[i].push_back(in[i][j]);
|
||||
@ -436,6 +453,7 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
|
||||
d_gnss_synchro_history_queue[i].at(distance - 1)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -461,7 +479,8 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
|
||||
|
||||
// compute interpolated TOW value at T_rx_s
|
||||
int ref_channel_key = gnss_synchro_map_iter->second.Channel_ID;
|
||||
Gnss_Synchro adj_obs = adjacent_gnss_synchro_map.at(ref_channel_key);
|
||||
Gnss_Synchro adj_obs;
|
||||
adj_obs = adjacent_gnss_synchro_map.at(ref_channel_key);
|
||||
double ref_adj_T_rx_s = static_cast<double>(adj_obs.Tracking_sample_counter) / ref_fs_hz + adj_obs.Code_phase_samples / ref_fs_hz;
|
||||
|
||||
double d_TOW_reference = gnss_synchro_map_iter->second.TOW_at_current_symbol_s;
|
||||
@ -487,7 +506,12 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
|
||||
// two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
|
||||
// TOW at the selected receiver time T_rx_s
|
||||
int element_key = gnss_synchro_map_iter->second.Channel_ID;
|
||||
adj_obs = adjacent_gnss_synchro_map.at(element_key);
|
||||
try{
|
||||
adj_obs = adjacent_gnss_synchro_map.at(element_key);
|
||||
}catch(const std::exception & ex)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
double adj_T_rx_s = static_cast<double>(adj_obs.Tracking_sample_counter) / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz;
|
||||
|
||||
@ -561,7 +585,7 @@ int hybrid_observables_cc::general_work (int noutput_items __attribute__((unused
|
||||
}
|
||||
}
|
||||
}
|
||||
} while(channel_history_ok == true && d_max_noutputs > n_outputs);
|
||||
} while(channel_history_ok == true && noutput_items > n_outputs);
|
||||
|
||||
// Multi-rate consume!
|
||||
for (unsigned int i = 0; i < d_nchannels; i++)
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
~hybrid_observables_cc ();
|
||||
int general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
|
||||
private:
|
||||
friend hybrid_observables_cc_sptr
|
||||
hybrid_make_observables_cc(unsigned int nchannels, bool dump, std::string dump_filename, unsigned int deep_history);
|
||||
@ -66,7 +66,6 @@ private:
|
||||
|
||||
double T_rx_s;
|
||||
double T_rx_step_s;
|
||||
int d_max_noutputs;
|
||||
bool d_dump;
|
||||
unsigned int d_nchannels;
|
||||
unsigned int history_deep;
|
||||
|
@ -139,7 +139,9 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc
|
||||
gen_signal_source.cc
|
||||
nsr_file_signal_source.cc
|
||||
spir_file_signal_source.cc
|
||||
spir_gss6450_file_signal_source.cc
|
||||
rtl_tcp_signal_source.cc
|
||||
labsat_signal_source.cc
|
||||
${OPT_DRIVER_SOURCES}
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <exception>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/logging.h>
|
||||
#include <volk/volk.h>
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "configuration_interface.h"
|
||||
|
||||
@ -51,7 +50,7 @@ DEFINE_string(signal_source, "-",
|
||||
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
{
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
@ -71,8 +70,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
|
||||
std::string s = "InputFilter";
|
||||
//double IF = configuration->property(s + ".IF", 0.0);
|
||||
|
||||
double seconds_to_skip = configuration->property(role + ".seconds_to_skip", default_seconds_to_skip );
|
||||
header_size = configuration->property( role + ".header_size", 0 );
|
||||
long samples_to_skip = 0;
|
||||
@ -116,29 +114,27 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_);
|
||||
|
||||
if( seconds_to_skip > 0 )
|
||||
{
|
||||
samples_to_skip = static_cast< long >(
|
||||
seconds_to_skip * sampling_frequency_ );
|
||||
|
||||
if( is_complex )
|
||||
{
|
||||
samples_to_skip *= 2;
|
||||
samples_to_skip = static_cast< long >( seconds_to_skip * sampling_frequency_ );
|
||||
|
||||
if( is_complex )
|
||||
{
|
||||
samples_to_skip *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( header_size > 0 )
|
||||
{
|
||||
samples_to_skip += header_size;
|
||||
}
|
||||
{
|
||||
samples_to_skip += header_size;
|
||||
}
|
||||
|
||||
if( samples_to_skip > 0 )
|
||||
{
|
||||
LOG(INFO) << "Skipping " << samples_to_skip << " samples of the input file";
|
||||
if( not file_source_->seek( samples_to_skip, SEEK_SET ) )
|
||||
{
|
||||
LOG(INFO) << "Error skipping bytes!";
|
||||
LOG(INFO) << "Skipping " << samples_to_skip << " samples of the input file";
|
||||
if( not file_source_->seek( samples_to_skip, SEEK_SET ) )
|
||||
{
|
||||
LOG(INFO) << "Error skipping bytes!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
@ -171,7 +167,6 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
<< std::endl
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< std::endl;
|
||||
|
||||
}
|
||||
|
||||
LOG(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
@ -238,8 +233,8 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
if (enable_throttle_control_)
|
||||
{
|
||||
throttle_ = gr::blocks::throttle::make(item_size_, sampling_frequency_);
|
||||
|
||||
}
|
||||
|
||||
DLOG(INFO) << "File source filename " << filename_;
|
||||
DLOG(INFO) << "Samples " << samples_;
|
||||
DLOG(INFO) << "Sampling frequency " << sampling_frequency_;
|
||||
@ -251,14 +246,10 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
FileSignalSource::~FileSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
|
||||
void FileSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (samples_ > 0)
|
||||
@ -310,10 +301,6 @@ void FileSignalSource::connect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void FileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (samples_ > 0)
|
||||
@ -365,9 +352,6 @@ void FileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr FileSignalSource::get_left_block()
|
||||
{
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
@ -375,9 +359,6 @@ gr::basic_block_sptr FileSignalSource::get_left_block()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gr::basic_block_sptr FileSignalSource::get_right_block()
|
||||
{
|
||||
if (samples_ > 0)
|
||||
|
@ -53,7 +53,6 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
rx1_en_ = configuration->property(role + ".rx1_enable", true);
|
||||
rx2_en_ = configuration->property(role + ".rx2_enable", false);
|
||||
buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000);
|
||||
decimation_ = configuration->property(role + ".decimation", 1);
|
||||
quadrature_ = configuration->property(role + ".quadrature", true);
|
||||
rf_dc_ = configuration->property(role + ".rf_dc", true);
|
||||
bb_dc_ = configuration->property(role + ".bb_dc", true);
|
||||
@ -79,7 +78,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
{
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
decimation_, bandwidth_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
|
@ -83,7 +83,6 @@ private:
|
||||
unsigned long sample_rate_;
|
||||
unsigned long bandwidth_;
|
||||
unsigned long buffer_size_; //reception buffer
|
||||
unsigned int decimation_;
|
||||
bool rx1_en_;
|
||||
bool rx2_en_;
|
||||
bool quadrature_;
|
||||
|
@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GN3S_SIGNAL_SOURCE_H_
|
||||
#define GN3S_SIGNAL_SOURCE_H_
|
||||
#ifndef GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
|
||||
#define GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
@ -90,4 +90,4 @@ private:
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif /*GN3S_SIGNAL_SOURCE_H_*/
|
||||
#endif /*GNSS_SDR_GN3S_SIGNAL_SOURCE_H_*/
|
||||
|
119
src/algorithms/signal_source/adapters/labsat_signal_source.cc
Normal file
119
src/algorithms/signal_source/adapters/labsat_signal_source.cc
Normal file
@ -0,0 +1,119 @@
|
||||
/*!
|
||||
* \file labsat_signal_source.cc
|
||||
* \brief Labsat 2 and 3 front-end signal sampler driver
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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 "labsat_signal_source.h"
|
||||
#include <glog/logging.h>
|
||||
#include "labsat23_source.h"
|
||||
#include "configuration_interface.h"
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) :
|
||||
role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/source.bin";
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
int channel_selector = configuration->property(role + ".selected_channel", 1);
|
||||
std::string default_filename = "./example_capture.LS3";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
labsat23_source_ = labsat23_make_source(filename_.c_str(),channel_selector);
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "labsat23_source_(" << labsat23_source_->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unrecognized item type for LabSat source";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
|
||||
}
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
LabsatSignalSource::~LabsatSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
void LabsatSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->connect(labsat23_source_, 0, file_sink_, 0);
|
||||
DLOG(INFO) << "connected labsat23_source_ to file sink";
|
||||
}
|
||||
else
|
||||
{
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LabsatSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(labsat23_source_, 0, file_sink_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr LabsatSignalSource::get_left_block()
|
||||
{
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
return gr::block_sptr();
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr LabsatSignalSource::get_right_block()
|
||||
{
|
||||
return labsat23_source_;
|
||||
}
|
94
src/algorithms/signal_source/adapters/labsat_signal_source.h
Normal file
94
src/algorithms/signal_source/adapters/labsat_signal_source.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*!
|
||||
* \file labsat_signal_source.h
|
||||
* \brief Labsat 2 and 3 front-end signal sampler driver
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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_LABSAT_SIGNAL_SOURCE_H_
|
||||
#define GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_
|
||||
|
||||
#include <string>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include "gnss_block_interface.h"
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class reads samples stored by a LabSat 2 or LabSat 3 device
|
||||
*/
|
||||
class LabsatSignalSource: public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, gr::msg_queue::sptr queue);
|
||||
|
||||
virtual ~LabsatSignalSource();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Labsat_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Labsat_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
private:
|
||||
std::string role_;
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
std::string item_type_;
|
||||
size_t item_size_;
|
||||
long samples_;
|
||||
std::string filename_;
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
gr::block_sptr labsat23_source_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_*/
|
@ -52,7 +52,6 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
||||
sample_rate_ = configuration->property(role + ".sampling_frequency", 3000000);
|
||||
bandwidth_ = configuration->property(role + ".bandwidth", 2000000);
|
||||
buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000);
|
||||
decimation_ = configuration->property(role + ".decimation", 1);
|
||||
quadrature_ = configuration->property(role + ".quadrature", true);
|
||||
rf_dc_ = configuration->property(role + ".rf_dc", true);
|
||||
bb_dc_ = configuration->property(role + ".bb_dc", true);
|
||||
@ -81,7 +80,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
||||
std::cout << "item type: " << item_type_ << std::endl;
|
||||
|
||||
plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_,
|
||||
decimation_, bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_,
|
||||
bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_,
|
||||
gain_mode_.c_str(), rf_gain_,filter_file_.c_str(), filter_auto_);
|
||||
|
||||
if (samples_ != 0)
|
||||
|
@ -83,7 +83,6 @@ private:
|
||||
unsigned long sample_rate_;
|
||||
unsigned long bandwidth_;
|
||||
unsigned long buffer_size_; // reception buffer
|
||||
unsigned int decimation_;
|
||||
bool quadrature_;
|
||||
bool rf_dc_;
|
||||
bool bb_dc_;
|
||||
|
@ -0,0 +1,284 @@
|
||||
/*!
|
||||
* \file spir_gss6450_file_signal_source.cc
|
||||
* \brief Implementation of a class that reads signals samples from a SPIR file
|
||||
* and adapts it to a SignalSourceInterface.
|
||||
* \author Antonio Ramos, 2017 antonio.ramos(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 not 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 "spir_gss6450_file_signal_source.h"
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include <glog/logging.h>
|
||||
#include "configuration_interface.h"
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue) :
|
||||
role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
item_type_ = "int";
|
||||
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0.0);
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
repeat_ = configuration->property(role + ".repeat", false);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
endian_swap_ = configuration->property(role + ".endian", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
enable_throttle_control_ = configuration->property(role + ".enable_throttle_control", false);
|
||||
adc_bits_ = configuration->property(role + ".adc_bits", 4);
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
sel_ch_ = configuration->property(role + ".sel_ch", 1);
|
||||
item_size_ = sizeof(int);
|
||||
long bytes_seek = configuration->property(role + ".bytes_to_skip", 65536);
|
||||
double sample_size_byte = static_cast<double>(adc_bits_) / 4.0;
|
||||
|
||||
if(sel_ch_ > n_channels_) { LOG(WARNING) << "Invalid RF channel selection"; }
|
||||
if(n_channels_ > 1)
|
||||
{
|
||||
for(unsigned int i = 0; i < (n_channels_ - 1); i++)
|
||||
{
|
||||
null_sinks_.push_back(gr::blocks::null_sink::make(item_size_));
|
||||
}
|
||||
DLOG(INFO)<< "NUMBER OF NULL SINKS = " << null_sinks_.size();
|
||||
}
|
||||
try
|
||||
{
|
||||
file_source_ = gr::blocks::file_source::make(item_size_, filename_.c_str(), repeat_);
|
||||
file_source_->seek(bytes_seek / item_size_, SEEK_SET);
|
||||
unpack_spir_ = make_unpack_spir_gss6450_samples(adc_bits_);
|
||||
deint_ = gr::blocks::deinterleave::make(item_size_);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cerr
|
||||
<< "The receiver was configured to work with a file signal source "
|
||||
<< std::endl
|
||||
<< "but the specified file is unreachable by GNSS-SDR."
|
||||
<< std::endl
|
||||
<< "Please modify your configuration file"
|
||||
<< std::endl
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:"
|
||||
<< std::endl
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl
|
||||
<< "Examples of configuration files available at:"
|
||||
<< std::endl
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/"
|
||||
<< std::endl;
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
throw(e);
|
||||
}
|
||||
DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
|
||||
|
||||
if(samples_ == 0) // read all file
|
||||
{
|
||||
/*!
|
||||
* BUG workaround: The GNU Radio file source does not stop the receiver after reaching the End of File.
|
||||
* A possible solution is to compute the file length in samples using file size, excluding the last 2 milliseconds, and enable always the
|
||||
* valve block
|
||||
*/
|
||||
std::ifstream file (filename_.c_str(), std::ios::in | std::ios::binary | std::ios::ate);
|
||||
std::ifstream::pos_type size;
|
||||
|
||||
if (file.is_open())
|
||||
{
|
||||
size = file.tellg();
|
||||
LOG(INFO) << "Total samples in the file= " << floor(static_cast<double>(size) / static_cast<double>(item_size_));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl;
|
||||
LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||
}
|
||||
std::streamsize ss = std::cout.precision();
|
||||
std::cout << std::setprecision(16);
|
||||
std::cout << "Processing file " << filename_ << ", which contains " << size << " [bytes]" << std::endl;
|
||||
std::cout.precision (ss);
|
||||
|
||||
if(size > 0)
|
||||
{
|
||||
samples_ = static_cast<unsigned long long>(floor(static_cast<double>(static_cast<long>(size) - static_cast<long>(bytes_seek)) / (sample_size_byte * static_cast<double>(n_channels_))));
|
||||
samples_ = samples_- static_cast<unsigned long long>(ceil(0.002 * sampling_frequency_)); //process all the samples available in the file excluding the last 2 ms
|
||||
}
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s = static_cast<double>(samples_) / sampling_frequency_;
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
{
|
||||
sink_ = gr::blocks::file_sink::make(sizeof(gr_complex), dump_filename_.c_str());
|
||||
DLOG(INFO) << "file_sink(" << sink_->unique_id() << ")";
|
||||
}
|
||||
if (enable_throttle_control_)
|
||||
{
|
||||
throttle_ = gr::blocks::throttle::make(sizeof(gr_complex), sampling_frequency_);
|
||||
}
|
||||
if (endian_swap_)
|
||||
{
|
||||
endian_ = gr::blocks::endian_swap::make(item_size_);
|
||||
}
|
||||
DLOG(INFO) << "File source filename " << filename_;
|
||||
DLOG(INFO) << "Samples " << samples_;
|
||||
DLOG(INFO) << "Sampling frequency " << sampling_frequency_;
|
||||
DLOG(INFO) << "Item type " << item_type_;
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "Repeat " << repeat_;
|
||||
DLOG(INFO) << "Dump " << dump_;
|
||||
DLOG(INFO) << "Dump filename " << dump_filename_;
|
||||
}
|
||||
|
||||
|
||||
SpirGSS6450FileSignalSource::~SpirGSS6450FileSignalSource()
|
||||
{}
|
||||
|
||||
|
||||
void SpirGSS6450FileSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (samples_ > 0)
|
||||
{
|
||||
top_block->connect(file_source_, 0, deint_, 0);
|
||||
if(endian_swap_)
|
||||
{
|
||||
top_block->connect(deint_, sel_ch_ - 1, endian_ ,0);
|
||||
top_block->connect(endian_, 0, unpack_spir_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
top_block->connect(deint_, sel_ch_ - 1, unpack_spir_, 0);
|
||||
}
|
||||
if(n_channels_ > 1)
|
||||
{
|
||||
unsigned int aux = 0;
|
||||
for(unsigned int i = 0; i < n_channels_; i++)
|
||||
{
|
||||
if(i != (sel_ch_ - 1))
|
||||
{
|
||||
top_block->connect(deint_, i, null_sinks_.at(aux), 0);
|
||||
aux++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (enable_throttle_control_)
|
||||
{
|
||||
top_block->connect(unpack_spir_, 0, throttle_, 0);
|
||||
top_block->connect(throttle_, 0, valve_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
top_block->connect(unpack_spir_, 0, valve_, 0);
|
||||
}
|
||||
if(dump_)
|
||||
{
|
||||
top_block->connect(valve_, 0, sink_, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "0 samples to read";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SpirGSS6450FileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (samples_ > 0)
|
||||
{
|
||||
top_block->disconnect(file_source_, 0, deint_, 0);
|
||||
if(endian_swap_)
|
||||
{
|
||||
top_block->disconnect(deint_, sel_ch_ - 1, endian_ ,0);
|
||||
top_block->disconnect(endian_, 0, unpack_spir_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
top_block->disconnect(deint_, sel_ch_ - 1, unpack_spir_, 0);
|
||||
}
|
||||
if(n_channels_ > 1)
|
||||
{
|
||||
unsigned int aux = 0;
|
||||
for(unsigned int i = 0; i < n_channels_; i++)
|
||||
{
|
||||
if(i != (sel_ch_ - 1))
|
||||
{
|
||||
top_block->disconnect(deint_, i, null_sinks_.at(aux), 0);
|
||||
aux++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (enable_throttle_control_)
|
||||
{
|
||||
top_block->disconnect(unpack_spir_, 0, throttle_, 0);
|
||||
top_block->disconnect(throttle_, 0, valve_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
top_block->disconnect(unpack_spir_, 0, valve_, 0);
|
||||
}
|
||||
if(dump_)
|
||||
{
|
||||
top_block->disconnect(valve_, 0, sink_, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << "Nothing to disconnect";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr SpirGSS6450FileSignalSource::get_left_block()
|
||||
{
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
return gr::blocks::file_source::sptr();
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr SpirGSS6450FileSignalSource::get_right_block()
|
||||
{
|
||||
if(samples_ > 0) { return valve_; }
|
||||
else
|
||||
{
|
||||
if(enable_throttle_control_) { return throttle_; }
|
||||
else { return unpack_spir_; }
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
/*!
|
||||
* \file spir_gss6450_file_signal_source.h
|
||||
* \brief Implementation of a class that reads signals samples from a SPIR file
|
||||
* and adapts it to a SignalSourceInterface.
|
||||
* \author Antonio Ramos, 2017 antonio.ramos(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 not 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_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
|
||||
#define GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <gnuradio/blocks/file_source.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/blocks/throttle.h>
|
||||
#include <gnuradio/blocks/packed_to_unpacked_ii.h>
|
||||
#include <gnuradio/blocks/deinterleave.h>
|
||||
#include <gnuradio/blocks/null_sink.h>
|
||||
#include <gnuradio/blocks/endian_swap.h>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "unpack_spir_gss6450_samples.h"
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class SpirGSS6450FileSignalSource: public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams, gr::msg_queue::sptr queue);
|
||||
|
||||
virtual ~SpirGSS6450FileSignalSource();
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Spir_GSS6450_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
inline std::string filename() const
|
||||
{
|
||||
return filename_;
|
||||
}
|
||||
|
||||
inline std::string item_type() const
|
||||
{
|
||||
return item_type_;
|
||||
}
|
||||
|
||||
inline bool repeat() const
|
||||
{
|
||||
return repeat_;
|
||||
}
|
||||
|
||||
inline long sampling_frequency() const
|
||||
{
|
||||
return sampling_frequency_;
|
||||
}
|
||||
|
||||
inline long samples() const
|
||||
{
|
||||
return samples_;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned long long samples_;
|
||||
double sampling_frequency_;
|
||||
std::string filename_;
|
||||
bool repeat_;
|
||||
bool dump_; //Enables dumping the gr_complex sample output
|
||||
bool enable_throttle_control_;
|
||||
bool endian_swap_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
unsigned int adc_bits_;
|
||||
unsigned int n_channels_;
|
||||
unsigned int sel_ch_;
|
||||
gr::blocks::file_source::sptr file_source_;
|
||||
gr::blocks::deinterleave::sptr deint_;
|
||||
gr::blocks::endian_swap::sptr endian_;
|
||||
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
|
||||
unpack_spir_gss6450_samples_sptr unpack_spir_;
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
gr::msg_queue::sptr queue_;
|
||||
size_t item_size_;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_*/
|
@ -23,6 +23,8 @@ set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
|
||||
unpack_intspir_1bit_samples.cc
|
||||
rtl_tcp_signal_source_c.cc
|
||||
unpack_2bit_samples.cc
|
||||
unpack_spir_gss6450_samples.cc
|
||||
labsat23_source.cc
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
497
src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc
Normal file
497
src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc
Normal file
@ -0,0 +1,497 @@
|
||||
/*!
|
||||
* \file labsat23_source.cc
|
||||
*
|
||||
* \brief Unpacks the Labsat 2 (ls2) and (ls3) capture files
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (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 "labsat23_source.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int channel_selector)
|
||||
{
|
||||
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector));
|
||||
}
|
||||
|
||||
|
||||
std::string labsat23_source::generate_filename()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << std::setw(4) << std::setfill('0') << d_current_file_number;
|
||||
return d_signal_file_basename + "_" + ss.str()+".LS3";
|
||||
}
|
||||
|
||||
|
||||
labsat23_source::labsat23_source(const char *signal_file_basename, int channel_selector) : gr::block("labsat23_source",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)))
|
||||
{
|
||||
if (channel_selector < 1 or channel_selector > 2)
|
||||
{
|
||||
std::cout << "Labsat source config error: channel selection out of bounds, check gnss-sdr config file" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
d_channel_selector_config = channel_selector;
|
||||
d_header_parsed = false;
|
||||
d_bits_per_sample = 0;
|
||||
d_current_file_number = 0;
|
||||
d_labsat_version = 0;
|
||||
d_ref_clock = 0;
|
||||
d_channel_selector = 0;
|
||||
d_signal_file_basename = std::string(signal_file_basename);
|
||||
|
||||
std::string signal_file;
|
||||
this->set_output_multiple(8);
|
||||
signal_file = generate_filename();
|
||||
binary_input_file = new std::ifstream (signal_file.c_str(), std::ios::in|std::ios::binary);
|
||||
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << signal_file << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Labsat file " << signal_file << " could not be opened!" << std::endl;
|
||||
delete binary_input_file;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
labsat23_source::~labsat23_source()
|
||||
{
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
binary_input_file->close();
|
||||
}
|
||||
delete binary_input_file;
|
||||
}
|
||||
|
||||
|
||||
int labsat23_source::getBit(uint8_t byte, int position)
|
||||
{
|
||||
return (byte >> position) & 0x01;
|
||||
}
|
||||
|
||||
|
||||
void labsat23_source::decode_samples_one_channel(int16_t input_short, gr_complex* out, int type)
|
||||
{
|
||||
std::bitset<16> bs(input_short);
|
||||
switch(type)
|
||||
{
|
||||
case 2:
|
||||
//two bits per sample, 8 samples per int16
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
out[i] = gr_complex(static_cast<float>(bs[15-(2*i)]),
|
||||
static_cast<float>(bs[14-(2*i)]));
|
||||
out[i] = out[i]*gr_complex(2,0)-gr_complex(1,1);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//four bits per sample, 4 samples per int16
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
out[i] = gr_complex(0.0,0.0);
|
||||
//In-Phase
|
||||
if (bs[15-4*i])
|
||||
{
|
||||
if (bs[13-4*i]) //11
|
||||
{
|
||||
out[i] += gr_complex(-1,0);
|
||||
}
|
||||
else //10
|
||||
{
|
||||
out[i] += gr_complex(-2,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bs[13-4*i]) //01
|
||||
{
|
||||
out[i] += gr_complex(1,0);
|
||||
}
|
||||
}
|
||||
|
||||
//Quadrature
|
||||
if (bs[14-4*i])
|
||||
{
|
||||
if (bs[12-4*i]) //11
|
||||
{
|
||||
out[i] += gr_complex(0,-1);
|
||||
}
|
||||
else //10
|
||||
{
|
||||
out[i] += gr_complex(0,-2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bs[12-4*i]) //01
|
||||
{
|
||||
out[i] += gr_complex(0,1);
|
||||
}
|
||||
}
|
||||
out[i] += gr_complex(0.5,0.5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int labsat23_source::general_work(int noutput_items,
|
||||
__attribute__((unused)) gr_vector_int &ninput_items,
|
||||
__attribute__((unused)) gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
gr_complex *out = reinterpret_cast<gr_complex *>(output_items[0]);
|
||||
|
||||
if (d_header_parsed == false)
|
||||
{
|
||||
if (binary_input_file->eof() == false)
|
||||
{
|
||||
char memblock[1024];
|
||||
binary_input_file->read(memblock, 1024);
|
||||
//parse Labsat header
|
||||
//check preamble
|
||||
int byte_counter = 0;
|
||||
bool preamble_ok = true;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
if (memblock[byte_counter] != 0x00) preamble_ok = false;
|
||||
//std::cout << "H[" << i << "]:" << (int)memblock[byte_counter] << std::endl;
|
||||
byte_counter++;
|
||||
}
|
||||
|
||||
if (preamble_ok == false)
|
||||
{
|
||||
std::cout << "Labsat source do not detect the preamble in the selected file" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// check Labsat version
|
||||
if (memblock[byte_counter] == 0x4C and memblock[byte_counter+1] == 0x53 and memblock[byte_counter+2] == 0x32)
|
||||
{
|
||||
d_labsat_version = 2;
|
||||
std::cout << "Labsat file version 2 detected" << std::endl;
|
||||
}
|
||||
|
||||
if (memblock[byte_counter] == 0x4C and memblock[byte_counter+1] == 0x53 and memblock[byte_counter+2] == 0x33)
|
||||
{
|
||||
d_labsat_version = 3;
|
||||
std::cout << "Labsat file version 3 detected" << std::endl;
|
||||
}
|
||||
|
||||
if (d_labsat_version == 0)
|
||||
{
|
||||
std::cout << "Labsat source do not detect the labsat version in file header" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
byte_counter += 3;
|
||||
|
||||
int sub_version = static_cast<int>(memblock[byte_counter]);
|
||||
|
||||
std::cout << "Labsat file sub version " << sub_version << std::endl;
|
||||
|
||||
byte_counter++;
|
||||
|
||||
int header_bytes = 0;
|
||||
header_bytes += memblock[byte_counter] | (memblock[byte_counter+1] << 8) | (memblock[byte_counter+2] << 16) | (memblock[byte_counter+3] << 24);
|
||||
|
||||
byte_counter += 4;
|
||||
//std::cout << "header_bytes=" << header_bytes << std::endl;
|
||||
|
||||
// read first section
|
||||
// section ID (little-endian)
|
||||
uint8_t section_id = static_cast<int>(memblock[byte_counter]) + static_cast<int>(memblock[byte_counter+1]) * 256;
|
||||
//std::cout << "Section ID: " << (int)section_id << std::endl;
|
||||
byte_counter += 2;
|
||||
|
||||
uint8_t section_lenght_bytes = 0;
|
||||
section_lenght_bytes += memblock[byte_counter] | (memblock[byte_counter+1] << 8) | (memblock[byte_counter+2] << 16) | (memblock[byte_counter+3] << 24);
|
||||
//std::cout << "section_lenght_bytes=" << (int)section_lenght_bytes << std::endl;
|
||||
|
||||
byte_counter += 4;
|
||||
if (section_id == 2)
|
||||
{
|
||||
d_ref_clock = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(d_ref_clock)
|
||||
{
|
||||
case 0:
|
||||
std::cout << "Labsat reference clock: internal OXCO" << std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout << "Labsat reference clock: internal TXCO" << std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout << "Labsat reference clock: external 10 MHz" << std::endl;
|
||||
break;
|
||||
case 3:
|
||||
std::cout << "Labsat reference clock: external 16.386 MHz" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Labsat Unknown reference clock ID " << static_cast<int>(d_ref_clock) << std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
d_bits_per_sample = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(d_bits_per_sample)
|
||||
{
|
||||
case 2:
|
||||
std::cout << "Labsat is using 2 bits per sample" << std::endl;
|
||||
break;
|
||||
case 4:
|
||||
std::cout << "Labsat is using 4 bits per sample" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Labsat Unknown bits per sample ID " << static_cast<int>(d_bits_per_sample) << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
byte_counter++;
|
||||
d_channel_selector = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
std::cout << "Available channels: Channel A + B, 1 bit quantisation" << std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout << "Available channels: Channel A, 1 bit quantisation" << std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout << "Available channels: Channel B, 1 bit quantisation" << std::endl;
|
||||
break;
|
||||
case 3:
|
||||
std::cout << "Available channels: Channel A, 2 bit quantisation" << std::endl;
|
||||
break;
|
||||
case 4:
|
||||
std::cout << "Available channels: Channel B, 2 bit quantisation" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Unknown channel selection ID " << static_cast<int>(d_channel_selector) << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//check if the selected channel in config file match the file encoding
|
||||
if (d_channel_selector_config == 2 and d_channel_selector != 0)
|
||||
{
|
||||
std::cout << "Labsat source channel config inconsistency: channel 2 is selected but the file has only one channel" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//todo: Add support for dual channel files
|
||||
if (d_channel_selector == 0)
|
||||
{
|
||||
std::cout << "ERROR: Labsat file contains more than one channel and it is not currently supported by Labsat signal source." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t quantization = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(quantization)
|
||||
{
|
||||
case 1:
|
||||
std::cout << "1 bit per sample" << std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout << "2 bit per sample" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Unknown quantization ID " << static_cast<int>(quantization) << std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t channel_a_constellation = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(channel_a_constellation)
|
||||
{
|
||||
case 0:
|
||||
std::cout << "Labsat Channel A is GPS" << std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout << "Labsat Channel A is GLONASS" << std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout << "Labsat Channel A is BDS" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Unknown channel A constellation ID " << static_cast<int>(channel_a_constellation) << std::endl;
|
||||
}
|
||||
byte_counter++;
|
||||
uint8_t channel_b_constellation = static_cast<uint8_t>(memblock[byte_counter]);
|
||||
switch(channel_b_constellation)
|
||||
{
|
||||
case 0:
|
||||
std::cout << "Labsat Channel B is GPS" << std::endl;
|
||||
break;
|
||||
case 1:
|
||||
std::cout << "Labsat Channel B is GLONASS" << std::endl;
|
||||
break;
|
||||
case 2:
|
||||
std::cout << "Labsat Channel B is BDS" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cout << "Unknown channel B constellation ID " << static_cast<int>(channel_b_constellation) << std::endl;
|
||||
}
|
||||
|
||||
//end of header
|
||||
d_header_parsed = true;
|
||||
//seek file to the first signal sample
|
||||
binary_input_file->clear();
|
||||
binary_input_file->seekg(header_bytes, binary_input_file->beg);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Labsat file header error: section 2 is not available." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Labsat file read error: file is empty." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//ready to start reading samples
|
||||
switch(d_bits_per_sample)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
// dual channel 2 bits per complex sample
|
||||
break;
|
||||
default:
|
||||
//single channel 2 bits per complex sample (1 bit I + 1 bit Q, 8 samples per int16)
|
||||
int n_int16_to_read = noutput_items / 8;
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int16_t memblock[n_int16_to_read];
|
||||
binary_input_file->read(reinterpret_cast<char*>(memblock), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int output_pointer = 0;
|
||||
for (int i = 0; i < n_int16_to_read; i++)
|
||||
{
|
||||
decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample);
|
||||
output_pointer += 8;
|
||||
}
|
||||
return output_pointer;
|
||||
}
|
||||
else
|
||||
{
|
||||
//trigger the read of the next file in the sequence
|
||||
std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl;
|
||||
|
||||
d_current_file_number++;
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Last file reached, LabSat source stop" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
switch(d_channel_selector)
|
||||
{
|
||||
case 0:
|
||||
// dual channel
|
||||
break;
|
||||
default:
|
||||
//single channel 4 bits per complex sample (2 bit I + 2 bit Q, 4 samples per int16)
|
||||
int n_int16_to_read = noutput_items / 4;
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int16_t memblock[n_int16_to_read];
|
||||
binary_input_file->read(reinterpret_cast<char*>(memblock), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file->gcount() / 2; //from bytes to int16
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int output_pointer = 0;
|
||||
for (int i = 0; i < n_int16_to_read; i++)
|
||||
{
|
||||
decode_samples_one_channel(memblock[i], &out[output_pointer], d_bits_per_sample);
|
||||
output_pointer += 4;
|
||||
}
|
||||
return output_pointer;
|
||||
}
|
||||
else
|
||||
{
|
||||
//trigger the read of the next file in the sequence
|
||||
std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl;
|
||||
|
||||
d_current_file_number++;
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in|std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Last file reached, LabSat source stop" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "Warning!!" << std::endl;
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
/*!
|
||||
* \file labsat23_source.h
|
||||
*
|
||||
* \brief Unpacks the Labsat 2 (ls2) and (ls3) capture files
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (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_LABSAT23_SOURCE_H
|
||||
#define GNSS_SDR_LABSAT23_SOURCE_H
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdint.h>
|
||||
|
||||
class labsat23_source;
|
||||
|
||||
typedef boost::shared_ptr<labsat23_source> labsat23_source_sptr;
|
||||
|
||||
labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int channel_selector);
|
||||
|
||||
/*!
|
||||
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
|
||||
*/
|
||||
class labsat23_source: public gr::block
|
||||
{
|
||||
private:
|
||||
friend labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector);
|
||||
std::string generate_filename();
|
||||
void decode_samples_one_channel(int16_t input_short, gr_complex* out, int type);
|
||||
int getBit(uint8_t byte, int position);
|
||||
bool d_header_parsed;
|
||||
uint8_t d_channel_selector;
|
||||
int d_channel_selector_config;
|
||||
int d_current_file_number;
|
||||
uint8_t d_labsat_version;
|
||||
std::string d_signal_file_basename;
|
||||
std::ifstream *binary_input_file;
|
||||
uint8_t d_ref_clock;
|
||||
uint8_t d_bits_per_sample;
|
||||
|
||||
public:
|
||||
labsat23_source(const char *signal_file_basename, int channel_selector);
|
||||
~labsat23_source();
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,106 @@
|
||||
/*!
|
||||
* \file unpack_spir_gss6450_samples.cc
|
||||
*
|
||||
* \brief Unpacks SPIR int samples
|
||||
* \author Antonio Ramos, antonio(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 not 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 "unpack_spir_gss6450_samples.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
|
||||
|
||||
|
||||
unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit)
|
||||
{
|
||||
return unpack_spir_gss6450_samples_sptr(new unpack_spir_gss6450_samples(adc_nbit));
|
||||
}
|
||||
|
||||
|
||||
unpack_spir_gss6450_samples::unpack_spir_gss6450_samples(unsigned int adc_nbit) : gr::sync_interpolator("unpack_spir_gss6450_samples",
|
||||
gr::io_signature::make(1, 1, sizeof(int)),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex)), 16 / adc_nbit)
|
||||
{
|
||||
adc_bits = adc_nbit;
|
||||
i_data = 0;
|
||||
q_data = 0;
|
||||
samples_per_int = 16 / adc_bits;
|
||||
if(adc_bits == 2)
|
||||
{
|
||||
mask_data = 0x00000003;
|
||||
map_ = {0, 1, -2, -1};
|
||||
}
|
||||
else
|
||||
{
|
||||
mask_data = 0x0000000F;
|
||||
map_ = {0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unpack_spir_gss6450_samples::~unpack_spir_gss6450_samples()
|
||||
{}
|
||||
|
||||
void unpack_spir_gss6450_samples::process_sample(gr_complex& out)
|
||||
{
|
||||
out = gr_complex(0.5, 0.5);
|
||||
compute_two_complement(i_data);
|
||||
compute_two_complement(q_data);
|
||||
out += gr_complex(static_cast<float>(i_data), static_cast<float>(q_data));
|
||||
}
|
||||
|
||||
|
||||
int unpack_spir_gss6450_samples::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
const int* in = reinterpret_cast<const int*>(input_items[0]);
|
||||
gr_complex* out = reinterpret_cast<gr_complex*>(output_items[0]);
|
||||
unsigned int n_sample = 0;
|
||||
unsigned int in_counter = 0;
|
||||
for(int i = 0; i < noutput_items; i++)
|
||||
{
|
||||
int sample_aux = in[in_counter];
|
||||
int aux_i = sample_aux;
|
||||
int aux_q = sample_aux;
|
||||
int i_shift = adc_bits * 2 * (samples_per_int - n_sample - 1) + adc_bits;
|
||||
int q_shift = adc_bits * 2 * (samples_per_int - n_sample - 1);
|
||||
i_data = (aux_i >> i_shift) & mask_data;
|
||||
q_data = (aux_q >> q_shift) & mask_data;
|
||||
process_sample(out[samples_per_int * in_counter + samples_per_int - n_sample - 1]);
|
||||
n_sample++;
|
||||
if(n_sample == samples_per_int)
|
||||
{
|
||||
n_sample = 0;
|
||||
in_counter++;
|
||||
}
|
||||
}
|
||||
return noutput_items;
|
||||
}
|
||||
|
||||
void unpack_spir_gss6450_samples::compute_two_complement(int& data)
|
||||
{
|
||||
data = map_[data];
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*!
|
||||
* \file unpack_spir_gss6450_samples.h
|
||||
*
|
||||
* \brief Unpacks SPIR int samples
|
||||
* \author Antonio Ramos, antonio.ramos(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 not 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_UNPACK_SPIR_GSS6450_SAMPLES_H
|
||||
#define GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H
|
||||
|
||||
#include <gnuradio/sync_interpolator.h>
|
||||
#include <vector>
|
||||
|
||||
class unpack_spir_gss6450_samples;
|
||||
|
||||
typedef boost::shared_ptr<unpack_spir_gss6450_samples> unpack_spir_gss6450_samples_sptr;
|
||||
|
||||
unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit);
|
||||
|
||||
|
||||
class unpack_spir_gss6450_samples: public gr::sync_interpolator
|
||||
{
|
||||
public:
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit);
|
||||
unpack_spir_gss6450_samples(unsigned int adc_nbit);
|
||||
~unpack_spir_gss6450_samples();
|
||||
|
||||
private:
|
||||
unsigned int adc_bits;
|
||||
unsigned int samples_per_int;
|
||||
void process_sample(gr_complex& out);
|
||||
void compute_two_complement(int& data);
|
||||
int i_data;
|
||||
int q_data;
|
||||
int mask_data;
|
||||
std::vector<int> map_;
|
||||
};
|
||||
|
||||
#endif
|
@ -16,9 +16,11 @@
|
||||
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
set(TELEMETRY_DECODER_ADAPTER_SOURCES
|
||||
gps_l1_ca_telemetry_decoder.cc
|
||||
gps_l2c_telemetry_decoder.cc
|
||||
gps_l5_telemetry_decoder.cc
|
||||
galileo_e1b_telemetry_decoder.cc
|
||||
sbas_l1_telemetry_decoder.cc
|
||||
galileo_e5a_telemetry_decoder.cc
|
||||
|
@ -0,0 +1,99 @@
|
||||
/*!
|
||||
* \file gps_l5_telemetry_decoder.cc
|
||||
* \brief Implementation of an adapter of a GPS L5 NAV data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Antonio Ramos, 2017. antonio.ramos(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 "gps_l5_telemetry_decoder.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include "concurrent_queue.h"
|
||||
#include "configuration_interface.h"
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GpsL5TelemetryDecoder::GpsL5TelemetryDecoder(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams) :
|
||||
role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_dump_filename = "./navigation.dat";
|
||||
DLOG(INFO) << "role " << role;
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
// make telemetry decoder object
|
||||
telemetry_decoder_ = gps_l5_make_telemetry_decoder_cc(satellite_, dump_);
|
||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||
|
||||
LOG(INFO) << "global navigation message queue assigned to telemetry_decoder (" << telemetry_decoder_->unique_id() << ")" << "role " << role;
|
||||
channel_ = 0;
|
||||
}
|
||||
|
||||
|
||||
GpsL5TelemetryDecoder::~GpsL5TelemetryDecoder()
|
||||
{}
|
||||
|
||||
|
||||
void GpsL5TelemetryDecoder::set_satellite(const Gnss_Satellite & satellite)
|
||||
{
|
||||
satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
telemetry_decoder_->set_satellite(satellite_);
|
||||
DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_;
|
||||
}
|
||||
|
||||
|
||||
void GpsL5TelemetryDecoder::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void GpsL5TelemetryDecoder::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GpsL5TelemetryDecoder::get_left_block()
|
||||
{
|
||||
return telemetry_decoder_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GpsL5TelemetryDecoder::get_right_block()
|
||||
{
|
||||
return telemetry_decoder_;
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
/*!
|
||||
* \file gps_l5_telemetry_decoder.h
|
||||
* \brief Interface of an adapter of a GPS L5 (CNAV) data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Antonio Ramos, 2017. antonio.ramos(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_GPS_L5_TELEMETRY_DECODER_H_
|
||||
#define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_H_
|
||||
|
||||
#include <string>
|
||||
#include "telemetry_decoder_interface.h"
|
||||
#include "gps_l5_telemetry_decoder_cc.h"
|
||||
#include "gnss_satellite.h"
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class implements a NAV data decoder for GPS L5
|
||||
*/
|
||||
class GpsL5TelemetryDecoder : public TelemetryDecoderInterface
|
||||
{
|
||||
public:
|
||||
GpsL5TelemetryDecoder(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GpsL5TelemetryDecoder();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
//! Returns "GPS_L5_Telemetry_Decoder"
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L5_Telemetry_Decoder";
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
void set_satellite(const Gnss_Satellite & satellite) override;
|
||||
inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
|
||||
|
||||
inline void reset() override
|
||||
{
|
||||
return;
|
||||
}
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
gps_l5_telemetry_decoder_cc_sptr telemetry_decoder_;
|
||||
Gnss_Satellite satellite_;
|
||||
int channel_;
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
};
|
||||
|
||||
#endif
|
@ -19,6 +19,7 @@
|
||||
set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES
|
||||
gps_l1_ca_telemetry_decoder_cc.cc
|
||||
gps_l2c_telemetry_decoder_cc.cc
|
||||
gps_l5_telemetry_decoder_cc.cc
|
||||
galileo_e1b_telemetry_decoder_cc.cc
|
||||
sbas_l1_telemetry_decoder_cc.cc
|
||||
galileo_e5a_telemetry_decoder_cc.cc
|
||||
|
@ -297,14 +297,8 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items __attribut
|
||||
d_symbol_counter = 0;
|
||||
flag_bit_start = true;
|
||||
corr_value = 0;
|
||||
while(d_preamble_init.size() > 0)
|
||||
{ //Clear preamble correlating queue
|
||||
d_preamble_init.pop_front();
|
||||
}
|
||||
while(d_symbol_history.size() > 0)
|
||||
{ //Clear symbol queue in order to prevent possible symbol discontinuities
|
||||
d_symbol_history.pop_front();
|
||||
}
|
||||
d_preamble_init.clear();
|
||||
d_symbol_history.clear();
|
||||
LOG(INFO) << "Bit start sync for Galileo E5a satellite " << d_satellite;
|
||||
}
|
||||
else
|
||||
|
@ -32,15 +32,9 @@
|
||||
|
||||
|
||||
#include "glonass_l1_ca_telemetry_decoder_cc.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include "control_message_factory.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "convolutional.h"
|
||||
|
||||
|
||||
#define CRC_ERROR_LIMIT 6
|
||||
@ -78,10 +72,10 @@ glonass_l1_ca_telemetry_decoder_cc::glonass_l1_ca_telemetry_decoder_cc(
|
||||
// Since preamble rate is different than navigation data rate we use a constant
|
||||
d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
|
||||
|
||||
memcpy((unsigned short int*)this->d_preambles_bits, (unsigned short int*)preambles_bits, GLONASS_GNAV_PREAMBLE_LENGTH_BITS*sizeof(unsigned short int));
|
||||
memcpy(static_cast<unsigned short int*>(this->d_preambles_bits), static_cast<unsigned short int*>(preambles_bits), GLONASS_GNAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int));
|
||||
|
||||
// preamble bits to sampled symbols
|
||||
d_preambles_symbols = (signed int*)malloc(sizeof(signed int) * d_symbols_per_preamble);
|
||||
d_preambles_symbols = static_cast<signed int*>(malloc(sizeof(signed int) * d_symbols_per_preamble));
|
||||
int n = 0;
|
||||
for (int i = 0; i < GLONASS_GNAV_PREAMBLE_LENGTH_BITS; i++)
|
||||
{
|
||||
@ -150,39 +144,39 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int
|
||||
chip_acc_counter += 1;
|
||||
|
||||
if(chip_acc_counter == (GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT))
|
||||
{
|
||||
if (chip_acc > 0)
|
||||
{
|
||||
bi_binary_code.push_back('1');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bi_binary_code.push_back('0');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (chip_acc > 0)
|
||||
{
|
||||
bi_binary_code.push_back('1');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bi_binary_code.push_back('0');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Convert from bi-binary code to relative code
|
||||
for(int i = 0; i < (GLONASS_GNAV_STRING_BITS); i++)
|
||||
{
|
||||
if(bi_binary_code[2*i] == '1' && bi_binary_code[2*i + 1] == '0')
|
||||
{
|
||||
relative_code.push_back('1');
|
||||
}
|
||||
{
|
||||
relative_code.push_back('1');
|
||||
}
|
||||
else
|
||||
{
|
||||
relative_code.push_back('0');
|
||||
}
|
||||
{
|
||||
relative_code.push_back('0');
|
||||
}
|
||||
}
|
||||
// Convert from relative code to data bits
|
||||
data_bits.push_back('0');
|
||||
for(int i = 1; i < (GLONASS_GNAV_STRING_BITS); i++)
|
||||
{
|
||||
data_bits.push_back(((relative_code[i-1]-'0') ^ (relative_code[i]-'0')) + '0');
|
||||
}
|
||||
{
|
||||
data_bits.push_back(((relative_code[i-1]-'0') ^ (relative_code[i]-'0')) + '0');
|
||||
}
|
||||
|
||||
// 2. Call the GLONASS GNAV string decoder
|
||||
d_nav.string_decoder(data_bits);
|
||||
@ -204,7 +198,6 @@ void glonass_l1_ca_telemetry_decoder_cc::decode_string(double *frame_symbols,int
|
||||
std::shared_ptr<Glonass_Gnav_Ephemeris> tmp_obj = std::make_shared<Glonass_Gnav_Ephemeris>(d_nav.get_ephemeris());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite;
|
||||
|
||||
}
|
||||
if (d_nav.have_new_utc_model() == true)
|
||||
{
|
||||
@ -237,8 +230,8 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
int corr_value = 0;
|
||||
int preamble_diff = 0;
|
||||
|
||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0];
|
||||
const Gnss_Synchro **in = (const Gnss_Synchro **) &input_items[0]; //Get the input samples pointer
|
||||
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); // Get the output buffer pointer
|
||||
const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
|
||||
|
||||
Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block
|
||||
//1. Copy the current tracking output
|
||||
@ -248,23 +241,23 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
consume_each(1);
|
||||
|
||||
d_flag_preamble = false;
|
||||
unsigned int required_symbols=GLONASS_GNAV_STRING_SYMBOLS;
|
||||
unsigned int required_symbols = GLONASS_GNAV_STRING_SYMBOLS;
|
||||
|
||||
if (d_symbol_history.size()>required_symbols)
|
||||
{
|
||||
//******* preamble correlation ********
|
||||
for (int i = 0; i < d_symbols_per_preamble; i++)
|
||||
{
|
||||
if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping
|
||||
{
|
||||
corr_value -= d_preambles_symbols[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
corr_value += d_preambles_symbols[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
//******* preamble correlation ********
|
||||
for (int i = 0; i < d_symbols_per_preamble; i++)
|
||||
{
|
||||
if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping
|
||||
{
|
||||
corr_value -= d_preambles_symbols[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
corr_value += d_preambles_symbols[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//******* frame sync ******************
|
||||
if (d_stat == 0) //no preamble information
|
||||
@ -277,7 +270,6 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
// Enter into frame pre-detection status
|
||||
d_stat = 1;
|
||||
d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp
|
||||
|
||||
}
|
||||
}
|
||||
else if (d_stat == 1) // posible preamble lock
|
||||
@ -295,8 +287,8 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
d_preamble_index = d_sample_counter; //record the preamble sample stamp
|
||||
d_stat = 2;
|
||||
// send asynchronous message to tracking to inform of frame sync and extend correlation time
|
||||
pmt::pmt_t value = pmt::from_double(static_cast<double>(d_preamble_time_samples) / static_cast<double>(d_symbol_history.at(0).fs) - 0.001);
|
||||
this->message_port_pub(pmt::mp("preamble_timestamp_s"), value);
|
||||
pmt::pmt_t value = pmt::from_double(static_cast<double>(d_preamble_time_samples) / static_cast<double>(d_symbol_history.at(0).fs) - 0.001);
|
||||
this->message_port_pub(pmt::mp("preamble_timestamp_s"), value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -310,7 +302,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
}
|
||||
else if (d_stat == 2)
|
||||
{
|
||||
// FIXME: The preamble index marks the first symbol of the string count. Here I just wait for another full string to be received before processing
|
||||
// FIXME: The preamble index marks the first symbol of the string count. Here I just wait for another full string to be received before processing
|
||||
if (d_sample_counter == d_preamble_index + GLONASS_GNAV_STRING_SYMBOLS)
|
||||
{
|
||||
// NEW GLONASS string received
|
||||
@ -343,7 +335,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
{
|
||||
d_flag_frame_sync = true;
|
||||
DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at "
|
||||
<< d_symbol_history.at(0).Tracking_sample_counter << " [samples]";
|
||||
<< d_symbol_history.at(0).Tracking_sample_counter << " [samples]";
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -392,21 +384,21 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
|
||||
current_symbol.PRN = this->d_satellite.get_PRN();
|
||||
current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
|
||||
current_symbol.TOW_at_current_symbol_s -=delta_t; //Galileo to GPS TOW
|
||||
current_symbol.TOW_at_current_symbol_s -= delta_t; // Galileo to GPS TOW
|
||||
|
||||
if(d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write((char*)&tmp_double, sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write((char*)&tmp_ulong_int, sizeof(unsigned long int));
|
||||
tmp_double = 0;
|
||||
d_dump_file.write((char*)&tmp_double, sizeof(double));
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
tmp_double = 0;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
|
||||
}
|
||||
catch (const std::ifstream::failure & e)
|
||||
{
|
||||
@ -416,9 +408,9 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attrib
|
||||
|
||||
// remove used symbols from history
|
||||
if (d_symbol_history.size()>required_symbols)
|
||||
{
|
||||
d_symbol_history.pop_front();
|
||||
}
|
||||
{
|
||||
d_symbol_history.pop_front();
|
||||
}
|
||||
//3. Make the output (copy the object contents to the GNURadio reserved memory)
|
||||
*out[0] = current_symbol;
|
||||
|
||||
@ -454,7 +446,7 @@ void glonass_l1_ca_telemetry_decoder_cc::set_channel(int channel)
|
||||
}
|
||||
catch (const std::ifstream::failure& e)
|
||||
{
|
||||
LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
|
||||
LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items __attribute_
|
||||
void gps_l1_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite)
|
||||
{
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
LOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite;
|
||||
DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite;
|
||||
d_GPS_FSM.i_satellite_PRN = d_satellite.get_PRN();
|
||||
DLOG(INFO) << "Navigation Satellite set to " << d_satellite;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
|
||||
//* The time of the last input symbol can be computed from the message ToW and
|
||||
//* delay by the formulae:
|
||||
//* \code
|
||||
//* symbolTime_ms = msg->tow * 6000 + *pdelay * 20
|
||||
//* symbolTime_ms = msg->tow * 6000 + *pdelay * 20 + (12 * 20); 12 symbols of the encoder's transitory
|
||||
d_TOW_at_current_symbol = static_cast<double>(msg.tow) * 6.0 + static_cast<double>(delay) * GPS_L2_M_PERIOD + 12 * GPS_L2_M_PERIOD;
|
||||
d_TOW_at_current_symbol = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0;
|
||||
d_flag_valid_word = true;
|
||||
@ -170,12 +170,6 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
|
||||
current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
|
||||
current_synchro_data.Flag_valid_word = d_flag_valid_word;
|
||||
|
||||
// if (flag_PLL_180_deg_phase_locked == true)
|
||||
// {
|
||||
// //correct the accumulated phase for the Costas loop phase shift, if required
|
||||
// current_synchro_data.Carrier_phase_rads += GPS_PI;
|
||||
// }
|
||||
|
||||
if(d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
@ -192,7 +186,7 @@ int gps_l2c_telemetry_decoder_cc::general_work (int noutput_items __attribute__(
|
||||
}
|
||||
catch (const std::ifstream::failure & e)
|
||||
{
|
||||
LOG(WARNING) << "Exception writing observables dump file " << e.what();
|
||||
LOG(WARNING) << "Exception writing Telemetry GPS L2 dump file " << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +224,7 @@ void gps_l2c_telemetry_decoder_cc::set_channel(int channel)
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
LOG(WARNING) << "channel " << d_channel << " Exception opening trk dump file " << e.what();
|
||||
LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L2 dump file " << e.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,271 @@
|
||||
/*!
|
||||
* \file gps_l5_telemetry_decoder_cc.cc
|
||||
* \brief Implementation of a NAV message demodulator block based on
|
||||
* Kay Borre book MATLAB-based GPS receiver
|
||||
* \author Antonio Ramos, 2017. antonio.ramos(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 <bitset>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_l5_telemetry_decoder_cc.h"
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
#include "gps_cnav_iono.h"
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
gps_l5_telemetry_decoder_cc_sptr
|
||||
gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump)
|
||||
{
|
||||
return gps_l5_telemetry_decoder_cc_sptr(new gps_l5_telemetry_decoder_cc(satellite, dump));
|
||||
}
|
||||
|
||||
|
||||
gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc(
|
||||
const Gnss_Satellite & satellite, bool dump) : gr::block("gps_l5_telemetry_decoder_cc",
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
// Telemetry Bit transition synchronization port out
|
||||
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
|
||||
// Ephemeris data port out
|
||||
this->message_port_register_out(pmt::mp("telemetry"));
|
||||
// initialize internal vars
|
||||
d_dump = dump;
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
DLOG(INFO) << "GPS L5 TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||
d_channel = 0;
|
||||
d_flag_valid_word = false;
|
||||
d_TOW_at_current_symbol = 0.0;
|
||||
d_TOW_at_Preamble = 0.0;
|
||||
//initialize the CNAV frame decoder (libswiftcnav)
|
||||
cnav_msg_decoder_init(&d_cnav_decoder);
|
||||
for(int aux = 0; aux < GPS_L5_NH_CODE_LENGTH; aux++)
|
||||
{
|
||||
if(GPS_L5_NH_CODE[aux] == 0)
|
||||
{
|
||||
bits_NH[aux] = -1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bits_NH[aux] = 1.0;
|
||||
}
|
||||
}
|
||||
sync_NH = false;
|
||||
new_sym = false;
|
||||
}
|
||||
|
||||
|
||||
gps_l5_telemetry_decoder_cc::~gps_l5_telemetry_decoder_cc()
|
||||
{
|
||||
if(d_dump_file.is_open() == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
catch(const std::exception & ex)
|
||||
{
|
||||
LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int gps_l5_telemetry_decoder_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
// get pointers on in- and output gnss-synchro objects
|
||||
Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); // Get the output buffer pointer
|
||||
const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); // Get the input buffer pointer
|
||||
|
||||
// UPDATE GNSS SYNCHRO DATA
|
||||
Gnss_Synchro current_synchro_data; //structure to save the synchronization information and send the output object to the next block
|
||||
//1. Copy the current tracking output
|
||||
current_synchro_data = in[0];
|
||||
consume_each(1); //one by one
|
||||
sym_hist.push_back(in[0].Prompt_I);
|
||||
int corr_NH = 0;
|
||||
int symbol_value = 0;
|
||||
|
||||
//Search correlation with Neuman-Hofman Code (see IS-GPS-705D)
|
||||
if(sym_hist.size() == GPS_L5_NH_CODE_LENGTH)
|
||||
{
|
||||
for(int i = 0; i < GPS_L5_NH_CODE_LENGTH; i++)
|
||||
{
|
||||
if((bits_NH[i] * sym_hist.at(i)) > 0.0) {corr_NH += 1;}
|
||||
else {corr_NH -= 1;}
|
||||
}
|
||||
if(abs(corr_NH) == GPS_L5_NH_CODE_LENGTH)
|
||||
{
|
||||
sync_NH = true;
|
||||
if(corr_NH > 0) {symbol_value = 1;}
|
||||
else {symbol_value = -1;}
|
||||
new_sym = true;
|
||||
sym_hist.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
sym_hist.pop_front();
|
||||
sync_NH = false;
|
||||
new_sym = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool flag_new_cnav_frame = false;
|
||||
cnav_msg_t msg;
|
||||
u32 delay = 0;
|
||||
|
||||
//add the symbol to the decoder
|
||||
if(new_sym)
|
||||
{
|
||||
u8 symbol_clip = static_cast<u8>(symbol_value > 0) * 255;
|
||||
flag_new_cnav_frame = cnav_msg_decoder_add_symbol(&d_cnav_decoder, symbol_clip, &msg, &delay);
|
||||
new_sym = false;
|
||||
}
|
||||
//2. Add the telemetry decoder information
|
||||
//check if new CNAV frame is available
|
||||
if (flag_new_cnav_frame == true)
|
||||
{
|
||||
std::bitset<GPS_L5_CNAV_DATA_PAGE_BITS> raw_bits;
|
||||
//Expand packet bits to bitsets. Notice the reverse order of the bits sequence, required by the CNAV message decoder
|
||||
for (u32 i = 0; i < GPS_L5_CNAV_DATA_PAGE_BITS ; i++)
|
||||
{
|
||||
raw_bits[GPS_L5_CNAV_DATA_PAGE_BITS - 1 - i] = ((msg.raw_msg[i/8] >> (7 - i%8)) & 1u);
|
||||
}
|
||||
|
||||
d_CNAV_Message.decode_page(raw_bits);
|
||||
|
||||
//Push the new navigation data to the queues
|
||||
if (d_CNAV_Message.have_new_ephemeris() == true)
|
||||
{
|
||||
// get ephemeris object for this SV
|
||||
std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(d_CNAV_Message.get_ephemeris());
|
||||
std::cout << "New GPS L5 CNAV message received: ephemeris from satellite " << d_satellite << std::endl;
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
|
||||
}
|
||||
if (d_CNAV_Message.have_new_iono() == true)
|
||||
{
|
||||
std::shared_ptr<Gps_CNAV_Iono> tmp_obj = std::make_shared<Gps_CNAV_Iono>(d_CNAV_Message.get_iono());
|
||||
std::cout << "New GPS L5 CNAV message received: iono model parameters from satellite " << d_satellite << std::endl;
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
|
||||
if (d_CNAV_Message.have_new_utc_model() == true)
|
||||
{
|
||||
std::shared_ptr<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(d_CNAV_Message.get_utc_model());
|
||||
std::cout << "New GPS L5 CNAV message received: UTC model parameters from satellite " << d_satellite << std::endl;
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
}
|
||||
|
||||
//update TOW at the preamble instant
|
||||
d_TOW_at_Preamble = static_cast<double>(msg.tow) * 6.0;
|
||||
//* The time of the last input symbol can be computed from the message ToW and
|
||||
//* delay by the formulae:
|
||||
//* \code
|
||||
//* symbolTime_ms = msg->tow * 6000 + *pdelay * 10 + (12 * 10); 12 symbols of the encoder's transitory
|
||||
d_TOW_at_current_symbol = (static_cast<double>(msg.tow) * 6.0) + (static_cast<double>(delay) + 12.0) * GPS_L5i_SYMBOL_PERIOD;
|
||||
d_TOW_at_current_symbol = floor(d_TOW_at_current_symbol * 1000.0) / 1000.0;
|
||||
d_flag_valid_word = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_TOW_at_current_symbol += GPS_L5i_PERIOD;
|
||||
if (current_synchro_data.Flag_valid_symbol_output == false)
|
||||
{
|
||||
d_flag_valid_word = false;
|
||||
}
|
||||
}
|
||||
current_synchro_data.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
|
||||
current_synchro_data.Flag_valid_word = d_flag_valid_word;
|
||||
|
||||
if(d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_synchro_data.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
tmp_double = d_TOW_at_Preamble;
|
||||
d_dump_file.write(reinterpret_cast<char*>(&tmp_double), sizeof(double));
|
||||
}
|
||||
catch (const std::ifstream::failure & e)
|
||||
{
|
||||
LOG(WARNING) << "Exception writing Telemetry GPS L5 dump file " << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
//3. Make the output (copy the object contents to the GNURadio reserved memory)
|
||||
out[0] = current_synchro_data;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void gps_l5_telemetry_decoder_cc::set_satellite(const Gnss_Satellite & satellite)
|
||||
{
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
LOG(INFO) << "GPS L5 CNAV telemetry decoder in channel " << this->d_channel << " set to satellite " << d_satellite;
|
||||
d_CNAV_Message.reset();
|
||||
}
|
||||
|
||||
|
||||
void gps_l5_telemetry_decoder_cc::set_channel(int channel)
|
||||
{
|
||||
d_channel = channel;
|
||||
d_CNAV_Message.reset();
|
||||
LOG(INFO) << "GPS L5 CNAV channel set to " << channel;
|
||||
// ############# ENABLE DATA FILE LOG #################
|
||||
if (d_dump == true)
|
||||
{
|
||||
if (d_dump_file.is_open() == false)
|
||||
{
|
||||
try
|
||||
{
|
||||
d_dump_filename = "telemetry_L5_";
|
||||
d_dump_filename.append(boost::lexical_cast<std::string>(d_channel));
|
||||
d_dump_filename.append(".dat");
|
||||
d_dump_file.exceptions ( std::ifstream::failbit | std::ifstream::badbit );
|
||||
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
|
||||
LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel
|
||||
<< " Log file: " << d_dump_filename.c_str();
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
LOG(WARNING) << "channel " << d_channel << " Exception opening Telemetry GPS L5 dump file " << e.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
/*!
|
||||
* \file gps_l5_telemetry_decoder_cc.h
|
||||
* \brief Interface of a CNAV message demodulator block based on
|
||||
* Kay Borre book MATLAB-based GPS receiver
|
||||
* \author Antonio Ramos, 2017. antonio.ramos(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_GPS_L5_TELEMETRY_DECODER_CC_H
|
||||
#define GNSS_SDR_GPS_L5_TELEMETRY_DECODER_CC_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <deque>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <gnuradio/block.h>
|
||||
#include "gnss_satellite.h"
|
||||
#include "gps_cnav_navigation_message.h"
|
||||
#include "concurrent_queue.h"
|
||||
|
||||
extern "C" {
|
||||
#include "cnav_msg.h"
|
||||
#include "edc.h"
|
||||
#include "bits.h"
|
||||
}
|
||||
|
||||
#include "GPS_L5.h"
|
||||
|
||||
class gps_l5_telemetry_decoder_cc;
|
||||
|
||||
typedef boost::shared_ptr<gps_l5_telemetry_decoder_cc> gps_l5_telemetry_decoder_cc_sptr;
|
||||
|
||||
gps_l5_telemetry_decoder_cc_sptr
|
||||
gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a GPS L5 Telemetry decoder
|
||||
*
|
||||
*/
|
||||
class gps_l5_telemetry_decoder_cc : public gr::block
|
||||
{
|
||||
public:
|
||||
~gps_l5_telemetry_decoder_cc();
|
||||
void set_satellite(const Gnss_Satellite & satellite); //!< Set satellite PRN
|
||||
void set_channel(int channel); //!< Set receiver's channel
|
||||
int general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
|
||||
private:
|
||||
friend gps_l5_telemetry_decoder_cc_sptr
|
||||
gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
|
||||
gps_l5_telemetry_decoder_cc(const Gnss_Satellite & satellite, bool dump);
|
||||
|
||||
bool d_dump;
|
||||
Gnss_Satellite d_satellite;
|
||||
int d_channel;
|
||||
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
|
||||
cnav_msg_decoder_t d_cnav_decoder;
|
||||
|
||||
double d_TOW_at_current_symbol;
|
||||
double d_TOW_at_Preamble;
|
||||
bool d_flag_valid_word;
|
||||
|
||||
Gps_CNAV_Navigation_Message d_CNAV_Message;
|
||||
double bits_NH[GPS_L5_NH_CODE_LENGTH];
|
||||
std::deque<double> sym_hist;
|
||||
bool sync_NH;
|
||||
bool new_sym;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -49,9 +49,9 @@
|
||||
*/
|
||||
/** Viterbi decoder reversed polynomial A */
|
||||
#define GPS_L2C_V27_POLY_A (0x4F) /* 0b01001111 - reversed 0171*/
|
||||
|
||||
/** Viterbi decoder reversed polynomial B */
|
||||
#define GPS_L2C_V27_POLY_B (0x6D) /* 0b01101101 - reversed 0133 */
|
||||
|
||||
/*
|
||||
* GPS L2C message constants.
|
||||
*/
|
||||
@ -67,7 +67,7 @@
|
||||
/** GPS LC2 CNAV CRC length in bits */
|
||||
#define GPS_CNAV_MSG_CRC_LENGTH (24)
|
||||
/** GPS L2C CNAV message payload length in bits */
|
||||
#define GPS_CNAV_MSG_DATA_LENGTH (GPS_CNAV_MSG_LENGTH-GPS_CNAV_MSG_CRC_LENGTH)
|
||||
#define GPS_CNAV_MSG_DATA_LENGTH (GPS_CNAV_MSG_LENGTH - GPS_CNAV_MSG_CRC_LENGTH)
|
||||
/** GPS L2C CNAV message lock detector threshold */
|
||||
#define GPS_CNAV_LOCK_MAX_CRC_FAILS (10)
|
||||
|
||||
@ -411,7 +411,8 @@ void cnav_msg_decoder_init(cnav_msg_decoder_t *dec)
|
||||
* The time of the last input symbol can be computed from the message ToW and
|
||||
* delay by the formulae:
|
||||
* \code
|
||||
* symbolTime_ms = msg->tow * 6000 + *pdelay * 20
|
||||
* symbolTime_ms = msg->tow * 6000 + *pdelay * 20 (L2)
|
||||
* symbolTime_ms = msg->tow * 6000 + *pdelay * 10 (L5)
|
||||
* \endcode
|
||||
*
|
||||
* \param[in,out] dec Decoder object.
|
||||
|
@ -57,19 +57,31 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
std::string item_type;
|
||||
std::string default_item_type = "gr_complex";
|
||||
float pll_bw_hz;
|
||||
float pll_bw_narrow_hz;
|
||||
float dll_bw_hz;
|
||||
float dll_bw_narrow_hz;
|
||||
float early_late_space_chips;
|
||||
float very_early_late_space_chips;
|
||||
float early_late_space_narrow_chips;
|
||||
float very_early_late_space_narrow_chips;
|
||||
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.5);
|
||||
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0);
|
||||
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 0.25);
|
||||
int extend_correlation_symbols;
|
||||
extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1);
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15);
|
||||
very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6);
|
||||
early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15);
|
||||
very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", 0.6);
|
||||
|
||||
bool track_pilot = configuration->property(role + ".track_pilot", false);
|
||||
|
||||
std::string default_dump_filename = "./track_ch";
|
||||
dump_filename = configuration->property(role + ".dump_filename",
|
||||
@ -88,8 +100,14 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
dump_filename,
|
||||
pll_bw_hz,
|
||||
dll_bw_hz,
|
||||
pll_bw_narrow_hz,
|
||||
dll_bw_narrow_hz,
|
||||
early_late_space_chips,
|
||||
very_early_late_space_chips);
|
||||
very_early_late_space_chips,
|
||||
early_late_space_narrow_chips,
|
||||
very_early_late_space_narrow_chips,
|
||||
extend_correlation_symbols,
|
||||
track_pilot);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -102,14 +120,17 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
GalileoE1DllPllVemlTracking::~GalileoE1DllPllVemlTracking()
|
||||
{}
|
||||
|
||||
|
||||
void GalileoE1DllPllVemlTracking::start_tracking()
|
||||
{
|
||||
tracking_->start_tracking();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set tracking channel unique ID
|
||||
*/
|
||||
@ -125,23 +146,27 @@ void GalileoE1DllPllVemlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
tracking_->set_gnss_synchro(p_gnss_synchro);
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1DllPllVemlTracking::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
//nothing to connect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GalileoE1DllPllVemlTracking::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if(top_block) { /* top_block is not null */};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_left_block()
|
||||
{
|
||||
return tracking_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GalileoE1DllPllVemlTracking::get_right_block()
|
||||
{
|
||||
return tracking_;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking.cc
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* \file gps_l5idll_pll_tracking.cc
|
||||
* \file gps_l5i_dll_pll_tracking.cc
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for GPS L5i to a TrackingInterface
|
||||
* \author Javier Arribas, 2017. jarribas(at)cttc.es
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
return role_;
|
||||
}
|
||||
|
||||
//! Returns "GPS_L2_M_DLL_PLL_Tracking"
|
||||
//! Returns "GPS_L5i_DLL_PLL_Tracking"
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GPS_L5i_DLL_PLL_Tracking";
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -53,8 +53,14 @@ galileo_e1_dll_pll_veml_make_tracking_cc(long if_freq,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
float dll_bw_hz,
|
||||
float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz,
|
||||
float early_late_space_chips,
|
||||
float very_early_late_space_chips);
|
||||
float very_early_late_space_chips,
|
||||
float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a code DLL + carrier PLL VEML (Very Early
|
||||
@ -88,8 +94,14 @@ private:
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
float dll_bw_hz,
|
||||
float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz,
|
||||
float early_late_space_chips,
|
||||
float very_early_late_space_chips);
|
||||
float very_early_late_space_chips,
|
||||
float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
|
||||
galileo_e1_dll_pll_veml_tracking_cc(long if_freq,
|
||||
long fs_in, unsigned
|
||||
@ -98,12 +110,25 @@ private:
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
float dll_bw_hz,
|
||||
float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz,
|
||||
float early_late_space_chips,
|
||||
float very_early_late_space_chips);
|
||||
float very_early_late_space_chips,
|
||||
float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
|
||||
bool cn0_and_tracking_lock_status();
|
||||
void do_correlation_step(const gr_complex* input_samples);
|
||||
void run_dll_pll(bool disable_costas_loop);
|
||||
void update_local_code();
|
||||
|
||||
void update_local_carrier();
|
||||
bool acquire_secondary();
|
||||
|
||||
void clear_tracking_vars();
|
||||
|
||||
void log_data();
|
||||
|
||||
// tracking configuration vars
|
||||
unsigned int d_vector_length;
|
||||
@ -114,16 +139,29 @@ private:
|
||||
long d_if_freq;
|
||||
long d_fs_in;
|
||||
|
||||
//tracking state machine
|
||||
int d_state;
|
||||
|
||||
//Integration period in samples
|
||||
int d_correlation_length_samples;
|
||||
int d_n_correlator_taps;
|
||||
double d_early_late_spc_chips;
|
||||
double d_very_early_late_spc_chips;
|
||||
|
||||
float* d_ca_code;
|
||||
double d_early_late_spc_narrow_chips;
|
||||
double d_very_early_late_spc_narrow_chips;
|
||||
|
||||
float* d_tracking_code;
|
||||
float* d_data_code;
|
||||
float* d_local_code_shift_chips;
|
||||
gr_complex* d_correlator_outs;
|
||||
cpu_multicorrelator_real_codes multicorrelator_cpu;
|
||||
//todo: currently the multicorrelator does not support adding extra correlator
|
||||
//with different local code, thus we need extra multicorrelator instance.
|
||||
//Implement this functionality inside multicorrelator class
|
||||
//as an enhancement to increase the performance
|
||||
float* d_local_code_data_shift_chips;
|
||||
cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel
|
||||
|
||||
gr_complex *d_Very_Early;
|
||||
gr_complex *d_Early;
|
||||
@ -131,6 +169,22 @@ private:
|
||||
gr_complex *d_Late;
|
||||
gr_complex *d_Very_Late;
|
||||
|
||||
int d_extend_correlation_symbols;
|
||||
int d_extend_correlation_symbols_count;
|
||||
bool d_enable_extended_integration;
|
||||
int d_current_symbol;
|
||||
|
||||
gr_complex d_VE_accu;
|
||||
gr_complex d_E_accu;
|
||||
gr_complex d_P_accu;
|
||||
gr_complex d_L_accu;
|
||||
gr_complex d_VL_accu;
|
||||
|
||||
bool d_track_pilot;
|
||||
gr_complex *d_Prompt_Data;
|
||||
|
||||
double d_code_phase_step_chips;
|
||||
double d_carrier_phase_step_rad;
|
||||
// remaining code phase and carrier phase between tracking loops
|
||||
double d_rem_code_phase_samples;
|
||||
double d_rem_carr_phase_rad;
|
||||
@ -143,11 +197,24 @@ private:
|
||||
double d_acq_code_phase_samples;
|
||||
double d_acq_carrier_doppler_hz;
|
||||
|
||||
// tracking parameters
|
||||
float d_dll_bw_hz;
|
||||
float d_pll_bw_hz;
|
||||
float d_dll_bw_narrow_hz;
|
||||
float d_pll_bw_narrow_hz;
|
||||
// tracking vars
|
||||
double d_carr_error_hz;
|
||||
double d_carr_error_filt_hz;
|
||||
double d_code_error_chips;
|
||||
double d_code_error_filt_chips;
|
||||
|
||||
double d_K_blk_samples;
|
||||
|
||||
double d_code_freq_chips;
|
||||
double d_carrier_doppler_hz;
|
||||
double d_acc_carrier_phase_rad;
|
||||
double d_acc_code_phase_secs;
|
||||
double d_rem_code_phase_chips;
|
||||
double d_code_phase_samples;
|
||||
|
||||
//PRN period in samples
|
||||
int d_current_prn_length_samples;
|
||||
@ -158,16 +225,13 @@ private:
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
std::deque<gr_complex> d_Prompt_buffer_deque;
|
||||
gr_complex* d_Prompt_buffer;
|
||||
double d_carrier_lock_test;
|
||||
double d_CN0_SNV_dB_Hz;
|
||||
double d_carrier_lock_threshold;
|
||||
int d_carrier_lock_fail_counter;
|
||||
|
||||
// control vars
|
||||
bool d_enable_tracking;
|
||||
bool d_pull_in;
|
||||
|
||||
// file dump
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
|
@ -513,7 +513,12 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr
|
||||
consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
|
||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -642,8 +642,8 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
||||
// The first Prompt output not equal to 0 is synchronized with the transition of a navigation data bit.
|
||||
if (d_secondary_lock && d_first_transition)
|
||||
{
|
||||
current_synchro_data.Prompt_I = static_cast<double>((d_Prompt_data).real());
|
||||
current_synchro_data.Prompt_Q = static_cast<double>((d_Prompt_data).imag());
|
||||
current_synchro_data.Prompt_I = static_cast<double>(d_Prompt_data.real());
|
||||
current_synchro_data.Prompt_Q = static_cast<double>(d_Prompt_data.imag());
|
||||
current_synchro_data.Tracking_sample_counter = d_sample_counter + d_current_prn_length_samples;
|
||||
current_synchro_data.Code_phase_samples = d_rem_code_phase_samples;
|
||||
current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad;
|
||||
@ -733,7 +733,13 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute
|
||||
d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
|
||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
|
||||
if (current_synchro_data.Flag_valid_symbol_output)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking_cc.h
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
@ -218,6 +217,9 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::glonass_l1_ca_dll_pll_c_aid_tracking_cc
|
||||
d_preamble_timestamp_s = 0.0;
|
||||
|
||||
d_carrier_frequency_hz = 0.0;
|
||||
d_carrier_doppler_old_hz = 0.0;
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
|
||||
//set_min_output_buffer((long int)300);
|
||||
}
|
||||
@ -270,13 +272,13 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
|
||||
// d_carrier_doppler_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN));
|
||||
// d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
||||
// d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_doppler_hz / static_cast<double>(d_fs_in);
|
||||
d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN));
|
||||
d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast<double>(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)));
|
||||
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
||||
d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_frequency_hz / static_cast<double>(d_fs_in);
|
||||
|
||||
|
||||
// DLL/PLL filter initialization
|
||||
d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator
|
||||
d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator
|
||||
d_code_loop_filter.initialize(); // initialize the code filter
|
||||
|
||||
// generate local reference ALWAYS starting at chip 1 (1 sample per chip)
|
||||
@ -709,6 +711,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
|
||||
// ################## PLL ##########################################################
|
||||
// Update PLL discriminator [rads/Ti -> Secs/Ti]
|
||||
d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GLONASS_TWO_PI; // prompt output
|
||||
d_carrier_doppler_old_hz = d_carrier_doppler_hz;
|
||||
// Carrier discriminator filter
|
||||
// NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan
|
||||
// Input [s/Ti] -> output [Hz]
|
||||
@ -716,7 +719,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __a
|
||||
// PLL to DLL assistance [Secs/Ti]
|
||||
d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz * CURRENT_INTEGRATION_TIME_S) / d_glonass_freq_ch;
|
||||
// code Doppler frequency update
|
||||
d_code_freq_chips = GLONASS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GLONASS_L1_CA_CODE_RATE_HZ) / d_glonass_freq_ch);
|
||||
d_code_freq_chips = GLONASS_L1_CA_CODE_RATE_HZ + (((d_carrier_doppler_hz - d_carrier_doppler_old_hz) * GLONASS_L1_CA_CODE_RATE_HZ) / d_glonass_freq_ch);
|
||||
|
||||
// ################## DLL ##########################################################
|
||||
// DLL discriminator
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking_cc.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
@ -158,6 +157,7 @@ private:
|
||||
double d_code_phase_step_chips;
|
||||
double d_carrier_doppler_hz;
|
||||
double d_carrier_frequency_hz;
|
||||
double d_carrier_doppler_old_hz;
|
||||
double d_carrier_phase_step_rad;
|
||||
double d_acc_carrier_phase_cycles;
|
||||
double d_code_phase_samples;
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
@ -217,6 +216,11 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::glonass_l1_ca_dll_pll_c_aid_tracking_sc
|
||||
d_code_error_filt_chips_Ti = 0.0;
|
||||
d_preamble_timestamp_s = 0.0;
|
||||
d_carr_phase_error_secs_Ti = 0.0;
|
||||
|
||||
d_carrier_frequency_hz = 0.0;
|
||||
d_carrier_doppler_old_hz = 0.0;
|
||||
|
||||
d_glonass_freq_ch = 0;
|
||||
//set_min_output_buffer((long int)300);
|
||||
}
|
||||
|
||||
@ -265,13 +269,13 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
|
||||
|
||||
d_acq_code_phase_samples = corrected_acq_phase_samples;
|
||||
|
||||
d_carrier_doppler_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN));
|
||||
// d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
||||
d_carrier_frequency_hz = d_acq_carrier_doppler_hz + d_if_freq + (DFRQ1_GLO * static_cast<double>(GLONASS_PRN.at(d_acquisition_gnss_synchro->PRN)));;
|
||||
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
||||
|
||||
d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_doppler_hz / static_cast<double>(d_fs_in);
|
||||
d_carrier_phase_step_rad = GLONASS_TWO_PI * d_carrier_frequency_hz / static_cast<double>(d_fs_in);
|
||||
|
||||
// DLL/PLL filter initialization
|
||||
d_carrier_loop_filter.initialize(d_acq_carrier_doppler_hz); // The carrier loop filter implements the Doppler accumulator
|
||||
d_carrier_loop_filter.initialize(d_carrier_frequency_hz); // The carrier loop filter implements the Doppler accumulator
|
||||
d_code_loop_filter.initialize(); // initialize the code filter
|
||||
|
||||
// generate local reference ALWAYS starting at chip 1 (1 sample per chip)
|
||||
@ -700,7 +704,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a
|
||||
// ################## PLL ##########################################################
|
||||
// Update PLL discriminator [rads/Ti -> Secs/Ti]
|
||||
d_carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(std::complex<float>(d_correlator_outs_16sc[1].real(),d_correlator_outs_16sc[1].imag())) / GLONASS_TWO_PI; //prompt output
|
||||
|
||||
d_carrier_doppler_old_hz = d_carrier_doppler_hz;
|
||||
// Carrier discriminator filter
|
||||
// NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan
|
||||
// Input [s/Ti] -> output [Hz]
|
||||
@ -708,7 +712,7 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __a
|
||||
// PLL to DLL assistance [Secs/Ti]
|
||||
d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz * CURRENT_INTEGRATION_TIME_S) / d_glonass_freq_ch;
|
||||
// code Doppler frequency update
|
||||
d_code_freq_chips = GLONASS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GLONASS_L1_CA_CODE_RATE_HZ) / d_glonass_freq_ch);
|
||||
d_code_freq_chips = GLONASS_L1_CA_CODE_RATE_HZ + (((d_carrier_doppler_hz - d_carrier_doppler_old_hz) * GLONASS_L1_CA_CODE_RATE_HZ) / d_glonass_freq_ch);
|
||||
|
||||
// ################## DLL ##########################################################
|
||||
// DLL discriminator
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \file glonass_l1_ca_dll_pll_c_aid_tracking_sc.h
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
@ -160,6 +159,8 @@ private:
|
||||
double d_code_freq_chips;
|
||||
double d_code_phase_step_chips;
|
||||
double d_carrier_doppler_hz;
|
||||
double d_carrier_frequency_hz;
|
||||
double d_carrier_doppler_old_hz;
|
||||
double d_carrier_phase_step_rad;
|
||||
double d_acc_carrier_phase_cycles;
|
||||
double d_code_phase_samples;
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \file glonass_l1_ca_dll_pll_tracking_cc.cc
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
@ -580,7 +579,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribu
|
||||
carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz);
|
||||
// New carrier Doppler frequency estimation
|
||||
d_carrier_frequency_hz += carr_error_filt_hz;
|
||||
d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz;
|
||||
d_carrier_doppler_hz += carr_error_filt_hz;
|
||||
d_code_freq_chips = GLONASS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GLONASS_L1_CA_CODE_RATE_HZ) / d_glonass_freq_ch);
|
||||
|
||||
// ################## DLL ##########################################################
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*!
|
||||
* \file glonass_l1_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L1 C/A to a TrackingInterface
|
||||
* \file glonass_l1_ca_dll_pll_tracking_cc.h
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block
|
||||
* \author Gabriel Araujo, 2017. gabriel.araujo.5000(at)gmail.com
|
||||
* \author Luis Esteve, 2017. luis(at)epsilon-formacion.com
|
||||
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
||||
|
@ -875,7 +875,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri
|
||||
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -694,7 +694,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::general_work(
|
||||
//consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -879,7 +879,12 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri
|
||||
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -185,6 +185,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc(
|
||||
|
||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
||||
{
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
/*
|
||||
* correct the code phase according to the delay between acq and trk
|
||||
*/
|
||||
@ -521,6 +522,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::~Gps_L1_Ca_Dll_Pll_Tracking_cc()
|
||||
int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
// process vars
|
||||
double carr_error_hz = 0.0;
|
||||
double carr_error_filt_hz = 0.0;
|
||||
@ -736,7 +738,13 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__
|
||||
|
||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_current_prn_length_samples; // count for the processed samples
|
||||
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -536,7 +536,12 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu
|
||||
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -549,7 +549,12 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri
|
||||
d_sample_counter_seconds = d_sample_counter_seconds + ( static_cast<double>(d_current_prn_length_samples) / static_cast<double>(d_fs_in) );
|
||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||
|
||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -729,7 +729,12 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__(
|
||||
}
|
||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_current_prn_length_samples; // count for the processed samples
|
||||
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -257,14 +257,14 @@ void gps_l5i_dll_pll_tracking_cc::start_tracking()
|
||||
sys = sys_.substr(0,1);
|
||||
|
||||
// DEBUG OUTPUT
|
||||
std::cout << "Tracking of GPS L2CM signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
||||
LOG(INFO) << "Starting GPS L2CM tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
|
||||
std::cout << "Tracking of GPS L5i signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
||||
LOG(INFO) << "Starting GPS L5i tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
|
||||
|
||||
// enable tracking
|
||||
d_pull_in = true;
|
||||
d_enable_tracking = true;
|
||||
|
||||
LOG(INFO) << "GPS L2CM PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz
|
||||
LOG(INFO) << "GPS L5i PULL-IN Doppler [Hz]=" << d_carrier_doppler_hz
|
||||
<< " Code Phase correction [samples]=" << delay_correction_samples
|
||||
<< " PULL-IN Code Phase [samples]=" << d_acq_code_phase_samples;
|
||||
}
|
||||
@ -729,7 +729,14 @@ int gps_l5i_dll_pll_tracking_cc::general_work (int noutput_items __attribute__((
|
||||
}
|
||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||
d_sample_counter += d_current_prn_length_samples; // count for the processed samples
|
||||
return 1; // output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||
if (d_enable_tracking)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,7 +53,6 @@ template<typename Data>class concurrent_queue;
|
||||
class AcquisitionInterface: public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
//virtual void set_active(bool active) = 0;
|
||||
virtual void set_gnss_synchro(Gnss_Synchro* gnss_synchro) = 0;
|
||||
virtual void set_channel(unsigned int channel) = 0;
|
||||
virtual void set_threshold(float threshold) = 0;
|
||||
|
@ -3,7 +3,9 @@
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#define _POSIX_PTHREAD_SEMANTICS /* for Sun */
|
||||
#ifndef _REENTRANT
|
||||
#define _REENTRANT /* for Sun */
|
||||
#endif
|
||||
#include <asn_internal.h>
|
||||
#include <GeneralizedTime.h>
|
||||
#include <errno.h>
|
||||
|
@ -44,18 +44,18 @@ ControlMessageFactory::~ControlMessageFactory()
|
||||
{}
|
||||
|
||||
|
||||
boost::shared_ptr<gr::message> ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what)
|
||||
gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what)
|
||||
{
|
||||
std::shared_ptr<ControlMessage> control_message = std::make_shared<ControlMessage>();
|
||||
control_message->who = who;
|
||||
control_message->what = what;
|
||||
boost::shared_ptr<gr::message> queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
|
||||
gr::message::sptr queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
|
||||
memcpy(queue_message->msg(), control_message.get(), sizeof(ControlMessage));
|
||||
return queue_message;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> ControlMessageFactory::GetControlMessages(boost::shared_ptr<gr::message> queue_message)
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> ControlMessageFactory::GetControlMessages(gr::message::sptr queue_message)
|
||||
{
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = std::make_shared<std::vector<std::shared_ptr<ControlMessage>>>();
|
||||
unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage);
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
//! Virtual destructor
|
||||
virtual ~ControlMessageFactory();
|
||||
|
||||
boost::shared_ptr<gr::message> GetQueueMessage(unsigned int who, unsigned int what);
|
||||
gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what);
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> GetControlMessages(gr::message::sptr queue_message);
|
||||
};
|
||||
|
||||
|
@ -158,7 +158,7 @@ void ControlThread::run()
|
||||
}
|
||||
|
||||
|
||||
void ControlThread::set_control_queue(boost::shared_ptr<gr::msg_queue> control_queue)
|
||||
void ControlThread::set_control_queue(gr::msg_queue::sptr control_queue)
|
||||
{
|
||||
if (flowgraph_->running())
|
||||
{
|
||||
@ -445,7 +445,7 @@ void ControlThread::init()
|
||||
void ControlThread::read_control_messages()
|
||||
{
|
||||
DLOG(INFO) << "Reading control messages from queue";
|
||||
boost::shared_ptr<gr::message> queue_message = control_queue_->delete_head();
|
||||
gr::message::sptr queue_message = control_queue_->delete_head();
|
||||
if (queue_message != 0)
|
||||
{
|
||||
control_messages_ = control_message_factory_->GetControlMessages(queue_message);
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
*
|
||||
* \param[in] boost::shared_ptr<gr::msg_queue> control_queue
|
||||
*/
|
||||
void set_control_queue(boost::shared_ptr<gr::msg_queue> control_queue);
|
||||
void set_control_queue(gr::msg_queue::sptr control_queue);
|
||||
|
||||
|
||||
unsigned int processed_control_messages()
|
||||
@ -146,7 +146,7 @@ private:
|
||||
void apply_action(unsigned int what);
|
||||
std::shared_ptr<GNSSFlowgraph> flowgraph_;
|
||||
std::shared_ptr<ConfigurationInterface> configuration_;
|
||||
boost::shared_ptr<gr::msg_queue> control_queue_;
|
||||
gr::msg_queue::sptr control_queue_;
|
||||
std::shared_ptr<ControlMessageFactory> control_message_factory_;
|
||||
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages_;
|
||||
bool stop_;
|
||||
|
@ -48,10 +48,11 @@
|
||||
#include "nsr_file_signal_source.h"
|
||||
#include "two_bit_cpx_file_signal_source.h"
|
||||
#include "spir_file_signal_source.h"
|
||||
#include "spir_gss6450_file_signal_source.h"
|
||||
#include "rtl_tcp_signal_source.h"
|
||||
#include "two_bit_packed_file_signal_source.h"
|
||||
#include "labsat_signal_source.h"
|
||||
#include "channel.h"
|
||||
|
||||
#include "signal_conditioner.h"
|
||||
#include "array_signal_conditioner.h"
|
||||
#include "byte_to_short.h"
|
||||
@ -93,6 +94,7 @@
|
||||
#include "gps_l5i_dll_pll_tracking.h"
|
||||
#include "gps_l1_ca_telemetry_decoder.h"
|
||||
#include "gps_l2c_telemetry_decoder.h"
|
||||
#include "gps_l5_telemetry_decoder.h"
|
||||
#include "galileo_e1b_telemetry_decoder.h"
|
||||
#include "galileo_e5a_telemetry_decoder.h"
|
||||
#include "glonass_l1_ca_telemetry_decoder.h"
|
||||
@ -154,7 +156,7 @@ GNSSBlockFactory::~GNSSBlockFactory()
|
||||
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource(
|
||||
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue, int ID)
|
||||
std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue, int ID)
|
||||
{
|
||||
std::string default_implementation = "File_Signal_Source";
|
||||
std::string role = "SignalSource"; //backwards compatibility for old conf files
|
||||
@ -233,7 +235,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalConditioner(
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
std::string default_implementation = "Hybrid_Observables";
|
||||
@ -243,12 +244,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetObservables(std::shared
|
||||
Galileo_channels += configuration->property("Channels_5X.count", 0);
|
||||
unsigned int GPS_channels = configuration->property("Channels_1C.count", 0);
|
||||
GPS_channels += configuration->property("Channels_2S.count", 0);
|
||||
GPS_channels += configuration->property("Channels_L5.count", 0);
|
||||
unsigned int Glonass_channels = configuration->property("Channels_1G.count", 0);
|
||||
return GetBlock(configuration, "Observables", implementation, Galileo_channels + GPS_channels + Glonass_channels, Galileo_channels + GPS_channels + Glonass_channels);
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
std::string default_implementation = "RTKLIB_PVT";
|
||||
@ -258,6 +259,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<Con
|
||||
Galileo_channels += configuration->property("Channels_5X.count", 0);
|
||||
unsigned int GPS_channels = configuration->property("Channels_1C.count", 0);
|
||||
GPS_channels += configuration->property("Channels_2S.count", 0);
|
||||
GPS_channels += configuration->property("Channels_L5.count", 0);
|
||||
unsigned int Glonass_channels = configuration->property("Channels_1G.count", 0);
|
||||
return GetBlock(configuration, "PVT", implementation, Galileo_channels + GPS_channels + Glonass_channels, 0);
|
||||
}
|
||||
@ -267,7 +269,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(std::shared_ptr<Con
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
//"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters
|
||||
//can find their specific configurations when they read the config
|
||||
@ -331,13 +333,13 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
|
||||
return channel_;
|
||||
}
|
||||
|
||||
|
||||
//********* GPS L2C (M) CHANNEL *****************
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
|
||||
LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: "
|
||||
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
|
||||
std::string aux = configuration->property("Acquisition_2S" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
|
||||
@ -396,11 +398,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
|
||||
return channel_;
|
||||
}
|
||||
|
||||
|
||||
//********* GALILEO E1 B CHANNEL *****************
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << channel;
|
||||
@ -463,11 +466,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
|
||||
return channel_;
|
||||
}
|
||||
|
||||
|
||||
//********* GALILEO E5a CHANNEL *****************
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << channel;
|
||||
@ -530,6 +534,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
|
||||
return channel_;
|
||||
}
|
||||
|
||||
|
||||
//********* GLONASS L1 C/A CHANNEL *****************
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
@ -599,8 +604,76 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
|
||||
}
|
||||
|
||||
|
||||
//********* GPS L5 CHANNEL *****************
|
||||
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << channel;
|
||||
std::string id = stream.str();
|
||||
LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: "
|
||||
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
|
||||
std::string aux = configuration->property("Acquisition_L5" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
|
||||
std::string appendix1;
|
||||
if(aux.compare("W") != 0)
|
||||
{
|
||||
appendix1 = boost::lexical_cast<std::string>(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendix1 = "";
|
||||
}
|
||||
aux = configuration->property("Tracking_L5" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
|
||||
std::string appendix2;
|
||||
if(aux.compare("W") != 0)
|
||||
{
|
||||
appendix2 = boost::lexical_cast<std::string>(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendix2 = "";
|
||||
}
|
||||
aux = configuration->property("TelemetryDecoder_L5" + boost::lexical_cast<std::string>(channel) + ".implementation", std::string("W"));
|
||||
std::string appendix3;
|
||||
if(aux.compare("W") != 0)
|
||||
{
|
||||
appendix3 = boost::lexical_cast<std::string>(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendix3 = "";
|
||||
}
|
||||
// Automatically detect input data type
|
||||
std::shared_ptr<InMemoryConfiguration> config;
|
||||
config = std::make_shared<InMemoryConfiguration>();
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string acq_item_type = configuration->property("Acquisition_L5" + appendix1 + ".item_type", default_item_type);
|
||||
std::string trk_item_type = configuration->property("Tracking_L5" + appendix2 + ".item_type", default_item_type);
|
||||
if(acq_item_type.compare(trk_item_type))
|
||||
{
|
||||
LOG(ERROR) << "Acquisition and Tracking blocks must have the same input data type!";
|
||||
}
|
||||
config->set_property("Channel.item_type", acq_item_type);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> pass_through_ = GetBlock(configuration, "Channel", "Pass_Through", 1, 1, queue);
|
||||
std::unique_ptr<AcquisitionInterface> acq_ = GetAcqBlock(configuration, "Acquisition_L5" + appendix1, acq, 1, 0);
|
||||
std::unique_ptr<TrackingInterface> trk_ = GetTrkBlock(configuration, "Tracking_L5" + appendix2, trk, 1, 1);
|
||||
std::unique_ptr<TelemetryDecoderInterface> tlm_ = GetTlmBlock(configuration, "TelemetryDecoder_L5" + appendix3, tlm, 1, 1);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> channel_(new Channel(configuration.get(), channel, std::move(pass_through_),
|
||||
std::move(acq_),
|
||||
std::move(trk_),
|
||||
std::move(tlm_),
|
||||
"Channel", "L5", queue));
|
||||
|
||||
return channel_;
|
||||
}
|
||||
|
||||
|
||||
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFactory::GetChannels(
|
||||
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::string default_implementation = "Pass_Through";
|
||||
std::string tracking_implementation;
|
||||
@ -614,44 +687,45 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
|
||||
unsigned int Channels_1B_count = configuration->property("Channels_1B.count", 0);
|
||||
unsigned int Channels_5X_count = configuration->property("Channels_5X.count", 0);
|
||||
unsigned int Channels_1G_count = configuration->property("Channels_1G.count", 0);
|
||||
unsigned int Channels_L5_count = configuration->property("Channels_L5.count", 0);
|
||||
|
||||
unsigned int total_channels = Channels_1C_count +
|
||||
Channels_2S_count +
|
||||
Channels_1B_count +
|
||||
Channels_5X_count +
|
||||
Channels_1G_count;
|
||||
Channels_1G_count +
|
||||
Channels_L5_count;
|
||||
|
||||
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels(new std::vector<std::unique_ptr<GNSSBlockInterface>>(total_channels));
|
||||
|
||||
//**************** GPS L1 C/A CHANNELS **********************
|
||||
|
||||
LOG(INFO) << "Getting " << Channels_1C_count << " GPS L1 C/A channels";
|
||||
acquisition_implementation = configuration->property("Acquisition_1C.implementation", default_implementation);
|
||||
tracking_implementation = configuration->property("Tracking_1C.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1C.implementation", default_implementation);
|
||||
|
||||
|
||||
for (unsigned int i = 0; i < Channels_1C_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
"Acquisition_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
"Tracking_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
"TelemetryDecoder_1C" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1C(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1C(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
//**************** GPS L2C (M) CHANNELS **********************
|
||||
@ -663,86 +737,112 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
"Acquisition_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
"Tracking_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
"TelemetryDecoder_2S" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_2S(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_2S(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
//**************** GPS L5 CHANNELS **********************
|
||||
LOG(INFO)<< "Getting " << Channels_L5_count << " GPS L5 channels";
|
||||
tracking_implementation = configuration->property("Tracking_L5.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_L5.implementation", default_implementation);
|
||||
acquisition_implementation = configuration->property("Acquisition_L5.implementation", default_implementation);
|
||||
for (unsigned int i = 0; i < Channels_L5_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_L5" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_L5" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_L5" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_L5(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
//**************** GALILEO E1 B (I/NAV OS) CHANNELS **********************
|
||||
|
||||
LOG(INFO) << "Getting " << Channels_1B_count << " GALILEO E1 B (I/NAV OS) channels";
|
||||
tracking_implementation = configuration->property("Tracking_1B.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1B.implementation", default_implementation);
|
||||
acquisition_implementation = configuration->property("Acquisition_1B.implementation", default_implementation);
|
||||
for (unsigned int i = 0; i < Channels_1B_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1B(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
tracking_implementation = configuration->property("Tracking_1B.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_1B.implementation", default_implementation);
|
||||
acquisition_implementation = configuration->property("Acquisition_1B.implementation", default_implementation);
|
||||
for (unsigned int i = 0; i < Channels_1B_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_1B" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1B(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
//**************** GALILEO E5a I (F/NAV OS) CHANNELS **********************
|
||||
LOG(INFO) << "Getting " << Channels_5X_count << " GALILEO E5a I (F/NAV OS) channels";
|
||||
tracking_implementation = configuration->property("Tracking_5X.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_5X.implementation", default_implementation);
|
||||
acquisition_implementation = configuration->property("Acquisition_5X.implementation", default_implementation);
|
||||
for (unsigned int i = 0; i < Channels_5X_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_5X(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
tracking_implementation = configuration->property("Tracking_5X.implementation", default_implementation);
|
||||
telemetry_decoder_implementation = configuration->property("TelemetryDecoder_5X.implementation", default_implementation);
|
||||
acquisition_implementation = configuration->property("Acquisition_5X.implementation", default_implementation);
|
||||
for (unsigned int i = 0; i < Channels_5X_count; i++)
|
||||
{
|
||||
//(i.e. Acquisition_1C0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1C0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_5X" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_5X(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
//**************** GLONASS L1 C/A CHANNELS **********************
|
||||
LOG(INFO) << "Getting " << Channels_1G_count << " GLONASS L1 C/A channels";
|
||||
@ -754,29 +854,30 @@ std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFacto
|
||||
{
|
||||
//(i.e. Acquisition_1G0.implementation=xxxx)
|
||||
std::string acquisition_implementation_specific = configuration->property(
|
||||
"Acquisition_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
"Acquisition_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
acquisition_implementation);
|
||||
//(i.e. Tracking_1G0.implementation=xxxx)
|
||||
std::string tracking_implementation_specific = configuration->property(
|
||||
"Tracking_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
"Tracking_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
tracking_implementation);
|
||||
std::string telemetry_decoder_implementation_specific = configuration->property(
|
||||
"TelemetryDecoder_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
"TelemetryDecoder_1G" + boost::lexical_cast<std::string>(channel_absolute_id) + ".implementation",
|
||||
telemetry_decoder_implementation);
|
||||
|
||||
// Push back the channel to the vector of channels
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1G(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
channels->at(channel_absolute_id) = std::move(GetChannel_1G(configuration,
|
||||
acquisition_implementation_specific,
|
||||
tracking_implementation_specific,
|
||||
telemetry_decoder_implementation_specific,
|
||||
channel_absolute_id,
|
||||
queue));
|
||||
channel_absolute_id++;
|
||||
}
|
||||
|
||||
return channels;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the block with the required configuration and implementation
|
||||
*
|
||||
@ -790,7 +891,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role,
|
||||
std::string implementation, unsigned int in_streams,
|
||||
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue)
|
||||
unsigned int out_streams, gr::msg_queue::sptr queue)
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block;
|
||||
|
||||
@ -871,6 +972,21 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
out_streams, queue));
|
||||
block = std::move(block_);
|
||||
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else if (implementation.compare("Spir_GSS6450_File_Signal_Source") == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block_(new SpirGSS6450FileSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue));
|
||||
block = std::move(block_);
|
||||
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
@ -887,6 +1003,21 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
block = std::move(block_);
|
||||
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else if (implementation.compare("Labsat_Signal_Source") == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block_(new LabsatSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue));
|
||||
block = std::move(block_);
|
||||
}
|
||||
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "GNSS-SDR program ended." << std::endl;
|
||||
@ -1031,7 +1162,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
block = std::move(block_);
|
||||
}
|
||||
|
||||
|
||||
// RESAMPLER -------------------------------------------------------------------
|
||||
else if (implementation.compare("Direct_Resampler") == 0)
|
||||
{
|
||||
@ -1145,9 +1275,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
block = std::move(block_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// TRACKING BLOCKS -------------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
|
||||
{
|
||||
@ -1239,6 +1366,12 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
out_streams));
|
||||
block = std::move(block_);
|
||||
}
|
||||
else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0)
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams,
|
||||
out_streams));
|
||||
block = std::move(block_);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0)
|
||||
{
|
||||
std::unique_ptr<GNSSBlockInterface> block_(new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams,
|
||||
@ -1272,6 +1405,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
out_streams));
|
||||
block = std::move(block_);
|
||||
}
|
||||
|
||||
// PVT -------------------------------------------------------------------------
|
||||
else if ((implementation.compare("RTKLIB_PVT") == 0) || (implementation.compare("GPS_L1_CA_PVT") == 0) || (implementation.compare("Galileo_E1_PVT") == 0) || (implementation.compare("Hybrid_PVT") == 0))
|
||||
{
|
||||
@ -1555,6 +1689,12 @@ std::unique_ptr<TelemetryDecoderInterface> GNSSBlockFactory::GetTlmBlock(
|
||||
out_streams));
|
||||
block = std::move(block_);
|
||||
}
|
||||
else if (implementation.compare("GPS_L5_Telemetry_Decoder") == 0)
|
||||
{
|
||||
std::unique_ptr<TelemetryDecoderInterface> block_(new GpsL5TelemetryDecoder(configuration.get(), role, in_streams,
|
||||
out_streams));
|
||||
block = std::move(block_);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Log fatal. This causes execution to stop.
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
GNSSBlockFactory();
|
||||
virtual ~GNSSBlockFactory();
|
||||
std::unique_ptr<GNSSBlockInterface> GetSignalSource(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue, int ID = -1);
|
||||
gr::msg_queue::sptr queue, int ID = -1);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(std::shared_ptr<ConfigurationInterface> configuration, int ID = -1);
|
||||
|
||||
@ -66,7 +66,7 @@ public:
|
||||
std::unique_ptr<GNSSBlockInterface> GetObservables(std::shared_ptr<ConfigurationInterface> configuration);
|
||||
|
||||
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
/*
|
||||
* \brief Returns the block with the required configuration and implementation
|
||||
@ -74,25 +74,29 @@ public:
|
||||
std::unique_ptr<GNSSBlockInterface> GetBlock(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role, std::string implementation,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue = nullptr);
|
||||
gr::msg_queue::sptr queue = nullptr);
|
||||
|
||||
private:
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_1C(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_2S(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_1B(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_5X(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_L5(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
gr::msg_queue::sptr queue);
|
||||
|
||||
std::unique_ptr<GNSSBlockInterface> GetChannel_1G(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
|
@ -33,7 +33,6 @@
|
||||
*/
|
||||
|
||||
#include "gnss_flowgraph.h"
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
@ -51,8 +50,7 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue)
|
||||
{
|
||||
connected_ = false;
|
||||
running_ = false;
|
||||
@ -91,12 +89,6 @@ void GNSSFlowgraph::start()
|
||||
|
||||
void GNSSFlowgraph::stop()
|
||||
{
|
||||
// for (unsigned int i = 0; i < channels_count_; i++)
|
||||
// {
|
||||
// channels_.at(i)->stop_channel();
|
||||
// LOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
||||
// }
|
||||
// LOG(INFO) << "Threads finished. Return to main program.";
|
||||
top_block_->stop();
|
||||
running_ = false;
|
||||
}
|
||||
@ -291,18 +283,13 @@ void GNSSFlowgraph::connect()
|
||||
}
|
||||
|
||||
std::string gnss_signal = channels_.at(i)->get_signal().get_signal_str(); // use channel's implicit signal!
|
||||
while (gnss_signal.compare(available_GNSS_signals_.front().get_signal_str()) != 0 )
|
||||
{
|
||||
available_GNSS_signals_.push_back(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
}
|
||||
channels_.at(i)->set_signal(available_GNSS_signals_.front());
|
||||
channels_.at(i)->set_signal(search_next_signal(gnss_signal, false));
|
||||
|
||||
if (channels_state_[i] == 1)
|
||||
{
|
||||
channels_.at(i)->start_acquisition();
|
||||
available_GNSS_signals_.pop_front();
|
||||
LOG(INFO) << "Channel " << i << " assigned to " << available_GNSS_signals_.front();
|
||||
LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal();
|
||||
LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition";
|
||||
}
|
||||
else
|
||||
@ -373,77 +360,59 @@ bool GNSSFlowgraph::send_telemetry_msg(pmt::pmt_t msg)
|
||||
*/
|
||||
void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
||||
{
|
||||
DLOG(INFO) << "received " << what << " from " << who;
|
||||
|
||||
DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_;
|
||||
switch (what)
|
||||
{
|
||||
case 0:
|
||||
LOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str();
|
||||
DLOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str();
|
||||
available_GNSS_signals_.push_back(channels_.at(who)->get_signal());
|
||||
//TODO: Optimize the channel and signal matching!
|
||||
while ( channels_.at(who)->get_signal().get_signal_str().compare(available_GNSS_signals_.front().get_signal_str()) != 0 )
|
||||
{
|
||||
available_GNSS_signals_.push_back(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
}
|
||||
channels_.at(who)->set_signal(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
usleep(100);
|
||||
LOG(INFO) << "Channel "<< who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str();
|
||||
channels_.at(who)->set_signal(search_next_signal(channels_.at(who)->get_signal().get_signal_str(), true));
|
||||
DLOG(INFO) << "Channel "<< who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str();
|
||||
channels_.at(who)->start_acquisition();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_.at(who)->get_signal().get_satellite();
|
||||
channels_state_[who] = 2;
|
||||
acq_channels_count_--;
|
||||
if (!available_GNSS_signals_.empty() && acq_channels_count_ < max_acq_channels_)
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
{
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
if(!available_GNSS_signals_.empty() && (acq_channels_count_ < max_acq_channels_) && (channels_state_[i] == 0))
|
||||
{
|
||||
if (channels_state_[i] == 0)
|
||||
{
|
||||
channels_state_[i] = 1;
|
||||
while (channels_.at(i)->get_signal().get_signal_str().compare(available_GNSS_signals_.front().get_signal_str()) != 0 )
|
||||
{
|
||||
available_GNSS_signals_.push_back(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
}
|
||||
channels_.at(i)->set_signal(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
acq_channels_count_++;
|
||||
channels_.at(i)->start_acquisition();
|
||||
break;
|
||||
}
|
||||
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
||||
channels_state_[i] = 1;
|
||||
channels_.at(i)->set_signal(search_next_signal(channels_.at(i)->get_signal().get_signal_str(), true));
|
||||
acq_channels_count_++;
|
||||
DLOG(INFO) << "Channel "<< i << " Starting acquisition " << channels_.at(i)->get_signal().get_satellite() << ", Signal " << channels_.at(i)->get_signal().get_signal_str();
|
||||
channels_.at(i)->start_acquisition();
|
||||
}
|
||||
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
LOG(INFO) << "Channel " << who << " TRK FAILED satellite " << channels_.at(who)->get_signal().get_satellite();
|
||||
DLOG(INFO) << "Number of channels in acquisition = " << acq_channels_count_;
|
||||
|
||||
if (acq_channels_count_ < max_acq_channels_)
|
||||
{
|
||||
channels_state_[who] = 1;
|
||||
acq_channels_count_++;
|
||||
LOG(INFO) << "Channel "<< who << " Starting acquisition " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal_str();
|
||||
channels_.at(who)->start_acquisition();
|
||||
}
|
||||
else
|
||||
{
|
||||
channels_state_[who] = 0;
|
||||
LOG(INFO) << "Channel "<< who << " Idle state";
|
||||
available_GNSS_signals_.push_back( channels_.at(who)->get_signal() );
|
||||
}
|
||||
|
||||
// for (unsigned int i = 0; i < channels_count_; i++)
|
||||
// {
|
||||
// LOG(INFO) << "Channel " << i << " in state " << channels_state_[i] << std::endl;
|
||||
// }
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DLOG(INFO) << "Number of available signals: " << available_GNSS_signals_.size();
|
||||
applied_actions_++;
|
||||
}
|
||||
|
||||
|
||||
@ -555,7 +524,6 @@ void GNSSFlowgraph::init()
|
||||
set_signals_list();
|
||||
set_channels_state();
|
||||
applied_actions_ = 0;
|
||||
|
||||
DLOG(INFO) << "Blocks instantiated. " << channels_count_ << " channels.";
|
||||
}
|
||||
|
||||
@ -580,7 +548,9 @@ void GNSSFlowgraph::set_signals_list()
|
||||
configuration_->property("Channels_2S.count", 0) +
|
||||
configuration_->property("Channels_1B.count", 0) +
|
||||
configuration_->property("Channels_5X.count", 0) +
|
||||
configuration_->property("Channels_1G.count", 0);
|
||||
configuration_->property("Channels_1G.count", 0) +
|
||||
configuration_->property("Channels_5X.count", 0) +
|
||||
configuration_->property("Channels_L5.count", 0);
|
||||
|
||||
/*
|
||||
* Loop to create the list of GNSS Signals
|
||||
@ -692,6 +662,19 @@ void GNSSFlowgraph::set_signals_list()
|
||||
}
|
||||
}
|
||||
|
||||
if (configuration_->property("Channels_L5.count", 0) > 0)
|
||||
{
|
||||
/*
|
||||
* Loop to create GPS L5 signals
|
||||
*/
|
||||
for (available_gnss_prn_iter = available_gps_prn.cbegin();
|
||||
available_gnss_prn_iter != available_gps_prn.cend();
|
||||
available_gnss_prn_iter++)
|
||||
{
|
||||
available_GNSS_signals_.push_back(Gnss_Signal(Gnss_Satellite(std::string("GPS"),
|
||||
*available_gnss_prn_iter), std::string("L5")));
|
||||
}
|
||||
}
|
||||
if (configuration_->property("Channels_SBAS.count", 0) > 0)
|
||||
{
|
||||
/*
|
||||
@ -710,7 +693,7 @@ void GNSSFlowgraph::set_signals_list()
|
||||
if (configuration_->property("Channels_1B.count", 0) > 0)
|
||||
{
|
||||
/*
|
||||
* Loop to create the list of Galileo E1 B signals
|
||||
* Loop to create the list of Galileo E1B signals
|
||||
*/
|
||||
for (available_gnss_prn_iter = available_galileo_prn.cbegin();
|
||||
available_gnss_prn_iter != available_galileo_prn.cend();
|
||||
@ -724,7 +707,7 @@ void GNSSFlowgraph::set_signals_list()
|
||||
if (configuration_->property("Channels_5X.count", 0) > 0 )
|
||||
{
|
||||
/*
|
||||
* Loop to create the list of Galileo E1 B signals
|
||||
* Loop to create the list of Galileo E5a signals
|
||||
*/
|
||||
for (available_gnss_prn_iter = available_galileo_prn.cbegin();
|
||||
available_gnss_prn_iter != available_galileo_prn.cend();
|
||||
@ -759,7 +742,7 @@ void GNSSFlowgraph::set_signals_list()
|
||||
{
|
||||
std::string gnss_signal = (configuration_->property("Channel" + boost::lexical_cast<std::string>(i) + ".signal", std::string("1C")));
|
||||
std::string gnss_system;
|
||||
if((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) ) gnss_system = "GPS";
|
||||
if((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) or (gnss_signal.compare("L5") == 0)) gnss_system = "GPS";
|
||||
if((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0) ) gnss_system = "Galileo";
|
||||
if((gnss_signal.compare("1G") == 0)/*or (gnss_signal.compare("") == 0)*/) gnss_system = "Glonass";
|
||||
unsigned int sat = configuration_->property("Channel" + boost::lexical_cast<std::string>(i) + ".satellite", 0);
|
||||
@ -775,14 +758,6 @@ void GNSSFlowgraph::set_signals_list()
|
||||
gnss_it = available_GNSS_signals_.insert(gnss_it, signal_value);
|
||||
}
|
||||
}
|
||||
|
||||
// **** FOR DEBUGGING THE LIST OF GNSS SIGNALS ****
|
||||
// std::list<Gnss_Signal>::const_iterator available_gnss_list_iter;
|
||||
// for (available_gnss_list_iter = available_GNSS_signals_.cbegin(); available_gnss_list_iter
|
||||
// != available_GNSS_signals_.cend(); available_gnss_list_iter++)
|
||||
// {
|
||||
// std::cout << *available_gnss_list_iter << std::endl;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -797,14 +772,22 @@ void GNSSFlowgraph::set_channels_state()
|
||||
channels_state_.reserve(channels_count_);
|
||||
for (unsigned int i = 0; i < channels_count_; i++)
|
||||
{
|
||||
if (i < max_acq_channels_)
|
||||
{
|
||||
channels_state_.push_back(1);
|
||||
}
|
||||
else
|
||||
channels_state_.push_back(0);
|
||||
if (i < max_acq_channels_) {channels_state_.push_back(1);}
|
||||
else {channels_state_.push_back(0);}
|
||||
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
|
||||
}
|
||||
acq_channels_count_ = max_acq_channels_;
|
||||
DLOG(INFO) << acq_channels_count_ << " channels in acquisition state";
|
||||
}
|
||||
|
||||
Gnss_Signal GNSSFlowgraph::search_next_signal(std::string searched_signal, bool pop)
|
||||
{
|
||||
while(searched_signal.compare(available_GNSS_signals_.front().get_signal_str()) != 0)
|
||||
{
|
||||
available_GNSS_signals_.push_back(available_GNSS_signals_.front());
|
||||
available_GNSS_signals_.pop_front();
|
||||
}
|
||||
Gnss_Signal result = available_GNSS_signals_.front();
|
||||
if(pop){available_GNSS_signals_.pop_front();}
|
||||
return result;
|
||||
}
|
||||
|
@ -63,8 +63,7 @@ public:
|
||||
/*!
|
||||
* \brief Constructor that initializes the receiver flowgraph
|
||||
*/
|
||||
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue);
|
||||
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
@ -119,6 +118,7 @@ private:
|
||||
void set_signals_list();
|
||||
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)
|
||||
Gnss_Signal search_next_signal(std::string searched_signal, bool pop);
|
||||
bool connected_;
|
||||
bool running_;
|
||||
int sources_count_;
|
||||
@ -139,7 +139,7 @@ private:
|
||||
std::vector<std::shared_ptr<ChannelInterface>> channels_;
|
||||
gnss_sdr_sample_counter_sptr ch_out_sample_counter;
|
||||
gr::top_block_sptr top_block_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
gr::msg_queue::sptr queue_;
|
||||
std::list<Gnss_Signal> available_GNSS_signals_;
|
||||
std::vector<unsigned int> channels_state_;
|
||||
};
|
||||
|
@ -32,6 +32,7 @@
|
||||
#ifndef GNSS_SDR_GLONASS_L1_CA_H_
|
||||
#define GNSS_SDR_GLONASS_L1_CA_H_
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <utility> // std::pair
|
||||
#include "MATH_CONSTANTS.h"
|
||||
@ -50,7 +51,7 @@ const double GLONASS_FLATTENING = 1/29825784; //!< Flatten
|
||||
const double GLONASS_GRAVITY = 97803284; //!< Equatorial acceleration of gravity [mGal]
|
||||
const double GLONASS_GRAVITY_CORRECTION = 0.87; //!< Correction to acceleration of gravity at sea-level due to Atmosphere[мGal]
|
||||
const double GLONASS_J2 = 1082625.75e-9; //!< Second zonal harmonic of the geopotential
|
||||
const double GLONASS_J4 = -2370.89e-9; //!<Fourth zonal harmonic of the geopotential
|
||||
const double GLONASS_J4 = -2370.89e-9; //!< Fourth zonal harmonic of the geopotential
|
||||
const double GLONASS_J6 = 6.08e-9; //!< Sixth zonal harmonic of the geopotential
|
||||
const double GLONASS_J8 = 1.40e-11; //!< Eighth zonal harmonic of the geopotential
|
||||
const double GLONASS_U0 = 62636861.4; //!< Normal potential at surface of common terrestrial ellipsoid [m^2/s^2]
|
||||
|
183
src/core/system_parameters/GPS_CNAV.h
Normal file
183
src/core/system_parameters/GPS_CNAV.h
Normal file
@ -0,0 +1,183 @@
|
||||
/*!
|
||||
* \file GPS_CNAV.h
|
||||
* \brief Defines parameters for GPS CNAV
|
||||
* \author Antonio Ramos, 2017. antonio.ramos(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_GPS_CNAV_H_
|
||||
#define GNSS_SDR_GPS_CNAV_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <utility> // std::pair
|
||||
#include "MATH_CONSTANTS.h"
|
||||
|
||||
// CNAV GPS NAVIGATION MESSAGE STRUCTURE
|
||||
// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix III)
|
||||
|
||||
#define GPS_CNAV_PREAMBLE {1, 0, 0, 0, 1, 0, 1, 1}
|
||||
#define GPS_CNAV_PREAMBLE_STR "10001011"
|
||||
#define GPS_CNAV_INV_PREAMBLE_STR "01110100"
|
||||
|
||||
const int GPS_CNAV_DATA_PAGE_BITS = 300;
|
||||
|
||||
// common to all messages
|
||||
const std::vector<std::pair<int,int> > CNAV_PRN( { {9,6} } );
|
||||
const std::vector<std::pair<int,int> > CNAV_MSG_TYPE( { {15,6} } );
|
||||
const std::vector<std::pair<int,int> > CNAV_TOW( { {21,17} } ); //GPS Time Of Week in seconds
|
||||
const double CNAV_TOW_LSB = 6.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALERT_FLAG( { {38,1} } );
|
||||
|
||||
// MESSAGE TYPE 10 (Ephemeris 1)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_WN({{39,13}});
|
||||
const std::vector<std::pair<int,int> > CNAV_HEALTH({{52,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_TOP1({{55,11}});
|
||||
const double CNAV_TOP1_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_URA({{66,5}});
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOE1({{71,11}});
|
||||
const double CNAV_TOE1_LSB = 300.0;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_A({{82,26}}); //Relative to AREF = 26,559,710 meters
|
||||
const double CNAV_DELTA_A_LSB = TWO_N9;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_A_DOT({{108,25}});
|
||||
const double CNAV_A_DOT_LSB = TWO_N21;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_N0({{133,17}});
|
||||
const double CNAV_DELTA_N0_LSB = TWO_N44*PI; //semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_N0_DOT({{150,23}});
|
||||
const double CNAV_DELTA_N0_DOT_LSB = TWO_N57*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_M0({{173,33}});
|
||||
const double CNAV_M0_LSB = TWO_N32*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_E_ECCENTRICITY({{206,33}});
|
||||
const double CNAV_E_ECCENTRICITY_LSB = TWO_N34;
|
||||
const std::vector<std::pair<int,int> > CNAV_OMEGA({{239,33}});
|
||||
const double CNAV_OMEGA_LSB = TWO_N32*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_INTEGRITY_FLAG({{272,1}});
|
||||
const std::vector<std::pair<int,int> > CNAV_L2_PHASING_FLAG({{273,1}});
|
||||
|
||||
// MESSAGE TYPE 11 (Ephemeris 2)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOE2({{39,11}});
|
||||
const double CNAV_TOE2_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_OMEGA0({{50,33}});
|
||||
const double CNAV_OMEGA0_LSB = TWO_N32*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_I0({{83,33}});
|
||||
const double CNAV_I0_LSB = TWO_N32*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_OMEGA_DOT({{116,17}}); //Relative to REF = -2.6 x 10-9 semi-circles/second.
|
||||
const double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_I0_DOT({{133,15}});
|
||||
const double CNAV_I0_DOT_LSB = TWO_N44*PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_CIS({{148,16}});
|
||||
const double CNAV_CIS_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CIC({{164,16}});
|
||||
const double CNAV_CIC_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CRS({{180,24}});
|
||||
const double CNAV_CRS_LSB = TWO_N8;
|
||||
const std::vector<std::pair<int,int> > CNAV_CRC({{204,24}});
|
||||
const double CNAV_CRC_LSB = TWO_N8;
|
||||
const std::vector<std::pair<int,int> > CNAV_CUS({{228,21}});
|
||||
const double CNAV_CUS_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CUC({{249,21}});
|
||||
const double CNAV_CUC_LSB = TWO_N30;
|
||||
|
||||
|
||||
// MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOP2({{39,11}});
|
||||
const double CNAV_TOP2_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED0({{50,5}});
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED1({{55,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED2({{58,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_TOC({{61,11}});
|
||||
const double CNAV_TOC_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF0({{72,26}});
|
||||
const double CNAV_AF0_LSB = TWO_N60;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF1({{98,20}});
|
||||
const double CNAV_AF1_LSB = TWO_N48;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF2({{118,10}});
|
||||
const double CNAV_AF2_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_TGD({{128,13}});
|
||||
const double CNAV_TGD_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL1({{141,13}});
|
||||
const double CNAV_ISCL1_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL2({{154,13}});
|
||||
const double CNAV_ISCL2_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL5I({{167,13}});
|
||||
const double CNAV_ISCL5I_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL5Q({{180,13}});
|
||||
const double CNAV_ISCL5Q_LSB = TWO_N35;
|
||||
//Ionospheric parameters
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA0({{193,8}});
|
||||
const double CNAV_ALPHA0_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA1({{201,8}});
|
||||
const double CNAV_ALPHA1_LSB = TWO_N27;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA2({{209,8}});
|
||||
const double CNAV_ALPHA2_LSB = TWO_N24;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA3({{217,8}});
|
||||
const double CNAV_ALPHA3_LSB = TWO_N24;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA0({{225,8}});
|
||||
const double CNAV_BETA0_LSB = TWO_P11;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA1({{233,8}});
|
||||
const double CNAV_BETA1_LSB = TWO_P14;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA2({{241,8}});
|
||||
const double CNAV_BETA2_LSB = TWO_P16;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA3({{249,8}});
|
||||
const double CNAV_BETA3_LSB = TWO_P16;
|
||||
const std::vector<std::pair<int,int> > CNAV_WNOP({{257,8}});
|
||||
|
||||
|
||||
// MESSAGE TYPE 33 (CLOCK and UTC)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_A0({{128,16}});
|
||||
const double CNAV_A0_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_A1({{144,13}});
|
||||
const double CNAV_A1_LSB = TWO_N51;
|
||||
const std::vector<std::pair<int,int> > CNAV_A2({{157,7}});
|
||||
const double CNAV_A2_LSB = TWO_N68;
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_TLS({{164,8}});
|
||||
const double CNAV_DELTA_TLS_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_TOT({{172,16}});
|
||||
const double CNAV_TOT_LSB = TWO_P4;
|
||||
const std::vector<std::pair<int,int> > CNAV_WN_OT({{188,13}});
|
||||
const double CNAV_WN_OT_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_WN_LSF({{201,13}});
|
||||
const double CNAV_WN_LSF_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_DN({{214,4}});
|
||||
const double CNAV_DN_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_TLSF({{218,8}});
|
||||
const double CNAV_DELTA_TLSF_LSB = 1;
|
||||
|
||||
|
||||
// TODO: Add more frames (Almanac, etc...)
|
||||
|
||||
|
||||
|
||||
#endif /* GNSS_SDR_GPS_CNAV_H_ */
|
@ -37,6 +37,7 @@
|
||||
#include <utility> // std::pair
|
||||
#include "MATH_CONSTANTS.h"
|
||||
#include "gnss_frequencies.h"
|
||||
#include "GPS_CNAV.h"
|
||||
|
||||
// Physical constants
|
||||
const double GPS_L2_C_m_s = 299792458.0; //!< The speed of light, [m/s]
|
||||
@ -92,152 +93,10 @@ const int32_t GPS_L2C_M_INIT_REG[115] =
|
||||
0706202440, 0705056276, 0020373522, 0746013617,
|
||||
0132720621, 0434015513, 0566721727, 0140633660};
|
||||
|
||||
// CNAV GPS NAVIGATION MESSAGE STRUCTURE
|
||||
// NAVIGATION MESSAGE FIELDS POSITIONS (from IS-GPS-200E Appendix III)
|
||||
|
||||
#define GPS_CNAV_PREAMBLE {1, 0, 0, 0, 1, 0, 1, 1}
|
||||
#define GPS_CNAV_PREAMBLE_STR "10001011"
|
||||
#define GPS_CNAV_INV_PREAMBLE_STR "01110100"
|
||||
|
||||
const int GPS_L2_CNAV_DATA_PAGE_BITS = 300; //!< GPS L2 CNAV page length, including preamble and CRC [bits]
|
||||
const int GPS_L2_SYMBOLS_PER_BIT = 2;
|
||||
const int GPS_L2_SAMPLES_PER_SYMBOL = 1;
|
||||
const int GPS_L2_CNAV_DATA_PAGE_SYMBOLS = 600;
|
||||
const int GPS_L2_CNAV_DATA_PAGE_DURATION_S = 12;
|
||||
|
||||
// common to all messages
|
||||
const std::vector<std::pair<int,int> > CNAV_PRN( { {9,6} } );
|
||||
const std::vector<std::pair<int,int> > CNAV_MSG_TYPE( { {15,6} } );
|
||||
const std::vector<std::pair<int,int> > CNAV_TOW( { {21,17} } ); //GPS Time Of Week in seconds
|
||||
const double CNAV_TOW_LSB = 6.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALERT_FLAG( { {38,1} } );
|
||||
|
||||
// MESSAGE TYPE 10 (Ephemeris 1)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_WN({{39,13}});
|
||||
const std::vector<std::pair<int,int> > CNAV_HEALTH({{52,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_TOP1({{55,11}});
|
||||
const double CNAV_TOP1_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_URA({{66,5}});
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOE1({{71,11}});
|
||||
const double CNAV_TOE1_LSB = 300.0;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_A({{82,26}}); //Relative to AREF = 26,559,710 meters
|
||||
const double CNAV_DELTA_A_LSB = TWO_N9;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_A_DOT({{108,25}});
|
||||
const double CNAV_A_DOT_LSB = TWO_N21;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_N0({{133,17}});
|
||||
const double CNAV_DELTA_N0_LSB = TWO_N44*GPS_L2_PI; //semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_N0_DOT({{150,23}});
|
||||
const double CNAV_DELTA_N0_DOT_LSB = TWO_N57*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_M0({{173,33}});
|
||||
const double CNAV_M0_LSB = TWO_N32*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_E_ECCENTRICITY({{206,33}});
|
||||
const double CNAV_E_ECCENTRICITY_LSB = TWO_N34;
|
||||
const std::vector<std::pair<int,int> > CNAV_OMEGA({{239,33}});
|
||||
const double CNAV_OMEGA_LSB = TWO_N32*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_INTEGRITY_FLAG({{272,1}});
|
||||
const std::vector<std::pair<int,int> > CNAV_L2_PHASING_FLAG({{273,1}});
|
||||
|
||||
// MESSAGE TYPE 11 (Ephemeris 2)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOE2({{39,11}});
|
||||
const double CNAV_TOE2_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_OMEGA0({{50,33}});
|
||||
const double CNAV_OMEGA0_LSB = TWO_N32*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_I0({{83,33}});
|
||||
const double CNAV_I0_LSB = TWO_N32*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_OMEGA_DOT({{116,17}}); //Relative to REF = -2.6 x 10-9 semi-circles/second.
|
||||
const double CNAV_DELTA_OMEGA_DOT_LSB = TWO_N44*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_I0_DOT({{133,15}});
|
||||
const double CNAV_I0_DOT_LSB = TWO_N44*GPS_L2_PI;//semi-circles to radians
|
||||
const std::vector<std::pair<int,int> > CNAV_CIS({{148,16}});
|
||||
const double CNAV_CIS_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CIC({{164,16}});
|
||||
const double CNAV_CIC_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CRS({{180,24}});
|
||||
const double CNAV_CRS_LSB = TWO_N8;
|
||||
const std::vector<std::pair<int,int> > CNAV_CRC({{204,24}});
|
||||
const double CNAV_CRC_LSB = TWO_N8;
|
||||
const std::vector<std::pair<int,int> > CNAV_CUS({{228,21}});
|
||||
const double CNAV_CUS_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_CUC({{249,21}});
|
||||
const double CNAV_CUC_LSB = TWO_N30;
|
||||
|
||||
|
||||
// MESSAGE TYPE 30 (CLOCK, IONO, GRUP DELAY)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_TOP2({{39,11}});
|
||||
const double CNAV_TOP2_LSB = 300.0;
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED0({{50,5}});
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED1({{55,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_URA_NED2({{58,3}});
|
||||
const std::vector<std::pair<int,int> > CNAV_TOC({{61,11}});
|
||||
const double CNAV_TOC_LSB = 300.0;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF0({{72,26}});
|
||||
const double CNAV_AF0_LSB = TWO_N60;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF1({{98,20}});
|
||||
const double CNAV_AF1_LSB = TWO_N48;
|
||||
const std::vector<std::pair<int,int> > CNAV_AF2({{118,10}});
|
||||
const double CNAV_AF2_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_TGD({{128,13}});
|
||||
const double CNAV_TGD_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL1({{141,13}});
|
||||
const double CNAV_ISCL1_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL2({{154,13}});
|
||||
const double CNAV_ISCL2_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL5I({{167,13}});
|
||||
const double CNAV_ISCL5I_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_ISCL5Q({{180,13}});
|
||||
const double CNAV_ISCL5Q_LSB = TWO_N35;
|
||||
//Ionospheric parameters
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA0({{193,8}});
|
||||
const double CNAV_ALPHA0_LSB = TWO_N30;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA1({{201,8}});
|
||||
const double CNAV_ALPHA1_LSB = TWO_N27;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA2({{209,8}});
|
||||
const double CNAV_ALPHA2_LSB = TWO_N24;
|
||||
const std::vector<std::pair<int,int> > CNAV_ALPHA3({{217,8}});
|
||||
const double CNAV_ALPHA3_LSB = TWO_N24;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA0({{225,8}});
|
||||
const double CNAV_BETA0_LSB = TWO_P11;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA1({{233,8}});
|
||||
const double CNAV_BETA1_LSB = TWO_P14;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA2({{241,8}});
|
||||
const double CNAV_BETA2_LSB = TWO_P16;
|
||||
const std::vector<std::pair<int,int> > CNAV_BETA3({{249,8}});
|
||||
const double CNAV_BETA3_LSB = TWO_P16;
|
||||
const std::vector<std::pair<int,int> > CNAV_WNOP({{257,8}});
|
||||
|
||||
|
||||
// MESSAGE TYPE 33 (CLOCK and UTC)
|
||||
|
||||
const std::vector<std::pair<int,int> > CNAV_A0({{128,16}});
|
||||
const double CNAV_A0_LSB = TWO_N35;
|
||||
const std::vector<std::pair<int,int> > CNAV_A1({{144,13}});
|
||||
const double CNAV_A1_LSB = TWO_N51;
|
||||
const std::vector<std::pair<int,int> > CNAV_A2({{157,7}});
|
||||
const double CNAV_A2_LSB = TWO_N68;
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_TLS({{164,8}});
|
||||
const double CNAV_DELTA_TLS_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_TOT({{172,16}});
|
||||
const double CNAV_TOT_LSB = TWO_P4;
|
||||
const std::vector<std::pair<int,int> > CNAV_WN_OT({{188,13}});
|
||||
const double CNAV_WN_OT_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_WN_LSF({{201,13}});
|
||||
const double CNAV_WN_LSF_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_DN({{214,4}});
|
||||
const double CNAV_DN_LSB = 1;
|
||||
const std::vector<std::pair<int,int> > CNAV_DELTA_TLSF({{218,8}});
|
||||
const double CNAV_DELTA_TLSF_LSB = 1;
|
||||
|
||||
|
||||
// TODO: Add more frames (Almanac, etc...)
|
||||
|
||||
|
||||
|
||||
#endif /* GNSS_SDR_GPS_L2C_H_ */
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <cstdint>
|
||||
#include "MATH_CONSTANTS.h"
|
||||
#include "gnss_frequencies.h"
|
||||
#include "GPS_CNAV.h"
|
||||
|
||||
// Physical constants
|
||||
const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s]
|
||||
@ -47,19 +48,21 @@ const double GPS_L5_F = -4.442807633e-10; //!< Constant, [s/(m)^(1
|
||||
|
||||
|
||||
// carrier and code frequencies
|
||||
const double GPS_L5_FREQ_HZ = FREQ5; //!< L2 [Hz]
|
||||
const double GPS_L5_FREQ_HZ = FREQ5; //!< L5 [Hz]
|
||||
|
||||
const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
|
||||
const int GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
|
||||
const double GPS_L5i_PERIOD = 0.001; //!< GPS L2 M code period [seconds]
|
||||
const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds]
|
||||
const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds]
|
||||
|
||||
const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s]
|
||||
const int GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
|
||||
const double GPS_L5q_PERIOD = 0.001; //!< GPS L2 M code period [seconds]
|
||||
const int GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips]
|
||||
const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds]
|
||||
|
||||
const int GPS_L5_HISTORY_DEEP = 5;
|
||||
|
||||
const int32_t GPS_L5i_INIT_REG[210] =
|
||||
{266, 365, 804, 1138,
|
||||
{266, 365, 804, 1138,
|
||||
1509, 1559, 1756, 2084,
|
||||
2170, 2303, 2527, 2687,
|
||||
2930, 3471, 3940, 4132,
|
||||
@ -172,6 +175,12 @@ const int32_t GPS_L5q_INIT_REG[210] =
|
||||
2765, 37, 1943, 7977,
|
||||
2512, 4451, 4071};
|
||||
|
||||
|
||||
const int GPS_L5_CNAV_DATA_PAGE_BITS = 300; //!< GPS L5 CNAV page length, including preamble and CRC [bits]
|
||||
const int GPS_L5_SYMBOLS_PER_BIT = 2;
|
||||
const int GPS_L5_SAMPLES_PER_SYMBOL = 10;
|
||||
const int GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600;
|
||||
const int GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6;
|
||||
const int GPS_L5_NH_CODE_LENGTH = 10;
|
||||
const int GPS_L5_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1};
|
||||
|
||||
#endif /* GNSS_SDR_GPS_L5_H_ */
|
||||
|
@ -57,7 +57,7 @@ const double Galileo_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-car
|
||||
const double Galileo_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz]
|
||||
const double Galileo_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips]
|
||||
const double Galileo_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second]
|
||||
const double Galileo_E1_C_SECONDARY_CODE_LENGTH = 25.0; //!< Galileo E1-C secondary code length [chips]
|
||||
const int Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips]
|
||||
const int Galileo_E1_NUMBER_OF_CODES = 50;
|
||||
|
||||
const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here)
|
||||
|
@ -42,6 +42,7 @@
|
||||
*/
|
||||
|
||||
const double PI = 3.1415926535897932; //!< pi
|
||||
const double PI_2 = 2.0 * PI; //!< 2 * pi
|
||||
|
||||
const double TWO_P4 = (16); //!< 2^4
|
||||
const double TWO_P11 = (2048); //!< 2^11
|
||||
|
@ -29,30 +29,27 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "glonass_gnav_almanac.h"
|
||||
#include <cmath>
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "gnss_satellite.h"
|
||||
|
||||
Glonass_Gnav_Almanac::Glonass_Gnav_Almanac()
|
||||
{
|
||||
i_satellite_freq_channel = 0;
|
||||
i_satellite_PRN = 0;
|
||||
i_satellite_slot_number = 0;
|
||||
|
||||
d_n_A = 0.0;
|
||||
d_H_n_A = 0.0;
|
||||
d_lambda_n_A = 0.0;
|
||||
d_t_lambda_n_A = 0.0;
|
||||
d_Delta_i_n_A = 0.0;
|
||||
d_Delta_T_n_A = 0.0;
|
||||
d_Delta_T_n_A_dot = 0.0;
|
||||
d_epsilon_n_A = 0.0;
|
||||
d_omega_n_A = 0.0;
|
||||
d_M_n_A = 0.0;
|
||||
d_KP = 0.0;
|
||||
d_tau_n_A = 0.0;
|
||||
d_C_n = false;
|
||||
d_l_n = false;
|
||||
i_satellite_freq_channel = 0;
|
||||
i_satellite_PRN = 0;
|
||||
i_satellite_slot_number = 0;
|
||||
|
||||
d_n_A = 0.0;
|
||||
d_H_n_A = 0.0;
|
||||
d_lambda_n_A = 0.0;
|
||||
d_t_lambda_n_A = 0.0;
|
||||
d_Delta_i_n_A = 0.0;
|
||||
d_Delta_T_n_A = 0.0;
|
||||
d_Delta_T_n_A_dot = 0.0;
|
||||
d_epsilon_n_A = 0.0;
|
||||
d_omega_n_A = 0.0;
|
||||
d_M_n_A = 0.0;
|
||||
d_KP = 0.0;
|
||||
d_tau_n_A = 0.0;
|
||||
d_C_n = false;
|
||||
d_l_n = false;
|
||||
}
|
||||
|
@ -34,9 +34,6 @@
|
||||
#ifndef GNSS_SDR_GLONASS_ALMANAC_H_
|
||||
#define GNSS_SDR_GLONASS_ALMANAC_H_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "boost/assign.hpp"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
|
||||
/*!
|
||||
@ -59,8 +56,8 @@ public:
|
||||
double d_M_n_A; //!< Type of satellite n_A [dimensionless]
|
||||
double d_KP; //!< Notification on forthcoming leap second correction of UTC [dimensionless]
|
||||
double d_tau_n_A; //!< Coarse value of d_n_A satellite time correction to GLONASS time at instant t_lambdan_A[s]
|
||||
bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless]
|
||||
bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
bool d_C_n; //!< Generalized “unhealthy flag” of n_A satellite at instant of almanac upload [dimensionless]
|
||||
bool d_l_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
|
||||
// Satellite Identification Information
|
||||
int i_satellite_freq_channel; //!< SV Frequency Channel Number
|
||||
|
@ -32,56 +32,55 @@
|
||||
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include <cmath>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "gnss_satellite.h"
|
||||
|
||||
Glonass_Gnav_Ephemeris::Glonass_Gnav_Ephemeris()
|
||||
{
|
||||
d_m = 0.0; //!< String number within frame [dimensionless]
|
||||
d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s]
|
||||
d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s]
|
||||
d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless]
|
||||
d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te),
|
||||
d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km].
|
||||
d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km]
|
||||
d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km]
|
||||
d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_B_n = 0.0; //!< Health flag [dimensionless]
|
||||
d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless]
|
||||
d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days]
|
||||
d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless]
|
||||
d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation
|
||||
d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
d_E_n = 0.0; //!< Characterises "age" of a current information [days]
|
||||
d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes]
|
||||
d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
d_m = 0.0; //!< String number within frame [dimensionless]
|
||||
d_t_k = 0.0; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s]
|
||||
d_t_b = 0.0; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s]
|
||||
d_M = 0.0; //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
d_gamma_n = 0.0; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless]
|
||||
d_tau_n = 0.0; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te),
|
||||
d_Xn = 0.0; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km].
|
||||
d_Yn = 0.0; //!< Earth-fixed coordinate y of the satellite in PZ-90.02 coordinate system [km]
|
||||
d_Zn = 0.0; //!< Earth-fixed coordinate z of the satellite in PZ-90.02 coordinate system [km]
|
||||
d_VXn = 0.0; //!< Earth-fixed velocity coordinate x of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_VYn = 0.0; //!< Earth-fixed velocity coordinate y of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_VZn = 0.0; //!< Earth-fixed velocity coordinate z of the satellite in PZ-90.02 coordinate system [km/s]
|
||||
d_AXn = 0.0; //!< Earth-fixed acceleration coordinate x of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_AYn = 0.0; //!< Earth-fixed acceleration coordinate y of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_AZn = 0.0; //!< Earth-fixed acceleration coordinate z of the satellite in PZ-90.02 coordinate system [km/s^2]
|
||||
d_B_n = 0.0; //!< Health flag [dimensionless]
|
||||
d_P = 0.0; //!< Technological parameter of control segment, indication the satellite operation mode in respect of time parameters [dimensionless]
|
||||
d_N_T = 0.0; //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days]
|
||||
d_F_T = 0.0; //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless]
|
||||
d_n = 0.0; //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation
|
||||
d_Delta_tau_n = 0.0; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
d_E_n = 0.0; //!< Characterises "age" of a current information [days]
|
||||
d_P_1 = 0.0; //!< Flag of the immediate data updating [minutes]
|
||||
d_P_2 = false; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
d_P_3 = false; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
d_P_4 = false; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
d_l3rd_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
d_l5th_n = false; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
|
||||
// Satellite Identification Information
|
||||
i_satellite_freq_channel = 0; //!< SV Frequency Channel Number
|
||||
i_satellite_PRN = 0; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
i_satellite_slot_number = 0; //!< SV Slot Number
|
||||
d_yr = 1972; //!< Current year, defaults to 1972 (UTC Epoch with leap seconds)
|
||||
d_satClkDrift = 0.0; //!< GLONASS clock error
|
||||
d_dtr = 0.0; //!< relativistic clock correction term
|
||||
d_iode = 0.0; //!< Issue of data, ephemeris (Bit 0-6 of tb)
|
||||
d_tau_c = 0.0;
|
||||
d_TOW = 0.0; // tow of the start of frame
|
||||
d_WN = 0.0; // week number of the start of frame
|
||||
d_tod = 0.0;
|
||||
// Satellite Identification Information
|
||||
i_satellite_freq_channel = 0; //!< SV Frequency Channel Number
|
||||
i_satellite_PRN = 0; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
i_satellite_slot_number = 0; //!< SV Slot Number
|
||||
d_yr = 1972; //!< Current year, defaults to 1972 (UTC Epoch with leap seconds)
|
||||
d_satClkDrift = 0.0; //!< GLONASS clock error
|
||||
d_dtr = 0.0; //!< relativistic clock correction term
|
||||
d_iode = 0.0; //!< Issue of data, ephemeris (Bit 0-6 of tb)
|
||||
d_tau_c = 0.0;
|
||||
d_TOW = 0.0; // tow of the start of frame
|
||||
d_WN = 0.0; // week number of the start of frame
|
||||
d_tod = 0.0;
|
||||
}
|
||||
|
||||
|
||||
boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const double offset_time) const
|
||||
{
|
||||
boost::posix_time::time_duration t(0, 0, offset_time + d_tau_c + d_tau_n);
|
||||
@ -92,74 +91,75 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const doub
|
||||
return glonass_time;
|
||||
}
|
||||
|
||||
|
||||
boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset_time, const double glot2utc_corr) const
|
||||
{
|
||||
double tod = 0.0;
|
||||
double glot2utc = 3*3600;
|
||||
double tod = 0.0;
|
||||
double glot2utc = 3*3600;
|
||||
|
||||
tod = offset_time - glot2utc + glot2utc_corr + d_tau_n;
|
||||
boost::posix_time::time_duration t(0, 0, tod);
|
||||
boost::gregorian::date d1(d_yr, 1, 1);
|
||||
boost::gregorian::days d2(d_N_T - 1);
|
||||
boost::posix_time::ptime utc_time(d1+d2, t);
|
||||
tod = offset_time - glot2utc + glot2utc_corr + d_tau_n;
|
||||
boost::posix_time::time_duration t(0, 0, tod);
|
||||
boost::gregorian::date d1(d_yr, 1, 1);
|
||||
boost::gregorian::days d2(d_N_T - 1);
|
||||
boost::posix_time::ptime utc_time(d1 + d2, t);
|
||||
|
||||
return utc_time;
|
||||
return utc_time;
|
||||
}
|
||||
|
||||
|
||||
void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * wn, double * tow) const
|
||||
{
|
||||
double tod = 0.0;
|
||||
double glot2utc = 3*3600;
|
||||
double days = 0.0;
|
||||
double total_sec = 0.0, sec_of_day = 0.0;
|
||||
int i = 0;
|
||||
double tod = 0.0;
|
||||
double glot2utc = 3*3600;
|
||||
double days = 0.0;
|
||||
double total_sec = 0.0, sec_of_day = 0.0;
|
||||
int i = 0;
|
||||
|
||||
boost::gregorian::date gps_epoch { 1980, 1, 6 };
|
||||
boost::gregorian::date gps_epoch { 1980, 1, 6 };
|
||||
|
||||
// tk is relative to UTC(SU) + 3.00 hrs, so we need to convert to utc and add corrections
|
||||
// tk plus 10 sec is the true tod since get_TOW is called when in str5
|
||||
tod = tod_offset - glot2utc ;
|
||||
// tk is relative to UTC(SU) + 3.00 hrs, so we need to convert to utc and add corrections
|
||||
// tk plus 10 sec is the true tod since get_TOW is called when in str5
|
||||
tod = tod_offset - glot2utc ;
|
||||
|
||||
boost::posix_time::time_duration t(0, 0, tod);
|
||||
boost::gregorian::date d1(d_yr, 1, 1);
|
||||
boost::gregorian::days d2(d_N_T-1);
|
||||
boost::posix_time::ptime utc_time(d1+d2, t);
|
||||
boost::gregorian::date utc_date = utc_time.date();
|
||||
boost::posix_time::ptime gps_time;
|
||||
|
||||
boost::posix_time::time_duration t(0, 0, tod);
|
||||
boost::gregorian::date d1(d_yr, 1, 1);
|
||||
boost::gregorian::days d2(d_N_T-1);
|
||||
boost::posix_time::ptime utc_time(d1+d2, t);
|
||||
boost::gregorian::date utc_date = utc_time.date();
|
||||
boost::posix_time::ptime gps_time;
|
||||
// Adjust for leap second correction
|
||||
for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++)
|
||||
{
|
||||
boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]);
|
||||
boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]);
|
||||
boost::posix_time::ptime ls_time(d3, t3);
|
||||
if (utc_time >= ls_time)
|
||||
{
|
||||
// We add the leap second when going from utc to gpst
|
||||
gps_time = utc_time + boost::posix_time::time_duration(0,0,fabs(GLONASS_LEAP_SECONDS[i][6]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust for leap second correction
|
||||
for (i = 0; GLONASS_LEAP_SECONDS[i][0]>0; i++)
|
||||
{
|
||||
boost::posix_time::time_duration t3(GLONASS_LEAP_SECONDS[i][3], GLONASS_LEAP_SECONDS[i][4], GLONASS_LEAP_SECONDS[i][5]);
|
||||
boost::gregorian::date d3(GLONASS_LEAP_SECONDS[i][0], GLONASS_LEAP_SECONDS[i][1], GLONASS_LEAP_SECONDS[i][2]);
|
||||
boost::posix_time::ptime ls_time(d3, t3);
|
||||
if (utc_time >= ls_time)
|
||||
{
|
||||
// We add the leap second when going from utc to gpst
|
||||
gps_time = utc_time + boost::posix_time::time_duration(0,0,fabs(GLONASS_LEAP_SECONDS[i][6]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Total number of days
|
||||
std::string fdat = boost::posix_time::to_simple_string(gps_time);
|
||||
days = static_cast<double>((utc_date - gps_epoch).days());
|
||||
|
||||
// Total number of days
|
||||
std::string fdat = boost::posix_time::to_simple_string(gps_time);
|
||||
days = static_cast<double>((utc_date - gps_epoch).days());
|
||||
// Total number of seconds
|
||||
sec_of_day = static_cast<double>((gps_time.time_of_day()).total_seconds());
|
||||
total_sec = days*86400 + sec_of_day;
|
||||
|
||||
// Total number of seconds
|
||||
sec_of_day = static_cast<double>((gps_time.time_of_day()).total_seconds());
|
||||
total_sec = days*86400 + sec_of_day;
|
||||
|
||||
// Compute Week number
|
||||
*wn = floor(total_sec/604800);
|
||||
|
||||
// Compute the arithmetic modules to wrap around range
|
||||
*tow = total_sec - 604800*floor(total_sec/604800);
|
||||
// Perform corrections from fractional seconds
|
||||
*tow += glot2utc_corr + glot2gpst_corr;
|
||||
// Compute Week number
|
||||
*wn = floor(total_sec/604800);
|
||||
|
||||
// Compute the arithmetic modules to wrap around range
|
||||
*tow = total_sec - 604800*floor(total_sec/604800);
|
||||
// Perform corrections from fractional seconds
|
||||
*tow += glot2utc_corr + glot2gpst_corr;
|
||||
}
|
||||
|
||||
|
||||
double Glonass_Gnav_Ephemeris::check_t(double time)
|
||||
{
|
||||
double corrTime;
|
||||
@ -176,6 +176,7 @@ double Glonass_Gnav_Ephemeris::check_t(double time)
|
||||
return corrTime;
|
||||
}
|
||||
|
||||
|
||||
// FIXME Fix reference here
|
||||
// 20.3.3.3.3.1 User Algorithm for SV Clock Correction.
|
||||
double Glonass_Gnav_Ephemeris::sv_clock_drift(double transmitTime, double timeCorrUTC)
|
||||
|
@ -35,9 +35,6 @@
|
||||
#define GNSS_SDR_GLONASS_GNAV_EPHEMERIS_H_
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "boost/assign.hpp"
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
@ -64,7 +61,7 @@ public:
|
||||
double d_m; //!< String number within frame [dimensionless]
|
||||
double d_t_k; //!< GLONASS Time (UTC(SU) + 3 h) referenced to the beginning of the frame within the current day [s]
|
||||
double d_t_b; //!< Reference ephemeris relative time in GLONASS Time (UTC(SU) + 3 h). Index of a time interval within current day according to UTC(SU) + 03 hours 00 min. [s]
|
||||
double d_M; //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
double d_M; //!< Type of satellite transmitting navigation signal [dimensionless]
|
||||
double d_gamma_n; //!< Relative deviation of predicted carrier frequency value of n- satellite from nominal value at the instant tb [dimensionless]
|
||||
double d_tau_n; //!< Correction to the nth satellite time (tn) relative to GLONASS time (te),
|
||||
double d_Xn; //!< Earth-fixed coordinate x of the satellite in PZ-90.02 coordinate system [km].
|
||||
@ -84,25 +81,25 @@ public:
|
||||
double d_Delta_tau_n; //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
double d_E_n; //!< Characterises "age" of a current information [days]
|
||||
double d_P_1; //!< Flag of the immediate data updating [minutes]
|
||||
bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
bool d_P_2; //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
bool d_P_3; //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
bool d_P_4; //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
bool d_l3rd_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
bool d_l5th_n; //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is healthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
|
||||
// Inmediate deliverables of ephemeris information
|
||||
// Satellite Identification Information
|
||||
int i_satellite_freq_channel; //!< SV Frequency Channel Number
|
||||
int i_satellite_freq_channel; //!< SV Frequency Channel Number
|
||||
unsigned int i_satellite_PRN; //!< SV PRN Number, equivalent to slot number for compatibility with GPS
|
||||
unsigned int i_satellite_slot_number; //!< SV Slot Number
|
||||
double d_yr; //!< Current year
|
||||
double d_satClkDrift; //!< GLONASS clock error
|
||||
double d_dtr; //!< relativistic clock correction term
|
||||
double d_iode; //!< Issue of data, ephemeris (Bit 0-6 of tb)
|
||||
double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated
|
||||
double d_TOW; //!< GLONASST IN GPST seconds of week
|
||||
double d_WN; //!< GLONASST IN GPST week number of the start of frame
|
||||
double d_tod; //!< Time of Day since ephemeris where decoded
|
||||
double d_tau_c; //!< GLONASST 2 UTC correction (todo) may be eliminated
|
||||
double d_TOW; //!< GLONASST IN GPST seconds of week
|
||||
double d_WN; //!< GLONASST IN GPST week number of the start of frame
|
||||
double d_tod; //!< Time of Day since ephemeris where decoded
|
||||
|
||||
template<class Archive>
|
||||
|
||||
@ -137,14 +134,14 @@ public:
|
||||
archive & make_nvp("d_N_T", d_N_T); //!< Current date, calendar number of day within four-year interval starting from the 1-st of January in a leap year [days]
|
||||
archive & make_nvp("d_F_T", d_F_T); //!< Parameter that provides the predicted satellite user range accuracy at time tb [dimensionless]
|
||||
archive & make_nvp("d_n", d_n); //!< Index of the satellite transmitting given navigation signal. It corresponds to a slot number within GLONASS constellation
|
||||
archive & make_nvp("d_Delta_tau_n", d_Delta_tau_n);//!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
archive & make_nvp("d_Delta_tau_n", d_Delta_tau_n); //!< Time difference between navigation RF signal transmitted in L2 sub- band and aviation RF signal transmitted in L1 sub-band by nth satellite. [dimensionless]
|
||||
archive & make_nvp("d_E_n", d_E_n); //!< Characterises "age" of a current information [days]
|
||||
archive & make_nvp("d_P_1", d_P_1); //!< Flag of the immediate data updating.
|
||||
archive & make_nvp("d_P_2", d_P_2); //!< Flag of oddness ("1") or evenness ("0") of the value of (tb) [dimensionless]
|
||||
archive & make_nvp("d_P_3", d_P_3); //!< Flag indicating a number of satellites for which almanac is transmitted within given frame: "1" corresponds to 5 satellites and "0" corresponds to 4 satellites [dimensionless]
|
||||
archive & make_nvp("d_P_4", d_P_4); //!< Flag to show that ephemeris parameters are present. "1" indicates that updated ephemeris or frequency/time parameters have been uploaded by the control segment [dimensionless]
|
||||
archive & make_nvp("d_l3rd_n", d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive & make_nvp("d_l5th_n", d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive & make_nvp("d_l3rd_n", d_l3rd_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
archive & make_nvp("d_l5th_n", d_l5th_n); //!< Health flag for nth satellite; ln = 0 indicates the n-th satellite is helthy, ln = 1 indicates malfunction of this nth satellite [dimensionless]
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user