diff --git a/src/tests/system-tests/trk_system_test.cc b/src/tests/system-tests/trk_system_test.cc index 6af4a87fd..a28220a27 100644 --- a/src/tests/system-tests/trk_system_test.cc +++ b/src/tests/system-tests/trk_system_test.cc @@ -347,9 +347,11 @@ void Trk_System_Test::check_results() { std::vector> > pseudorange_ref(33); std::vector> > carrierphase_ref(33); + std::vector> > doppler_ref(33); std::vector> > pseudorange_meas(33); std::vector> > carrierphase_meas(33); + std::vector> > doppler_meas(33); // Open and read reference RINEX observables file try @@ -387,6 +389,11 @@ void Trk_System_Test::check_results() double L1 = dataobj.data; std::pair carrier(sow, L1); carrierphase_ref.at(myprn).push_back(carrier); + + dataobj = r_ref_data.getObs(prn, "D1C", r_ref_header); + double D1 = dataobj.data; + std::pair doppler(sow, D1); + doppler_ref.at(myprn).push_back(doppler); } // End of 'if( pointer == roe.obs.end() )' } // end for } // end while @@ -453,6 +460,11 @@ void Trk_System_Test::check_results() double L1 = dataobj.data; std::pair carrier(sow,L1); carrierphase_meas.at(myprn).push_back(carrier); + + dataobj = r_meas_data.getObs(prn, "D1C", r_meas_header); + double D1 = dataobj.data; + std::pair doppler(sow, L1); + doppler_meas.at(myprn).push_back(doppler); } // End of 'if( pointer == roe.obs.end() )' } // end for } // end while @@ -476,6 +488,7 @@ void Trk_System_Test::check_results() // Time alignment std::vector> > pseudorange_ref_aligned(33); std::vector> > carrierphase_ref_aligned(33); + std::vector> > doppler_ref_aligned(33); std::vector> >::iterator iter; std::vector>::iterator it; @@ -483,6 +496,7 @@ void Trk_System_Test::check_results() std::vector> pr_diff(33); std::vector> cp_diff(33); + std::vector> doppler_diff(33); std::vector>::iterator iter_diff; std::vector::iterator iter_v; @@ -522,6 +536,23 @@ void Trk_System_Test::check_results() } prn_id++; } + prn_id = 0; + for(iter = doppler_ref.begin(); iter != doppler_ref.end(); iter++) + { + for(it = iter->begin(); it != iter->end(); it++) + { + // If a measure exists for this sow, store it + for(it2 = doppler_meas.at(prn_id).begin(); it2 != doppler_meas.at(prn_id).end(); it2++) + { + if(std::abs(it->first - it2->first) < 0.001) // store measures closer than 1 ms. + { + doppler_ref_aligned.at(prn_id).push_back(*it); + doppler_diff.at(prn_id).push_back(it->second - it2->second ); + } + } + } + prn_id++; + } // Compute pseudorange error prn_id = 0; @@ -575,6 +606,32 @@ void Trk_System_Test::check_results() prn_id++; } + // Compute doppler error + prn_id = 0; + for(iter_diff = doppler_diff.begin(); iter_diff != doppler_diff.end(); iter_diff++) + { + // For each satellite with reference and measurements aligned in time + int number_obs = 0; + double mean_diff = 0.0; + for(iter_v = iter_diff->begin(); iter_v != iter_diff->end(); iter_v++) + { + //std::cout << *iter_v << std::endl; + mean_diff = mean_diff + *iter_v; + number_obs = number_obs + 1; + } + if(number_obs > 0) + { + mean_diff = mean_diff / number_obs; + std::cout << "-- Mean Doppler difference for sat " << prn_id << ": " << mean_diff << std::endl; + } + else + { + mean_diff = 0.0; + } + + prn_id++; + } + //return 0; }