mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 05:03:01 +00:00
Fix tests
This commit is contained in:
parent
06dbe4cf4e
commit
5a86de623b
@ -78,7 +78,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
|||||||
extend_correlation_symbols = 1;
|
extend_correlation_symbols = 1;
|
||||||
std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: Galileo E1. Extended coherent integration is not allowed when tracking the data component. Coherent integration has been set to 4 ms (1 symbol)" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
if (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)
|
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
|
||||||
{
|
{
|
||||||
std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: Galileo E1. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking(
|
|||||||
extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH;
|
||||||
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
if (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)
|
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
|
||||||
{
|
{
|
||||||
std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: Galileo E5a. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
|
|||||||
{
|
{
|
||||||
std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: GPS L1 C/A does not have pilot signal. Data tracking has been enabled" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
if (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)
|
if ((symbols_extended_correlator > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
|
||||||
{
|
{
|
||||||
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: GPS L1 C/A. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ GpsL5iDllPllTracking::GpsL5iDllPllTracking(
|
|||||||
extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH;
|
extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH;
|
||||||
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
if (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)
|
if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz))
|
||||||
{
|
{
|
||||||
std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
std::cout << TEXT_RED << "WARNING: GPS L5. PLL or DLL narrow tracking bandwidth is higher than wide tracking one" << TEXT_RESET << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,6 @@ private:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Rtcm_Session(boost::asio::ip::tcp::socket socket, Rtcm_Listener_Room& room) : socket_(std::move(socket)), room_(room) {}
|
Rtcm_Session(boost::asio::ip::tcp::socket socket, Rtcm_Listener_Room& room) : socket_(std::move(socket)), room_(room) {}
|
||||||
|
|
||||||
inline void start()
|
inline void start()
|
||||||
{
|
{
|
||||||
room_.join(shared_from_this());
|
room_.join(shared_from_this());
|
||||||
@ -665,12 +664,13 @@ private:
|
|||||||
boost::asio::async_read(socket_,
|
boost::asio::async_read(socket_,
|
||||||
boost::asio::buffer(read_msg_.data(), Rtcm_Message::header_length),
|
boost::asio::buffer(read_msg_.data(), Rtcm_Message::header_length),
|
||||||
[this, self](boost::system::error_code ec, std::size_t /*length*/) {
|
[this, self](boost::system::error_code ec, std::size_t /*length*/) {
|
||||||
if (!ec && read_msg_.decode_header())
|
if (!ec and read_msg_.decode_header())
|
||||||
{
|
{
|
||||||
do_read_message_body();
|
do_read_message_body();
|
||||||
}
|
}
|
||||||
else if (!ec && !read_msg_.decode_header())
|
else if (!ec and !read_msg_.decode_header())
|
||||||
{
|
{
|
||||||
|
/* TODO: The commented code throws an exception. Solve it!
|
||||||
client_says += read_msg_.data();
|
client_says += read_msg_.data();
|
||||||
bool first = true;
|
bool first = true;
|
||||||
while (client_says.length() >= 80)
|
while (client_says.length() >= 80)
|
||||||
@ -683,6 +683,7 @@ private:
|
|||||||
std::cout << client_says.substr(0, 80) << std::endl;
|
std::cout << client_says.substr(0, 80) << std::endl;
|
||||||
client_says = client_says.substr(80, client_says.length() - 80);
|
client_says = client_says.substr(80, client_says.length() - 80);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
do_read_message_header();
|
do_read_message_header();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -719,8 +720,7 @@ private:
|
|||||||
{
|
{
|
||||||
auto self(shared_from_this());
|
auto self(shared_from_this());
|
||||||
boost::asio::async_write(socket_,
|
boost::asio::async_write(socket_,
|
||||||
boost::asio::buffer(write_msgs_.front().body(),
|
boost::asio::buffer(write_msgs_.front().body(), write_msgs_.front().body_length()),
|
||||||
write_msgs_.front().body_length()),
|
|
||||||
[this, self](boost::system::error_code ec, std::size_t /*length*/) {
|
[this, self](boost::system::error_code ec, std::size_t /*length*/) {
|
||||||
if (!ec)
|
if (!ec)
|
||||||
{
|
{
|
||||||
|
@ -281,12 +281,12 @@ void HybridObservablesTest::configure_receiver()
|
|||||||
|
|
||||||
// Set Tracking
|
// Set Tracking
|
||||||
config->set_property("Tracking_1C.item_type", "gr_complex");
|
config->set_property("Tracking_1C.item_type", "gr_complex");
|
||||||
config->set_property("Tracking_1C.if", "0");
|
|
||||||
config->set_property("Tracking_1C.dump", "true");
|
config->set_property("Tracking_1C.dump", "true");
|
||||||
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
||||||
config->set_property("Tracking_1C.pll_bw_hz", "35.0");
|
config->set_property("Tracking_1C.pll_bw_hz", "35.0");
|
||||||
config->set_property("Tracking_1C.dll_bw_hz", "0.5");
|
config->set_property("Tracking_1C.dll_bw_hz", "0.5");
|
||||||
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
||||||
|
config->set_property("Tracking_1C.unified", "true");
|
||||||
|
|
||||||
config->set_property("TelemetryDecoder_1C.dump", "true");
|
config->set_property("TelemetryDecoder_1C.dump", "true");
|
||||||
config->set_property("Observables.dump", "true");
|
config->set_property("Observables.dump", "true");
|
||||||
@ -543,7 +543,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx> tlm_msg_rx_ch2 = HybridObservablesTest_tlm_msg_rx_make();
|
boost::shared_ptr<HybridObservablesTest_tlm_msg_rx> tlm_msg_rx_ch2 = HybridObservablesTest_tlm_msg_rx_make();
|
||||||
|
|
||||||
//Observables
|
//Observables
|
||||||
std::shared_ptr<ObservablesInterface> observables(new HybridObservables(config.get(), "Observables",3, 2));
|
std::shared_ptr<ObservablesInterface> observables(new HybridObservables(config.get(), "Observables", 3, 2));
|
||||||
|
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
tracking_ch0->set_channel(gnss_synchro_ch0.Channel_ID);
|
tracking_ch0->set_channel(gnss_synchro_ch0.Channel_ID);
|
||||||
@ -604,7 +604,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
true_observables_reader true_observables;
|
true_observables_reader true_observables;
|
||||||
|
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
if(true_observables.open_obs_file(std::string("./obs_out.bin")) == false)
|
if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false)
|
||||||
{
|
{
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
}
|
}
|
||||||
@ -620,14 +620,14 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
true_observables.restart();
|
true_observables.restart();
|
||||||
long int epoch_counter = 0;
|
long int epoch_counter = 0;
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
while(true_observables.read_binary_obs())
|
while (true_observables.read_binary_obs())
|
||||||
{
|
{
|
||||||
if(round(true_observables.prn[0]) != gnss_synchro_ch0.PRN)
|
if (round(true_observables.prn[0]) != gnss_synchro_ch0.PRN)
|
||||||
{
|
{
|
||||||
std::cout << "True observables SV PRN does not match " << round(true_observables.prn[1]) << std::endl;
|
std::cout << "True observables SV PRN does not match " << round(true_observables.prn[1]) << std::endl;
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
}
|
}
|
||||||
if(round(true_observables.prn[1]) != gnss_synchro_ch1.PRN)
|
if (round(true_observables.prn[1]) != gnss_synchro_ch1.PRN)
|
||||||
{
|
{
|
||||||
std::cout << "True observables SV PRN does not match " << round(true_observables.prn[1]) << std::endl;
|
std::cout << "True observables SV PRN does not match " << round(true_observables.prn[1]) << std::endl;
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
@ -649,7 +649,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
//read measured values
|
//read measured values
|
||||||
observables_dump_reader estimated_observables(2); //two channels
|
observables_dump_reader estimated_observables(2); //two channels
|
||||||
ASSERT_NO_THROW({
|
ASSERT_NO_THROW({
|
||||||
if(estimated_observables.open_obs_file(std::string("./observables.dat")) == false)
|
if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false)
|
||||||
{
|
{
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
}
|
}
|
||||||
@ -665,9 +665,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
estimated_observables.restart();
|
estimated_observables.restart();
|
||||||
epoch_counter = 0;
|
epoch_counter = 0;
|
||||||
long int epoch_counter2 = 0;
|
long int epoch_counter2 = 0;
|
||||||
while(estimated_observables.read_binary_obs())
|
while (estimated_observables.read_binary_obs())
|
||||||
{
|
{
|
||||||
if(static_cast<bool>(estimated_observables.valid[0]))
|
if (static_cast<bool>(estimated_observables.valid[0]))
|
||||||
{
|
{
|
||||||
measured_ch0(epoch_counter, 0) = estimated_observables.RX_time[0];
|
measured_ch0(epoch_counter, 0) = estimated_observables.RX_time[0];
|
||||||
measured_ch0(epoch_counter, 1) = estimated_observables.TOW_at_current_symbol_s[0];
|
measured_ch0(epoch_counter, 1) = estimated_observables.TOW_at_current_symbol_s[0];
|
||||||
@ -676,7 +676,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
measured_ch0(epoch_counter, 4) = estimated_observables.Pseudorange_m[0];
|
measured_ch0(epoch_counter, 4) = estimated_observables.Pseudorange_m[0];
|
||||||
epoch_counter++;
|
epoch_counter++;
|
||||||
}
|
}
|
||||||
if(static_cast<bool>(estimated_observables.valid[1]))
|
if (static_cast<bool>(estimated_observables.valid[1]))
|
||||||
{
|
{
|
||||||
measured_ch1(epoch_counter2, 0) = estimated_observables.RX_time[1];
|
measured_ch1(epoch_counter2, 0) = estimated_observables.RX_time[1];
|
||||||
measured_ch1(epoch_counter2, 1) = estimated_observables.TOW_at_current_symbol_s[1];
|
measured_ch1(epoch_counter2, 1) = estimated_observables.TOW_at_current_symbol_s[1];
|
||||||
@ -689,19 +689,27 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
|
|
||||||
//Cut measurement tail zeros
|
//Cut measurement tail zeros
|
||||||
arma::uvec index = arma::find(measured_ch0.col(0) > 0.0, 1, "last");
|
arma::uvec index = arma::find(measured_ch0.col(0) > 0.0, 1, "last");
|
||||||
if((index.size() > 0) and index(0) < (nepoch - 1))
|
if ((index.size() > 0) and index(0) < (nepoch - 1))
|
||||||
{ measured_ch0.shed_rows(index(0) + 1, nepoch - 1); }
|
{
|
||||||
|
measured_ch0.shed_rows(index(0) + 1, nepoch - 1);
|
||||||
|
}
|
||||||
index = arma::find(measured_ch1.col(0) > 0.0, 1, "last");
|
index = arma::find(measured_ch1.col(0) > 0.0, 1, "last");
|
||||||
if((index.size() > 0) and index(0) < (nepoch - 1))
|
if ((index.size() > 0) and index(0) < (nepoch - 1))
|
||||||
{ measured_ch1.shed_rows(index(0) + 1, nepoch - 1); }
|
{
|
||||||
|
measured_ch1.shed_rows(index(0) + 1, nepoch - 1);
|
||||||
|
}
|
||||||
|
|
||||||
//Cut measurement initial transitory of the measurements
|
//Cut measurement initial transitory of the measurements
|
||||||
index = arma::find(measured_ch0.col(0) >= true_ch0(0, 0), 1, "first");
|
index = arma::find(measured_ch0.col(0) >= true_ch0(0, 0), 1, "first");
|
||||||
if((index.size() > 0) and (index(0) > 0))
|
if ((index.size() > 0) and (index(0) > 0))
|
||||||
{ measured_ch0.shed_rows(0, index(0)); }
|
{
|
||||||
|
measured_ch0.shed_rows(0, index(0));
|
||||||
|
}
|
||||||
index = arma::find(measured_ch1.col(0) >= true_ch1(0, 0), 1, "first");
|
index = arma::find(measured_ch1.col(0) >= true_ch1(0, 0), 1, "first");
|
||||||
if((index.size() > 0) and (index(0) > 0))
|
if ((index.size() > 0) and (index(0) > 0))
|
||||||
{ measured_ch1.shed_rows(0, index(0)); }
|
{
|
||||||
|
measured_ch1.shed_rows(0, index(0));
|
||||||
|
}
|
||||||
|
|
||||||
//Correct the clock error using true values (it is not possible for a receiver to correct
|
//Correct the clock error using true values (it is not possible for a receiver to correct
|
||||||
//the receiver clock offset error at the observables level because it is required the
|
//the receiver clock offset error at the observables level because it is required the
|
||||||
@ -709,7 +717,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults)
|
|||||||
|
|
||||||
//Find the reference satellite (the nearest) and compute the receiver time offset at observable level
|
//Find the reference satellite (the nearest) and compute the receiver time offset at observable level
|
||||||
arma::vec receiver_time_offset_s;
|
arma::vec receiver_time_offset_s;
|
||||||
if(measured_ch0(0, 4) < measured_ch1(0, 4))
|
if (measured_ch0(0, 4) < measured_ch1(0, 4))
|
||||||
{
|
{
|
||||||
receiver_time_offset_s = true_ch0.col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0;
|
receiver_time_offset_s = true_ch0.col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0;
|
||||||
}
|
}
|
||||||
|
@ -265,13 +265,12 @@ void GpsL1CATelemetryDecoderTest::configure_receiver()
|
|||||||
|
|
||||||
// Set Tracking
|
// Set Tracking
|
||||||
config->set_property("Tracking_1C.item_type", "gr_complex");
|
config->set_property("Tracking_1C.item_type", "gr_complex");
|
||||||
config->set_property("Tracking_1C.if", "0");
|
|
||||||
config->set_property("Tracking_1C.dump", "true");
|
config->set_property("Tracking_1C.dump", "true");
|
||||||
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
||||||
config->set_property("Tracking_1C.pll_bw_hz", "20.0");
|
config->set_property("Tracking_1C.pll_bw_hz", "20.0");
|
||||||
config->set_property("Tracking_1C.dll_bw_hz", "1.5");
|
config->set_property("Tracking_1C.dll_bw_hz", "1.5");
|
||||||
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
||||||
|
config->set_property("Tracking_1C.unified", "true");
|
||||||
config->set_property("TelemetryDecoder_1C.dump", "true");
|
config->set_property("TelemetryDecoder_1C.dump", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,11 +225,7 @@ void GpsL1CADllPllTrackingTest::configure_receiver()
|
|||||||
config->set_property("Tracking_1C.pll_bw_hz", "20.0");
|
config->set_property("Tracking_1C.pll_bw_hz", "20.0");
|
||||||
config->set_property("Tracking_1C.dll_bw_hz", "2.0");
|
config->set_property("Tracking_1C.dll_bw_hz", "2.0");
|
||||||
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
config->set_property("Tracking_1C.early_late_space_chips", "0.5");
|
||||||
config->set_property("Tracking_1C.pll_bw_narrow_hz", "20.0");
|
|
||||||
config->set_property("Tracking_1C.dll_bw_narrow_hz", "2.0");
|
|
||||||
config->set_property("Tracking_1C.early_late_space_narrow_chips", "0.5");
|
|
||||||
config->set_property("Tracking_1C.unified", "true");
|
config->set_property("Tracking_1C.unified", "true");
|
||||||
config->set_property("Tracking_1C.extend_correlation_ms", "1");
|
|
||||||
config->set_property("Tracking_1C.dump", "true");
|
config->set_property("Tracking_1C.dump", "true");
|
||||||
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
config->set_property("Tracking_1C.dump_filename", "./tracking_ch_");
|
||||||
}
|
}
|
||||||
@ -395,7 +391,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults)
|
|||||||
true_obs_data.restart();
|
true_obs_data.restart();
|
||||||
|
|
||||||
std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl;
|
std::cout << "Initial Doppler [Hz]=" << true_obs_data.doppler_l1_hz << " Initial code delay [Chips]=" << true_obs_data.prn_delay_chips << std::endl;
|
||||||
gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD;
|
gnss_synchro.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_obs_data.prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * static_cast<double>(baseband_sampling_freq) * GPS_L1_CA_CODE_PERIOD;
|
||||||
gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz;
|
gnss_synchro.Acq_doppler_hz = true_obs_data.doppler_l1_hz;
|
||||||
gnss_synchro.Acq_samplestamp_samples = 0;
|
gnss_synchro.Acq_samplestamp_samples = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user