mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next
This commit is contained in:
commit
2c865759d9
@ -261,23 +261,20 @@ $ sudo ldconfig
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### Build the [Google C++ Testing Framework](https://github.com/google/googletest "Googletest Homepage"), also known as Google Test:
|
#### Download the [Google C++ Testing Framework](https://github.com/google/googletest "Googletest Homepage"), also known as Google Test:
|
||||||
|
|
||||||
~~~~~~
|
~~~~~~
|
||||||
$ wget https://github.com/google/googletest/archive/v1.10.x.zip
|
$ wget https://github.com/google/googletest/archive/v1.10.x.zip
|
||||||
$ unzip v1.10.x.zip
|
$ unzip v1.10.x.zip
|
||||||
$ cd googletest-1.10.x
|
|
||||||
$ cmake -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF .
|
|
||||||
$ make
|
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
Please **DO NOT install** Google Test (do *not* type `sudo make install`). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of `#if` in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of googletest to its own tests; it is only required that you tell the system where the googletest folder that you downloaded resides. Just add to your `$HOME/.bashrc` file the following line:
|
Please **DO NOT build or install** Google Test. Every user needs to compile tests using the same compiler flags used to compile the Google Test libraries; otherwise he or she may run into undefined behaviors (_i.e._, the tests can behave strangely and may even crash for no obvious reasons). The explanation is that C++ has the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (_e.g._, due to the use of `#if` in Google Test). Therefore, for your sanity, GNSS-SDR does not make use of pre-compiled Google Test libraries. Instead, it compiles Google Test's source code itself, such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR manages the compilation and linking of Google Test's source code to its own tests; it is only required that you tell the system where the Google Test folder that you downloaded resides. Just type in your terminal (or add it to your `$HOME/.bashrc` file for a permanent solution) the following line:
|
||||||
|
|
||||||
~~~~~~
|
~~~~~~
|
||||||
export GTEST_DIR=/home/username/googletest-1.10.x
|
export GTEST_DIR=/home/username/googletest-1.10.x
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
changing `/home/username/googletest-1.10.x` by the actual directory where you unpacked googletest.
|
changing `/home/username/googletest-1.10.x` by the actual path where you unpacked Google Test. If the CMake script does not find that folder, or the environment variable is not defined, or the source code is not installed by a package, then it will download a fresh copy of the Google Test source code and will compile and link it for you.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -342,6 +342,34 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface *configura
|
|||||||
}
|
}
|
||||||
if (switch_position == 2) // Real-time via AD9361
|
if (switch_position == 2) // Real-time via AD9361
|
||||||
{
|
{
|
||||||
|
// some basic checks
|
||||||
|
if ((rf_port_select_ != "A_BALANCED") and (rf_port_select_ != "B_BALANCED") and (rf_port_select_ != "A_N") and (rf_port_select_ != "B_N") and (rf_port_select_ != "B_P") and (rf_port_select_ != "C_N") and (rf_port_select_ != "C_P") and (rf_port_select_ != "TX_MONITOR1") and (rf_port_select_ != "TX_MONITOR2") and (rf_port_select_ != "TX_MONITOR1_2"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter rf_port_select should take one of these values:" << std::endl;
|
||||||
|
std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2" << std::endl;
|
||||||
|
std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value rf_port_select=A_BALANCED" << std::endl;
|
||||||
|
rf_port_select_ = std::string("A_BALANCED");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gain_mode_rx1_ != "manual") and (gain_mode_rx1_ != "slow_attack") and (gain_mode_rx1_ != "fast_attack") and (gain_mode_rx1_ != "hybrid"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:" << std::endl;
|
||||||
|
std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl;
|
||||||
|
std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value gain_mode_rx1=manual" << std::endl;
|
||||||
|
gain_mode_rx1_ = std::string("manual");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gain_mode_rx2_ != "manual") and (gain_mode_rx2_ != "slow_attack") and (gain_mode_rx2_ != "fast_attack") and (gain_mode_rx2_ != "hybrid"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:" << std::endl;
|
||||||
|
std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl;
|
||||||
|
std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value gain_mode_rx2=manual" << std::endl;
|
||||||
|
gain_mode_rx2_ = std::string("manual");
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "LO frequency : " << freq_ << " Hz" << std::endl;
|
std::cout << "LO frequency : " << freq_ << " Hz" << std::endl;
|
||||||
config_ad9361_rx_local(bandwidth_,
|
config_ad9361_rx_local(bandwidth_,
|
||||||
sample_rate_,
|
sample_rate_,
|
||||||
@ -350,7 +378,10 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface *configura
|
|||||||
gain_mode_rx1_,
|
gain_mode_rx1_,
|
||||||
gain_mode_rx2_,
|
gain_mode_rx2_,
|
||||||
rf_gain_rx1_,
|
rf_gain_rx1_,
|
||||||
rf_gain_rx2_);
|
rf_gain_rx2_,
|
||||||
|
quadrature_,
|
||||||
|
rf_dc_,
|
||||||
|
bb_dc_);
|
||||||
|
|
||||||
// LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION
|
// LOCAL OSCILLATOR DDS GENERATOR FOR DUAL FREQUENCY OPERATION
|
||||||
if (enable_dds_lo_ == true)
|
if (enable_dds_lo_ == true)
|
||||||
|
@ -84,6 +84,46 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
|||||||
|
|
||||||
item_size_ = sizeof(gr_complex);
|
item_size_ = sizeof(gr_complex);
|
||||||
|
|
||||||
|
// some basic checks
|
||||||
|
if ((rf_port_select_ != "A_BALANCED") and (rf_port_select_ != "B_BALANCED") and (rf_port_select_ != "A_N") and (rf_port_select_ != "B_N") and (rf_port_select_ != "B_P") and (rf_port_select_ != "C_N") and (rf_port_select_ != "C_P") and (rf_port_select_ != "TX_MONITOR1") and (rf_port_select_ != "TX_MONITOR2") and (rf_port_select_ != "TX_MONITOR1_2"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter rf_port_select should take one of these values:" << std::endl;
|
||||||
|
std::cout << " A_BALANCED, B_BALANCED, A_N, B_N, B_P, C_N, C_P, TX_MONITOR1, TX_MONITOR2, TX_MONITOR1_2" << std::endl;
|
||||||
|
std::cout << "Error: provided value rf_port_select=" << rf_port_select_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value rf_port_select=A_BALANCED" << std::endl;
|
||||||
|
rf_port_select_ = std::string("A_BALANCED");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gain_mode_rx1_ != "manual") and (gain_mode_rx1_ != "slow_attack") and (gain_mode_rx1_ != "fast_attack") and (gain_mode_rx1_ != "hybrid"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:" << std::endl;
|
||||||
|
std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl;
|
||||||
|
std::cout << "Error: provided value gain_mode_rx1=" << gain_mode_rx1_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value gain_mode_rx1=manual" << std::endl;
|
||||||
|
gain_mode_rx1_ = std::string("manual");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gain_mode_rx2_ != "manual") and (gain_mode_rx2_ != "slow_attack") and (gain_mode_rx2_ != "fast_attack") and (gain_mode_rx2_ != "hybrid"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter gain_mode_rx2 should take one of these values:" << std::endl;
|
||||||
|
std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl;
|
||||||
|
std::cout << "Error: provided value gain_mode_rx2=" << gain_mode_rx2_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value gain_mode_rx2=manual" << std::endl;
|
||||||
|
gain_mode_rx2_ = std::string("manual");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((filter_source_ != "Off") and (filter_source_ != "Auto") and (filter_source_ != "File") and (filter_source_ != "Design"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter filter_source should take one of these values:" << std::endl;
|
||||||
|
std::cout << " Off: Disable filter" << std::endl;
|
||||||
|
std::cout << " Auto: Use auto-generated filters" << std::endl;
|
||||||
|
std::cout << " File: User-provided filter in filter_filename parameter" << std::endl;
|
||||||
|
std::cout << " Design: Create filter from Fpass, Fstop, sampling_frequency and bandwidth parameters" << std::endl;
|
||||||
|
std::cout << "Error: provided value filter_source=" << filter_source_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value filter_source=Off" << std::endl;
|
||||||
|
filter_source_ = std::string("Off");
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << "device address: " << uri_ << std::endl;
|
std::cout << "device address: " << uri_ << std::endl;
|
||||||
std::cout << "LO frequency : " << freq_ << " Hz" << std::endl;
|
std::cout << "LO frequency : " << freq_ << " Hz" << std::endl;
|
||||||
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
|
std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl;
|
||||||
|
@ -70,6 +70,16 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
|||||||
LOG(FATAL) << "Configuration error: item_type must be gr_complex!";
|
LOG(FATAL) << "Configuration error: item_type must be gr_complex!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// basic check
|
||||||
|
if ((gain_mode_ != "manual") and (gain_mode_ != "slow_attack") and (gain_mode_ != "fast_attack") and (gain_mode_ != "hybrid"))
|
||||||
|
{
|
||||||
|
std::cout << "Configuration parameter gain_mode_rx1 should take one of these values:" << std::endl;
|
||||||
|
std::cout << " manual, slow_attack, fast_attack, hybrid" << std::endl;
|
||||||
|
std::cout << "Error: provided value gain_mode=" << gain_mode_ << " is not among valid values" << std::endl;
|
||||||
|
std::cout << " This parameter has been set to its default value gain_mode=manual" << std::endl;
|
||||||
|
gain_mode_ = std::string("manual");
|
||||||
|
}
|
||||||
|
|
||||||
item_size_ = sizeof(gr_complex);
|
item_size_ = sizeof(gr_complex);
|
||||||
|
|
||||||
std::cout << "device address: " << uri_ << std::endl;
|
std::cout << "device address: " << uri_ << std::endl;
|
||||||
|
@ -183,7 +183,10 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
const std::string &gain_mode_rx1_,
|
const std::string &gain_mode_rx1_,
|
||||||
const std::string &gain_mode_rx2_,
|
const std::string &gain_mode_rx2_,
|
||||||
double rf_gain_rx1_,
|
double rf_gain_rx1_,
|
||||||
double rf_gain_rx2_)
|
double rf_gain_rx2_,
|
||||||
|
bool quadrature_,
|
||||||
|
bool rfdc_,
|
||||||
|
bool bbdc_)
|
||||||
|
|
||||||
{
|
{
|
||||||
// RX stream config
|
// RX stream config
|
||||||
@ -264,6 +267,21 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
{
|
{
|
||||||
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
||||||
}
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_quadrature_tracking_en", quadrature_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_quadrature_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_rf_dc_offset_tracking_en", rfdc_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_rf_dc_offset_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_bb_dc_offset_tracking_en", bbdc_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_bb_dc_offset_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -299,7 +317,10 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
const std::string &gain_mode_rx1_,
|
const std::string &gain_mode_rx1_,
|
||||||
const std::string &gain_mode_rx2_,
|
const std::string &gain_mode_rx2_,
|
||||||
double rf_gain_rx1_,
|
double rf_gain_rx1_,
|
||||||
double rf_gain_rx2_)
|
double rf_gain_rx2_,
|
||||||
|
bool quadrature_,
|
||||||
|
bool rfdc_,
|
||||||
|
bool bbdc_)
|
||||||
{
|
{
|
||||||
// RX stream config
|
// RX stream config
|
||||||
// Stream configurations
|
// Stream configurations
|
||||||
@ -379,6 +400,21 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
{
|
{
|
||||||
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
||||||
}
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_quadrature_tracking_en", quadrature_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_quadrature_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_rf_dc_offset_tracking_en", rfdc_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_rf_dc_offset_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
|
ret = iio_device_attr_write_bool(ad9361_phy, "in_voltage_bb_dc_offset_tracking_en", bbdc_);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to set in_voltage_bb_dc_offset_tracking_en: " << ret << std::endl;
|
||||||
|
}
|
||||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,10 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
|||||||
const std::string &gain_mode_rx1_,
|
const std::string &gain_mode_rx1_,
|
||||||
const std::string &gain_mode_rx2_,
|
const std::string &gain_mode_rx2_,
|
||||||
double rf_gain_rx1_,
|
double rf_gain_rx1_,
|
||||||
double rf_gain_rx2_);
|
double rf_gain_rx2_,
|
||||||
|
bool quadrature_,
|
||||||
|
bool rfdc_,
|
||||||
|
bool bbdc_);
|
||||||
|
|
||||||
bool config_ad9361_rx_remote(const std::string &remote_host,
|
bool config_ad9361_rx_remote(const std::string &remote_host,
|
||||||
uint64_t bandwidth_,
|
uint64_t bandwidth_,
|
||||||
@ -102,7 +105,10 @@ bool config_ad9361_rx_remote(const std::string &remote_host,
|
|||||||
const std::string &gain_mode_rx1_,
|
const std::string &gain_mode_rx1_,
|
||||||
const std::string &gain_mode_rx2_,
|
const std::string &gain_mode_rx2_,
|
||||||
double rf_gain_rx1_,
|
double rf_gain_rx1_,
|
||||||
double rf_gain_rx2_);
|
double rf_gain_rx2_,
|
||||||
|
bool quadrature_,
|
||||||
|
bool rfdc_,
|
||||||
|
bool bbdc_);
|
||||||
|
|
||||||
bool config_ad9361_lo_local(uint64_t bandwidth_,
|
bool config_ad9361_lo_local(uint64_t bandwidth_,
|
||||||
uint64_t sample_rate_,
|
uint64_t sample_rate_,
|
||||||
|
@ -1016,7 +1016,6 @@ asn_dec_rval_t SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
if (nelems < 0)
|
if (nelems < 0)
|
||||||
{
|
{
|
||||||
nelems = uper_get_length(pd, ct ? ct->effective_bits : -1,
|
nelems = uper_get_length(pd, ct ? ct->effective_bits : -1,
|
||||||
|
@ -1016,7 +1016,6 @@ asn_dec_rval_t SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx,
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
if (nelems < 0)
|
if (nelems < 0)
|
||||||
{
|
{
|
||||||
nelems = uper_get_length(pd, ct ? ct->effective_bits : -1,
|
nelems = uper_get_length(pd, ct ? ct->effective_bits : -1,
|
||||||
|
Loading…
Reference in New Issue
Block a user