Changeset 10951 in ntrip for trunk/BNC/src/bncantex.cpp


Ignore:
Timestamp:
Jun 26, 2026, 9:27:02 AM (20 hours ago)
Author:
stuerze
Message:

minor changes to investigate a special GLO behavior

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncantex.cpp

    r10948 r10951  
    356356  const double MAX_YAW_RATE = 0.25 * M_PI / 180.0; // [rad/s], approximate
    357357
    358   // A genuine yaw-fixed window (gapless data) only ever lasts a few
    359   // minutes around the orbit noon/midnight point - see the width
    360   // estimate in the comment above. If the stored frozen value is much
    361   // older than that, it is more likely stale (e.g. a stream outage, a
    362   // maneuver-flagged-unhealthy period, or a brief eclipse passage spanned
    363   // the gap) than a still-valid freeze, so fall back to the current
    364   // nominal value instead of trusting it indefinitely.
    365   const double MAX_FREEZE_AGE = 1800.0 / 86400.0; // 30 minutes, in days
     358  // This bounds the gap BETWEEN CONSECUTIVE CALLS for a given satellite
     359  // (not how long the freeze itself has lasted - a real low-beta passage
     360  // can legitimately stay frozen far longer than this). If there was no
     361  // call for longer than this, something else interrupted normal epoch-by-
     362  // epoch processing (a stream outage, a maneuver-flagged-unhealthy
     363  // period, ...), so the stored frozen value is more likely stale than a
     364  // still-valid freeze, and we fall back to the current nominal value
     365  // instead of trusting it indefinitely.
     366  const double MAX_CALL_GAP = 1800.0 / 86400.0; // 30 minutes, in days
    366367
    367368  // Inertial-consistent velocity (xSat, vSat are Earth-fixed; remove the
     
    406407
    407408  t_glonassYaw& st = _glonassYaw[prn];
     409  double callGap = st.valid ? (Mjd - st.lastCallMjd) : 0.0;
    408410  double psiEff;
    409411  if (psiRate > MAX_YAW_RATE) {
    410     if (!st.valid || (Mjd - st.lastMjd) > MAX_FREEZE_AGE) {
    411       if (st.valid) { // i.e. it was the staleness bound, not cold-start
     412    if (!st.valid || callGap > MAX_CALL_GAP) {
     413      if (st.valid) { // i.e. it was a genuine gap, not cold-start
    412414        _glonassYawLog += QString().asprintf(
    413415          "%s glonassYaw STALE-RESET  Mjd=%.6f beta=%6.3f mu=%7.2f rate=%6.3f"
    414           " old=%7.2f new=%7.2f age=%.1fmin\n",
     416          " old=%7.2f new=%7.2f gap=%.1fmin\n",
    415417          prn.toLatin1().data(), Mjd, beta*180.0/M_PI, mu*180.0/M_PI,
    416418          psiRate*180.0/M_PI, st.yaw*180.0/M_PI, psiNom*180.0/M_PI,
    417           (Mjd-st.lastMjd)*1440.0);
    418       }
    419       st.yaw     = psiNom; // no prior history, or it is too old to trust
    420       st.lastMjd = Mjd;
    421       st.valid   = true;
     419          callGap*1440.0);
     420      }
     421      st.yaw = psiNom; // no prior history, or the gap is too long to trust it
    422422    }
    423423    if (!st.fixed) {
     
    439439      st.fixed = false;
    440440    }
    441     st.yaw     = psiNom;
    442     st.lastMjd = Mjd;
    443     st.valid   = true;
    444     psiEff     = psiNom;
    445   }
     441    st.yaw = psiNom;
     442    psiEff = psiNom;
     443  }
     444  st.lastCallMjd = Mjd; // update on every call, fixed or not, to detect gaps
     445  st.valid       = true;
    446446
    447447  return psiEff;
Note: See TracChangeset for help on using the changeset viewer.