From 1bef2bbfb51d140f3b72158598fa345d3e6c824c Mon Sep 17 00:00:00 2001 From: osqzss Date: Mon, 5 Feb 2018 15:52:22 +0900 Subject: [PATCH] Add LimeSDR antenna selection support --- conf/gnss-sdr_GPS_L1_LimeSDR.conf | 124 ++++++++++++++++++ .../adapters/osmosdr_signal_source.cc | 9 ++ .../adapters/osmosdr_signal_source.h | 2 + 3 files changed, 135 insertions(+) create mode 100644 conf/gnss-sdr_GPS_L1_LimeSDR.conf diff --git a/conf/gnss-sdr_GPS_L1_LimeSDR.conf b/conf/gnss-sdr_GPS_L1_LimeSDR.conf new file mode 100644 index 000000000..8155ca0a1 --- /dev/null +++ b/conf/gnss-sdr_GPS_L1_LimeSDR.conf @@ -0,0 +1,124 @@ +[GNSS-SDR] + +;######### GLOBAL OPTIONS ################## +GNSS-SDR.internal_fs_hz=2000000 + +;######### SIGNAL_SOURCE CONFIG ############ +SignalSource.implementation=Osmosdr_Signal_Source +SignalSource.item_type=gr_complex +SignalSource.sampling_frequency=2000000 +;# LimeSDR RX1 antennas: NONE,LNAH,LNAL,LNAW +SignalSource.antenna=LNAW +SignalSource.freq=1575420000 +SignalSource.gain=40 +SignalSource.rf_gain=40 +SignalSource.if_gain=30 +SignalSource.AGC_enabled=false +SignalSource.samples=0 +SignalSource.repeat=false +;# Next line enables the LimeSDR +SignalSource.osmosdr_args=driver=lime,soapy=0 +SignalSource.enable_throttle_control=false +SignalSource.dump=false +SignalSource.dump_filename=./signal_source.dat + +;######### SIGNAL_CONDITIONER CONFIG ############ +SignalConditioner.implementation=Signal_Conditioner + +;######### DATA_TYPE_ADAPTER CONFIG ############ +DataTypeAdapter.implementation=Pass_Through + +;######### INPUT_FILTER CONFIG ############ +InputFilter.implementation=Freq_Xlating_Fir_Filter +InputFilter.decimation_factor=1 +InputFilter.input_item_type=gr_complex +InputFilter.output_item_type=gr_complex +InputFilter.taps_item_type=float +InputFilter.number_of_taps=5 +InputFilter.number_of_bands=2 +InputFilter.band1_begin=0.0 +InputFilter.band1_end=0.85 +InputFilter.band2_begin=0.9 +InputFilter.band2_end=1.0 +InputFilter.ampl1_begin=1.0 +InputFilter.ampl1_end=1.0 +InputFilter.ampl2_begin=0.0 +InputFilter.ampl2_end=0.0 +InputFilter.band1_error=1.0 +InputFilter.band2_error=1.0 +InputFilter.filter_type=bandpass +InputFilter.grid_density=16 +InputFilter.dump=false +InputFilter.dump_filename=../data/input_filter.dat + +;######### RESAMPLER CONFIG ############ +Resampler.implementation=Pass_Through + +;######### CHANNELS GLOBAL CONFIG ############ +Channels_1C.count=8 +Channels.in_acquisition=1 +Channel.signal=1C + +;######### ACQUISITION GLOBAL CONFIG ############ +Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler +Acquisition_1C.item_type=gr_complex +Acquisition_1C.if=0 +Acquisition_1C.sampled_ms=1 +Acquisition_1C.threshold=0.015 +Acquisition_1C.doppler_max=10000 +Acquisition_1C.doppler_min=-10000 +Acquisition_1C.doppler_step=500 +Acquisition_1C.max_dwells=15 +Acquisition_1C.dump=false +Acquisition_1C.dump_filename=./acq_dump.dat + +;######### TRACKING GLOBAL CONFIG ############ +Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking +Tracking_1C.item_type=gr_complex +Tracking_1C.if=0 +Tracking_1C.pll_bw_hz=40.0; +Tracking_1C.dll_bw_hz=2.0; +Tracking_1C.order=3; +Tracking_1C.early_late_space_chips=0.5; +Tracking_1C.dump=false +Tracking_1C.dump_filename=./tracking_ch_ + +;######### TELEMETRY DECODER GPS CONFIG ############ +TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder +TelemetryDecoder_1C.dump=false +TelemetryDecoder_1C.decimation_factor=1; + +;######### OBSERVABLES CONFIG ############ +Observables.implementation=GPS_L1_CA_Observables +Observables.dump=false +Observables.dump_filename=./observables.dat + +;######### PVT CONFIG ############ +PVT.implementation=GPS_L1_CA_PVT +PVT.flag_averaging=true +PVT.averaging_depth=5 +PVT.output_rate_ms=100 +PVT.display_rate_ms=500 +PVT.flag_nmea_tty_port=false; +PVT.nmea_dump_devname=/dev/pts/4 +PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea; +PVT.flag_rtcm_server=false +PVT.flag_rtcm_tty_port=false +PVT.rtcm_dump_devname=/dev/pts/1 +PVT.dump=false +PVT.dump_filename=./PVT + +;######### PVT CONFIG if using the next branch #### +;PVT.implementation=RTKLIB_PVT +;PVT.positioning_mode=Single +;PVT.output_rate_ms=100 +;PVT.display_rate_ms=500 +;PVT.iono_model=Broadcast +;PVT.trop_model=Saastamoinen +;PVT.flag_rtcm_server=true +;PVT.flag_rtcm_tty_port=false +;PVT.rtcm_dump_devname=/dev/pts/1 +;PVT.rtcm_tcp_port=2101 +;PVT.rtcm_MT1019_rate_ms=5000 +;PVT.rtcm_MT1077_rate_ms=1000 +;PVT.rinex_version=2 diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc index ea8adef3d..f052444db 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.cc @@ -66,6 +66,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6); item_type_ = configuration->property(role + ".item_type", default_item_type); osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string( )); + antenna_ = configuration->property(role + ".antenna", empty); if (item_type_.compare("short") == 0) { @@ -77,6 +78,14 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, // 1. Make the driver instance OsmosdrSignalSource::driver_instance(); + // For LimeSDR: Set RX antenna + if (!antenna_.empty()) + { + osmosdr_source_->set_antenna(antenna_, 0); + std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << std::endl ; + LOG(INFO) << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)); + } + // 2 set sampling rate osmosdr_source_->set_sample_rate(sample_rate_); std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << std::endl ; diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index e60834d01..bed05d358 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -104,6 +104,8 @@ private: osmosdr::source::sptr osmosdr_source_; std::string osmosdr_args_; + + std::string antenna_; boost::shared_ptr valve_; gr::blocks::file_sink::sptr file_sink_;