1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 05:00:35 +00:00

Disable eph update when L1 + L2

This commit is contained in:
Antonio Ramos 2018-03-09 13:05:25 +01:00
parent ab7cabc8e8
commit ecb4a4970a
4 changed files with 151 additions and 123 deletions

View File

@ -247,17 +247,19 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_
{ {
if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN)) if (eph_data[i].sat == static_cast<int>(gnss_observables_iter->second.PRN))
{ {
eph_data[i] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); eph_t eph_aux = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
eph_data[i].tgd = eph_aux.tgd;
eph_data[i].isc = eph_aux.isc;
obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs], obs_data[i + glo_valid_obs] = insert_obs_to_rtklib(obs_data[i + glo_valid_obs],
gnss_observables_iter->second, gnss_observables_iter->second,
gps_cnav_ephemeris_iter->second.i_GPS_week, eph_data[i].week,
1); //Band 2 (L2) 1); //Band 2 (L2)
break; break;
} }
} }
} }
else else
{ { /*
// 3. If not found, insert the GPS L2 ephemeris and the observation // 3. If not found, insert the GPS L2 ephemeris and the observation
//convert ephemeris from GNSS-SDR class to RTKLIB structure //convert ephemeris from GNSS-SDR class to RTKLIB structure
eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second); eph_data[valid_obs] = eph_to_rtklib(gps_cnav_ephemeris_iter->second);
@ -271,6 +273,7 @@ bool rtklib_solver::get_PVT(const std::map<int, Gnss_Synchro>& gnss_observables_
gps_cnav_ephemeris_iter->second.i_GPS_week, gps_cnav_ephemeris_iter->second.i_GPS_week,
1); //Band 2 (L2) 1); //Band 2 (L2)
valid_obs++; valid_obs++;
*/
} }
} }
else // the ephemeris are not available for this SV else // the ephemeris are not available for this SV

View File

@ -150,12 +150,21 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
/* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */
if(sys == SYS_GAL or sys == SYS_SBS) {j = 2;} if (sys == SYS_GAL or sys == SYS_SBS)
{
j = 2;
}
if (sys == SYS_GPS) if (sys == SYS_GPS)
{ {
if(obs->code[1] != CODE_NONE) {j = 1;} if (obs->code[1] != CODE_NONE)
else if(obs->code[2] != CODE_NONE) {j = 2;} {
j = 1;
}
else if (obs->code[2] != CODE_NONE)
{
j = 2;
}
} }
if (lam[i] == 0.0 or lam[j] == 0.0) if (lam[i] == 0.0 or lam[j] == 0.0)
@ -207,7 +216,10 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
d_file.write(reinterpret_cast<char *>(&P2_C2), sizeof(double)); d_file.write(reinterpret_cast<char *>(&P2_C2), sizeof(double));
/* if no P1-P2 DCB, use TGD instead */ /* if no P1-P2 DCB, use TGD instead */
if(P1_P2 == 0.0) { P1_P2 = gettgd(obs->sat, nav); } if (P1_P2 == 0.0)
{
P1_P2 = gettgd(obs->sat, nav);
}
if (sys == SYS_GPS) if (sys == SYS_GPS)
{ {
@ -226,9 +238,18 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
if (opt->ionoopt == IONOOPT_IFLC) if (opt->ionoopt == IONOOPT_IFLC)
{ /* dual-frequency */ { /* dual-frequency */
if (P1 == 0.0 || P2 == 0.0) { return 0.0; } if (P1 == 0.0 || P2 == 0.0)
if (obs->code[i] == CODE_L1C) { P1 += P1_C1; } /* C1->P1 */ {
if (obs->code[j] == CODE_L2C) { P2 += P2_C2; } /* C2->P2 */ return 0.0;
}
if (obs->code[i] == CODE_L1C)
{
P1 += P1_C1;
} /* C1->P1 */
if (obs->code[j] == CODE_L2C)
{
P2 += P2_C2;
} /* C2->P2 */
/* iono-free combination */ /* iono-free combination */
PC = (gamma_ * P1 - P2) / (gamma_ - 1.0); PC = (gamma_ * P1 - P2) / (gamma_ - 1.0);
@ -236,7 +257,10 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
//////////////////////////////////////////// ////////////////////////////////////////////
else else
{ /* single-frequency */ { /* single-frequency */
if(obs->code[i] == CODE_NONE and obs->code[j] == CODE_NONE) { return 0.0; } if (obs->code[i] == CODE_NONE and obs->code[j] == CODE_NONE)
{
return 0.0;
}
else if (obs->code[i] != CODE_NONE and obs->code[j] == CODE_NONE) else if (obs->code[i] != CODE_NONE and obs->code[j] == CODE_NONE)
{ //CHECK!! { //CHECK!!
@ -265,7 +289,6 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
} }
if (obs->code[j] == CODE_L5X) /* L1 + L5 */ if (obs->code[j] == CODE_L5X) /* L1 + L5 */
{ {
} }
} }
else if (sys == SYS_GAL) /* E1 + E5a */ else if (sys == SYS_GAL) /* E1 + E5a */
@ -275,7 +298,10 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
} }
d_file.write(reinterpret_cast<char *>(&PC), sizeof(double)); d_file.write(reinterpret_cast<char *>(&PC), sizeof(double));
d_file.close(); d_file.close();
if(opt->sateph == EPHOPT_SBAS) { PC -= P1_C1; } /* sbas clock based C1 */ if (opt->sateph == EPHOPT_SBAS)
{
PC -= P1_C1;
} /* sbas clock based C1 */
*var = std::pow(ERR_CBIAS, 2.0); *var = std::pow(ERR_CBIAS, 2.0);
return PC; return PC;
} }

View File

@ -253,8 +253,7 @@ const unsigned int tbl_CRC24Q[] = {
0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538}; 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538};
extern "C" extern "C" {
{
void dgemm_(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *); void dgemm_(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *);
extern void dgetrf_(int *, int *, double *, int *, int *, int *); extern void dgetrf_(int *, int *, double *, int *, int *, int *);
extern void dgetri_(int *, double *, int *, int *, double *, int *, int *); extern void dgetri_(int *, double *, int *, int *, double *, int *, int *);
@ -1388,10 +1387,10 @@ double time2gpst(gtime_t t, int *week)
{ {
gtime_t t0 = epoch2time(gpst0); gtime_t t0 = epoch2time(gpst0);
time_t sec = t.time - t0.time; time_t sec = t.time - t0.time;
int w = (int)(sec / (86400 * 7)); int w = static_cast<int>(sec / 604800);
if (week) *week = w; if (week) *week = w;
return (double)(sec - (double)w * 86400 * 7) + t.sec; return (static_cast<double>(sec - static_cast<time_t>(w * 604800)) + t.sec);
} }

View File

@ -410,7 +410,7 @@ void hybrid_observables_cc::correct_TOW_and_compute_prange(std::vector<Gnss_Sync
double TOW_ref = std::numeric_limits<double>::lowest(); double TOW_ref = std::numeric_limits<double>::lowest();
for (it = data.begin(); it != data.end(); it++) for (it = data.begin(); it != data.end(); it++)
{ {
if (it->TOW_at_current_symbol_s > TOW_ref and it->Signal[0] != '2') if (it->TOW_at_current_symbol_s > TOW_ref)
{ {
TOW_ref = it->TOW_at_current_symbol_s; TOW_ref = it->TOW_at_current_symbol_s;
} }