1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-26 03:54:55 +00:00
This commit is contained in:
Carles Fernandez
2018-12-03 18:03:25 +01:00
parent b5c0cc04e5
commit b994f466a7
22 changed files with 105 additions and 108 deletions

View File

@@ -433,9 +433,9 @@ int main(int argc, char** argv)
{
std::cout << " " << PRN << " ";
double doppler_measurement_hz = 0;
for (auto it = gnss_sync_vector.begin(); it != gnss_sync_vector.end(); ++it)
for (auto & it : gnss_sync_vector)
{
doppler_measurement_hz += (*it).Acq_doppler_hz;
doppler_measurement_hz += it.Acq_doppler_hz;
}
doppler_measurement_hz = doppler_measurement_hz / gnss_sync_vector.size();
doppler_measurements_map.insert(std::pair<int, double>(PRN, doppler_measurement_hz));
@@ -540,21 +540,21 @@ int main(int argc, char** argv)
std::cout << "SV ID Measured [Hz] Predicted [Hz]" << std::endl;
for (auto it = doppler_measurements_map.begin(); it != doppler_measurements_map.end(); ++it)
for (auto & it : doppler_measurements_map)
{
try
{
double doppler_estimated_hz;
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m);
std::cout << " " << it->first << " " << it->second << " " << doppler_estimated_hz << std::endl;
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it.first, current_TOW, lat_deg, lon_deg, altitude_m);
std::cout << " " << it.first << " " << it.second << " " << doppler_estimated_hz << std::endl;
// 7. Compute front-end IF and sampling frequency estimation
// Compare with the measurements and compute clock drift using FE model
double estimated_fs_Hz, estimated_f_if_Hz, f_osc_err_ppm;
front_end_cal.GPS_L1_front_end_model_E4000(doppler_estimated_hz, it->second, fs_in_, &estimated_fs_Hz, &estimated_f_if_Hz, &f_osc_err_ppm);
front_end_cal.GPS_L1_front_end_model_E4000(doppler_estimated_hz, it.second, fs_in_, &estimated_fs_Hz, &estimated_f_if_Hz, &f_osc_err_ppm);
f_if_estimation_Hz_map.insert(std::pair<int, double>(it->first, estimated_f_if_Hz));
f_fs_estimation_Hz_map.insert(std::pair<int, double>(it->first, estimated_fs_Hz));
f_ppm_estimation_Hz_map.insert(std::pair<int, double>(it->first, f_osc_err_ppm));
f_if_estimation_Hz_map.insert(std::pair<int, double>(it.first, estimated_f_if_Hz));
f_fs_estimation_Hz_map.insert(std::pair<int, double>(it.first, estimated_fs_Hz));
f_ppm_estimation_Hz_map.insert(std::pair<int, double>(it.first, f_osc_err_ppm));
}
catch (const std::logic_error& e)
{
@@ -566,7 +566,7 @@ int main(int argc, char** argv)
}
catch (int ex)
{
std::cout << " " << it->first << " " << it->second << " (Eph not found)" << std::endl;
std::cout << " " << it.first << " " << it.second << " (Eph not found)" << std::endl;
}
}
@@ -576,11 +576,11 @@ int main(int argc, char** argv)
double mean_osc_err_ppm = 0;
int n_elements = f_if_estimation_Hz_map.size();
for (auto it = f_if_estimation_Hz_map.begin(); it != f_if_estimation_Hz_map.end(); ++it)
for (auto & it : f_if_estimation_Hz_map)
{
mean_f_if_Hz += (*it).second;
mean_fs_Hz += f_fs_estimation_Hz_map.find((*it).first)->second;
mean_osc_err_ppm += f_ppm_estimation_Hz_map.find((*it).first)->second;
mean_f_if_Hz += it.second;
mean_fs_Hz += f_fs_estimation_Hz_map.find(it.first)->second;
mean_osc_err_ppm += f_ppm_estimation_Hz_map.find(it.first)->second;
}
mean_f_if_Hz /= n_elements;
@@ -597,13 +597,13 @@ int main(int argc, char** argv)
<< "Corrected Doppler vs. Predicted" << std::endl;
std::cout << "SV ID Corrected [Hz] Predicted [Hz]" << std::endl;
for (auto it = doppler_measurements_map.begin(); it != doppler_measurements_map.end(); ++it)
for (auto & it : doppler_measurements_map)
{
try
{
double doppler_estimated_hz;
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m);
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl;
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it.first, current_TOW, lat_deg, lon_deg, altitude_m);
std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl;
}
catch (const std::logic_error& e)
{
@@ -615,7 +615,7 @@ int main(int argc, char** argv)
}
catch (int ex)
{
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " (Eph not found)" << std::endl;
std::cout << " " << it.first << " " << it.second - mean_f_if_Hz << " (Eph not found)" << std::endl;
}
}