Changeset 10993 in ntrip


Ignore:
Timestamp:
Aug 20, 2026, 3:23:19 PM (3 weeks ago)
Author:
stuerze
Message:

minor changes to allow different formulas for the computation of the relativistic effects in GPS position determination for RTCM-SSR and IGS-SSR

Location:
trunk/BNC/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r10826 r10993  
    314314      orbCorr._dotXr[1]  = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack;
    315315      orbCorr._dotXr[2]  = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack;
     316      orbCorr._rtcmSsr   = (_type == RTCMssr || _type == RTCMnewssr);
    316317
    317318      _orbCorrections[_lastTime].append(orbCorr);
  • trunk/BNC/src/ephemeris.cpp

    r10992 r10993  
    731731  // Relativistic Correction
    732732  // -----------------------
    733   //xc[3] -= 4.442807633e-10 * _e * sqrt(a0) * sin(E);
    734   // as recommended from new RTCM-SSR =>IS-GPS-200D: paragraph 20.3.3.3.3.1:
    735   xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     733  // Both forms are equivalent per the ICD for an unperturbed broadcast orbit,
     734  // but differ numerically once harmonic (Crc/Crs/Cuc/Cus/Cic/Cis) terms are
     735  // included in xc/vv. The velocity-based form (IS-GPS-200D 20.3.3.3.3.1) is
     736  // the one recommended together with RTCM-SSR corrections; the classic
     737  // eccentricity-based form is used otherwise (broadcast-only or IGS-SSR).
     738  if (_orbCorr && _orbCorr->_rtcmSsr) {
     739    xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     740  }
     741  else {
     742    xc[3] -= 4.442807633e-10 * _e * sqrt(a0) * sin(E);
     743  }
    736744
    737745  xc[4] = _clock_drift + _clock_driftrate * tc;
     
    20562064  // Relativistic Correction
    20572065  // -----------------------
    2058   xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
     2066  // See t_ephGPS::position() for the rationale behind selecting between the
     2067  // eccentricity-based and velocity-based forms.
     2068  if (_orbCorr && _orbCorr->_rtcmSsr) {
     2069    xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     2070  }
     2071  else {
     2072    xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
     2073  }
    20592074
    20602075  xc[4] = _clock_drift + _clock_driftrate * tc;
     
    29602975  // Relativistic Correction
    29612976  // -----------------------
    2962   xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
     2977  // See t_ephGPS::position() for the rationale behind selecting between the
     2978  // eccentricity-based and velocity-based forms.
     2979  if (_orbCorr && _orbCorr->_rtcmSsr) {
     2980    xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
     2981  }
     2982  else {
     2983    xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
     2984  }
    29632985
    29642986  xc[4] = _clock_drift + _clock_driftrate * tc;
  • trunk/BNC/src/satObs.cpp

    r10622 r10993  
    8686  _xr.ReSize(3);    _xr    = 0.0;
    8787  _dotXr.ReSize(3); _dotXr = 0.0;
     88  _rtcmSsr   = false;
    8889}
    8990
     
    111112         << setw(10) << setprecision(4) << corr._dotXr[0] * 1.e3 << ' '   // m/s => mm/s
    112113         << setw(10) << setprecision(4) << corr._dotXr[1] * 1.e3 << ' '   // m/s => mm/s
    113          << setw(10) << setprecision(4) << corr._dotXr[2] * 1.e3 << endl; // m/s => mm/s
     114         << setw(10) << setprecision(4) << corr._dotXr[2] * 1.e3 << ' '   // m/s => mm/s
     115         << (corr._rtcmSsr ? 1 : 0) << endl;
    114116  }
    115117  out->flush();
     
    148150    corr._dotXr[1] /= 1.e3; // mm/s => m/s
    149151    corr._dotXr[2] /= 1.e3; // mm/s => m/s
     152
     153    // Optional trailing column - absent in files written before this field
     154    // existed, in which case the source format is unknown and defaults to
     155    // the classic eccentricity-based relativistic correction.
     156    int rtcmSsrFlag = 0;
     157    if (in >> rtcmSsrFlag) {
     158      corr._rtcmSsr = (rtcmSsrFlag != 0);
     159    }
     160    else {
     161      corr._rtcmSsr = false;
     162    }
    150163
    151164    corrList.push_back(corr);
  • trunk/BNC/src/satObs.h

    r10791 r10993  
    117117  ColumnVector   _xr;
    118118  ColumnVector   _dotXr;
     119  bool           _rtcmSsr; // true: RTCM-SSR/RTCM-SSR-new source (velocity-based relativistic
     120                            // correction per IS-GPS-200D 20.3.3.3.3.1); false: IGS-SSR or
     121                            // unknown source (classic eccentricity-based correction)
    119122};
    120123
Note: See TracChangeset for help on using the changeset viewer.