Changeset 10947 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Jun 25, 2026, 2:14:56 PM (8 days ago)
Author:
stuerze
Message:

minor changes

Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r10946 r10947  
    349349// independently-known attitude/orbit residuals if high accuracy matters.
    350350////////////////////////////////////////////////////////////////////////////
    351 double bncAntex::glonassYawAngle(const QString& prn, const ColumnVector& xSat,
     351double bncAntex::glonassYawAngle(const QString& prn, double Mjd,
     352                                  const ColumnVector& xSat,
    352353                                  const ColumnVector& vSat,
    353354                                  const ColumnVector& xSun) {
    354355
    355356  const double MAX_YAW_RATE = 0.25 * M_PI / 180.0; // [rad/s], approximate
     357
     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
    356366
    357367  // Inertial-consistent velocity (xSat, vSat are Earth-fixed; remove the
     
    398408  double psiEff;
    399409  if (psiRate > MAX_YAW_RATE) {
    400     if (!st.valid) {
    401       st.yaw = psiNom; // no prior history - best available estimate
     410    if (!st.valid || (Mjd - st.lastMjd) > MAX_FREEZE_AGE) {
     411      st.yaw     = psiNom; // no prior history, or it is too old to trust
     412      st.lastMjd = Mjd;
     413      st.valid   = true;
    402414    }
    403415    psiEff = st.yaw;    // hold the frozen yaw angle
    404416  }
    405417  else {
    406     st.yaw   = psiNom;
    407     st.valid = true;
    408     psiEff   = psiNom;
     418    st.yaw     = psiNom;
     419    st.lastMjd = Mjd;
     420    st.valid   = true;
     421    psiEff     = psiNom;
    409422  }
    410423
     
    466479      // -----------------------------------------------------------------
    467480      if (prn[0] == 'R' && vSat.size() == 3) {
    468         double psi = glonassYawAngle(prn, xSat, vSat, xSun);
     481        double psi = glonassYawAngle(prn, Mjd, xSat, vSat, xSun);
    469482
    470483        ColumnVector vInert = vSat;
  • trunk/BNC/src/bncantex.h

    r10946 r10947  
    5757   public:
    5858    t_glonassYaw() {
    59       yaw   = 0.0;
    60       valid = false;
     59      yaw     = 0.0;
     60      lastMjd = 0.0;
     61      valid   = false;
    6162    }
    6263    double yaw;
     64    double lastMjd; // Mjd of the last epoch the nominal law was trusted
    6365    bool   valid;
    6466  };
    6567
    66   double glonassYawAngle(const QString& prn, const ColumnVector& xSat,
     68  double glonassYawAngle(const QString& prn, double Mjd, const ColumnVector& xSat,
    6769                          const ColumnVector& vSat, const ColumnVector& xSun);
    6870
Note: See TracChangeset for help on using the changeset viewer.