From feae8303de21bc36064c11f52e27fe23322d6f14 Mon Sep 17 00:00:00 2001 From: Damian Miralles Date: Mon, 13 Nov 2017 14:18:45 -0700 Subject: [PATCH] clean up: Clean up warnings during compile process Removes unused variables from code and fix counter to include both GPS and GLONASS observations --- src/algorithms/PVT/libs/rtklib_solver.cc | 16 ++++++++-------- .../system_parameters/glonass_gnav_ephemeris.cc | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index 30766ca0c..3898a9758 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -179,7 +179,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ { if (eph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN + NSATGPS + NSATGLO))) { - obs_data[i] = insert_obs_to_rtklib(obs_data[i], + obs_data[i+glo_valid_obs] = insert_obs_to_rtklib(obs_data[i+glo_valid_obs], gnss_observables_iter->second, galileo_ephemeris_iter->second.WN_5, 2);//Band 3 (L5/E5) @@ -194,7 +194,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ eph_data[valid_obs] = eph_to_rtklib(galileo_ephemeris_iter->second); //convert observation from GNSS-SDR class to RTKLIB structure obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, galileo_ephemeris_iter->second.WN_5, 2); //Band 3 (L5/E5) @@ -223,7 +223,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ eph_data[valid_obs] = eph_to_rtklib(gps_ephemeris_iter->second); //convert observation from GNSS-SDR class to RTKLIB structure obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, gps_ephemeris_iter->second.i_GPS_week, 0); @@ -251,7 +251,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ if (eph_data[i].sat == static_cast(gnss_observables_iter->second.PRN)) { eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); - obs_data[i] = insert_obs_to_rtklib(obs_data[i], + obs_data[i+glo_valid_obs] = insert_obs_to_rtklib(obs_data[i+glo_valid_obs], gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, 1);//Band 2 (L2) @@ -266,7 +266,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); //convert observation from GNSS-SDR class to RTKLIB structure obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs + glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, gps_cnav_ephemeris_iter->second.i_GPS_week, 1);//Band 2 (L2) @@ -294,7 +294,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); //convert observation from GNSS-SDR class to RTKLIB structure obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[glo_valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, 0);//Band 0 (L1) @@ -318,7 +318,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ { if (geph_data[i].sat == (static_cast(gnss_observables_iter->second.PRN+NSATGPS))) { - obs_data[i] = insert_obs_to_rtklib(obs_data[i], + obs_data[i+valid_obs] = insert_obs_to_rtklib(obs_data[i+valid_obs], gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, 1);//Band 1 (L2) @@ -333,7 +333,7 @@ bool rtklib_solver::get_PVT(const std::map & gnss_observables_ geph_data[glo_valid_obs] = eph_to_rtklib(glonass_gnav_ephemeris_iter->second, gnav_utc); //convert observation from GNSS-SDR class to RTKLIB structure obsd_t newobs = {{0,0}, '0', '0', {}, {}, {}, {}, {}, {}}; - obs_data[glo_valid_obs] = insert_obs_to_rtklib(newobs, + obs_data[valid_obs+glo_valid_obs] = insert_obs_to_rtklib(newobs, gnss_observables_iter->second, glonass_gnav_ephemeris_iter->second.d_WN, 1); //Band 1 (L2) diff --git a/src/core/system_parameters/glonass_gnav_ephemeris.cc b/src/core/system_parameters/glonass_gnav_ephemeris.cc index 91a147621..c557c6a6f 100644 --- a/src/core/system_parameters/glonass_gnav_ephemeris.cc +++ b/src/core/system_parameters/glonass_gnav_ephemeris.cc @@ -97,10 +97,9 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::compute_GLONASS_time(const doub boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset_time, const double glot2utc_corr) const { double tod = 0.0; - double utcsu2utc = 3*3600; - double glot2utcsu = 3*3600; + double glot2utc = 3*3600; - tod = offset_time - glot2utcsu - utcsu2utc + glot2utc_corr + d_tau_n; + tod = offset_time - glot2utc + glot2utc_corr + d_tau_n; boost::posix_time::time_duration t(0, 0, tod); boost::gregorian::date d1(d_yr, 1, 1); boost::gregorian::days d2(d_N_T - 1); @@ -112,7 +111,6 @@ boost::posix_time::ptime Glonass_Gnav_Ephemeris::glot_to_utc(const double offset void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_corr, double glot2gpst_corr, double * wn, double * tow) const { double tod = 0.0; - double dayofweek = 0.0; double glot2utc = 3*3600; double days = 0.0; double total_sec = 0.0, sec_of_day = 0.0;