Changeset 10954 in ntrip for trunk


Ignore:
Timestamp:
Jun 30, 2026, 10:47:22 PM (5 days ago)
Author:
stuerze
Message:

minor changes to investigate a special GLO behavior

Location:
trunk/BNC/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/combination/bnccomb.cpp

    r10950 r10954  
    11891189    corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
    11901190    corr->_eph->setOrbCorr(dynamic_cast<const t_orbCorr*>(&orbCorr));
     1191
     1192    /* TEMPORARY DIAGNOSTIC: dump the exact orbit/clock correction content
     1193    // being used for this PRN right before getCrd() applies it - adjust
     1194    // the PRN below to whichever satellite is showing the anomaly.
     1195    if (corr->_prn.startsWith("R08")) {
     1196      const t_orbCorr* oc = corr->_eph->orbCorr();
     1197      const t_clkCorr* cc = corr->_eph->clkCorr();
     1198      emit newMessage(QString().asprintf(
     1199        "bncComb: DIAG %s Mjd=%.6f IOD=%u TOC=%.3f bcepAge=%.2f orbT=%.3f orbAge=%.2f xr=%.4f/%.4f/%.4f"
     1200        " dotXr=%.6f/%.6f/%.6f clkT=%.3f clkAge=%.2f dClk=%.6f dotDClk=%.6f",
     1201        corr->_prn.toLatin1().data(),
     1202        epoTime.mjd() + epoTime.daysec()/86400.0,
     1203        corr->_eph->IOD(), corr->_eph->TOC().daysec(), epoTime - corr->_eph->TOC(),
     1204        oc->_time.daysec(), epoTime - oc->_time,
     1205        oc->_xr[0], oc->_xr[1], oc->_xr[2],
     1206        oc->_dotXr[0], oc->_dotXr[1], oc->_dotXr[2],
     1207        cc->_time.daysec(), epoTime - cc->_time,
     1208        cc->_dClk, cc->_dotDClk).toLatin1(), false);
     1209    }
     1210  */
    11911211    if (corr->_eph->getCrd(epoTime, xc, vv, true) != success) {
     1212      /*
     1213      if (corr->_prn.startsWith("R08")) {
     1214        emit newMessage(("bncComb: DIAG " + corr->_prn.mid(0,3) + " getCrd FAILED").toLatin1(), false);
     1215      }
     1216      */
    11921217      delete corr;
    11931218      it.remove();
    11941219      continue;
    11951220    }
    1196 
     1221    /*
     1222    else if (corr->_prn.startsWith("R08")) {
     1223      emit newMessage(("bncComb: DIAG " + corr->_prn.mid(0,3) + " getCrd OK").toLatin1(), false);
     1224    }
     1225   
     1226    */
    11971227    // TEMPORARY DIAGNOSTIC: how far is this epoch from the GLONASS broadcast
    11981228    // ephemeris reference time? t_ephGlo::position() numerically integrates
  • trunk/BNC/src/ephemeris.cpp

    r10898 r10954  
    7373  if (useCorr) {
    7474    if (_orbCorr && _clkCorr) {
     75      // Refuse to extrapolate a correction far beyond its own declared
     76      // update interval - without this, a single missed/dropped
     77      // correction message (network blip, encoder hiccup, ...) gets
     78      // extrapolated via its rate term (_dotXr/_dotDClk) forever, with no
     79      // warning, producing an unbounded, silently growing position error.
     80      // ----------------------------------------------------------------
     81      // _updateInt defaults to 0 (1s) when not explicitly set by the
     82      // source stream, so a pure multiple of it would be far too strict -
     83      // floor it at MIN_STALE_BOUND so normal, slightly slower-than-1Hz
     84      // streams are not falsely flagged.
     85      const double MAX_STALE_FACTOR = 3.0;
     86      const double MIN_STALE_BOUND  = 60.0; // [s]
     87      double maxAgeO = max(MIN_STALE_BOUND, MAX_STALE_FACTOR * ssrUpdateInt[_orbCorr->_updateInt]);
     88      double maxAgeC = max(MIN_STALE_BOUND, MAX_STALE_FACTOR * ssrUpdateInt[_clkCorr->_updateInt]);
     89      if (fabs(tt - _orbCorr->_time) > maxAgeO ||
     90          fabs(tt - _clkCorr->_time) > maxAgeC) {
     91        return failure;
     92      }
     93
    7594      double dtO = tt - _orbCorr->_time;
    7695      if (_orbCorr->_updateInt) {
     
    14241443  memset(vv, 0, 3 * sizeof(double));
    14251444
    1426   double dtPos = bncTime(GPSweek, GPSweeks) - _tt;
     1445  bncTime tt(GPSweek, GPSweeks);
     1446  double dtPos = tt - _TOC;
    14271447
    14281448  if (fabs(dtPos) > 24 * 3600.0) {
     
    14381458  acc[2] = _z_acc * 1.e3;
    14391459
     1460  // Always integrate fresh from the pristine, decoded TOC state rather
     1461  // than rolling _tt/_xv forward across repeated calls. position() can be
     1462  // called very frequently (multiple times per epoch, from multiple call
     1463  // sites) - chaining many short integration steps across those calls,
     1464  // instead of one direct integration to the requested time, lets small
     1465  // per-call numerical error accumulate over wall-clock time independent
     1466  // of how far the request actually is from TOC, producing a slow but
     1467  // steady drift (observed: ~0.5-0.7 mm/s along-track for a GLONASS
     1468  // satellite whose broadcast message was barely a few minutes old).
     1469  // ----------------------------------------------------------------
     1470  ColumnVector xv(6);
     1471  xv(1) = _x_pos * 1.e3;
     1472  xv(2) = _y_pos * 1.e3;
     1473  xv(3) = _z_pos * 1.e3;
     1474  xv(4) = _x_vel * 1.e3;
     1475  xv(5) = _y_vel * 1.e3;
     1476  xv(6) = _z_vel * 1.e3;
     1477
     1478  bncTime ttLocal = _TOC;
    14401479  for (int ii = 1; ii <= nSteps; ii++) {
    1441     _xv = rungeKutta4(_tt.gpssec(), _xv, step, acc, glo_deriv);
    1442     _tt = _tt + step;
     1480    xv = rungeKutta4(ttLocal.gpssec(), xv, step, acc, glo_deriv);
     1481    ttLocal = ttLocal + step;
    14431482  }
    14441483
    14451484  // Position and Velocity
    14461485  // ---------------------
    1447   xc[0] = _xv(1);
    1448   xc[1] = _xv(2);
    1449   xc[2] = _xv(3);
    1450 
    1451   vv[0] = _xv(4);
    1452   vv[1] = _xv(5);
    1453   vv[2] = _xv(6);
     1486  xc[0] = xv(1);
     1487  xc[1] = xv(2);
     1488  xc[2] = xv(3);
     1489
     1490  vv[0] = xv(4);
     1491  vv[1] = xv(5);
     1492  vv[2] = xv(6);
    14541493
    14551494  // Clock Correction
    14561495  // ----------------
    1457   double dtClk = bncTime(GPSweek, GPSweeks) - _TOC;
     1496  double dtClk = tt - _TOC;
    14581497  xc[3] = -_tau + _gamma * dtClk;
    14591498
  • trunk/BNC/src/ephemeris.h

    r10899 r10954  
    4848  void setOrbCorr(const t_orbCorr* orbCorr);
    4949  void setClkCorr(const t_clkCorr* clkCorr);
     50  const t_orbCorr* orbCorr() const {return _orbCorr;}
     51  const t_clkCorr* clkCorr() const {return _clkCorr;}
    5052  const QDateTime& receptDateTime() const {return _receptDateTime;}
    5153  const QString receptStaID() const {return _receptStaID;}
Note: See TracChangeset for help on using the changeset viewer.