- Timestamp:
- Jun 30, 2026, 10:47:22 PM (5 days ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
-
combination/bnccomb.cpp (modified) (1 diff)
-
ephemeris.cpp (modified) (3 diffs)
-
ephemeris.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r10950 r10954 1189 1189 corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr)); 1190 1190 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 */ 1191 1211 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 */ 1192 1217 delete corr; 1193 1218 it.remove(); 1194 1219 continue; 1195 1220 } 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 */ 1197 1227 // TEMPORARY DIAGNOSTIC: how far is this epoch from the GLONASS broadcast 1198 1228 // ephemeris reference time? t_ephGlo::position() numerically integrates -
trunk/BNC/src/ephemeris.cpp
r10898 r10954 73 73 if (useCorr) { 74 74 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 75 94 double dtO = tt - _orbCorr->_time; 76 95 if (_orbCorr->_updateInt) { … … 1424 1443 memset(vv, 0, 3 * sizeof(double)); 1425 1444 1426 double dtPos = bncTime(GPSweek, GPSweeks) - _tt; 1445 bncTime tt(GPSweek, GPSweeks); 1446 double dtPos = tt - _TOC; 1427 1447 1428 1448 if (fabs(dtPos) > 24 * 3600.0) { … … 1438 1458 acc[2] = _z_acc * 1.e3; 1439 1459 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; 1440 1479 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; 1443 1482 } 1444 1483 1445 1484 // Position and Velocity 1446 1485 // --------------------- 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); 1454 1493 1455 1494 // Clock Correction 1456 1495 // ---------------- 1457 double dtClk = bncTime(GPSweek, GPSweeks)- _TOC;1496 double dtClk = tt - _TOC; 1458 1497 xc[3] = -_tau + _gamma * dtClk; 1459 1498 -
trunk/BNC/src/ephemeris.h
r10899 r10954 48 48 void setOrbCorr(const t_orbCorr* orbCorr); 49 49 void setClkCorr(const t_clkCorr* clkCorr); 50 const t_orbCorr* orbCorr() const {return _orbCorr;} 51 const t_clkCorr* clkCorr() const {return _clkCorr;} 50 52 const QDateTime& receptDateTime() const {return _receptDateTime;} 51 53 const QString receptStaID() const {return _receptStaID;}
Note:
See TracChangeset
for help on using the changeset viewer.
