gnss-js 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YIHO74OS.js → chunk-BEQSEJMU.js} +390 -67
- package/dist/{chunk-FGRC3PB3.js → chunk-BRT6XZ7B.js} +4 -3
- package/dist/{chunk-SWKWJEGY.js → chunk-I4UV45NT.js} +269 -15
- package/dist/{chunk-E5CP37P2.js → chunk-QXZZNXE3.js} +1 -1
- package/dist/index.cjs +672 -99
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +53 -41
- package/dist/novatel.cjs +357 -14
- package/dist/novatel.d.cts +69 -1
- package/dist/novatel.d.ts +69 -1
- package/dist/novatel.js +11 -1
- package/dist/orbit.js +2 -2
- package/dist/positioning.js +3 -3
- package/dist/rtcm3.cjs +91 -8
- package/dist/rtcm3.d.cts +8 -0
- package/dist/rtcm3.d.ts +8 -0
- package/dist/rtcm3.js +2 -1
- package/dist/sbf.cjs +478 -68
- package/dist/sbf.d.cts +138 -1
- package/dist/sbf.d.ts +138 -1
- package/dist/sbf.js +9 -3
- package/package.json +1 -1
- package/dist/{chunk-VAHMHYID.js → chunk-OMVL3X7V.js} +3 -3
package/dist/novatel.d.ts
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
import { E as Ephemeris } from './nav-BAI1a9vK.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* NovAtel OEM4/6/7 binary framing shared by the measurement and
|
|
5
|
+
* navigation decoders: sync pattern 0xAA 0x44 0x12, a 28+-byte header,
|
|
6
|
+
* and a reflected CRC-32 (poly 0xEDB88320) over the whole frame.
|
|
7
|
+
*/
|
|
8
|
+
/** Minimum (standard) OEM4 binary header length. */
|
|
9
|
+
declare const OEM4_HLEN = 28;
|
|
10
|
+
/** Reflected CRC-32 (poly 0xEDB88320, init 0) — NovAtel "32-bit CRC". */
|
|
11
|
+
declare function crc32(data: Uint8Array, start: number, len: number): number;
|
|
12
|
+
/** One CRC-valid OEM4 frame located in a byte stream. */
|
|
13
|
+
interface Oem4Frame {
|
|
14
|
+
/** Message ID. */
|
|
15
|
+
id: number;
|
|
16
|
+
/** Offset of the frame start (first sync byte). */
|
|
17
|
+
start: number;
|
|
18
|
+
/** Offset of the payload (frame start + header length). */
|
|
19
|
+
payload: number;
|
|
20
|
+
/** Payload length in bytes. */
|
|
21
|
+
msgLen: number;
|
|
22
|
+
/** True when the header's message-type field marks a binary body. */
|
|
23
|
+
binary: boolean;
|
|
24
|
+
/** GPS week from the header. */
|
|
25
|
+
week: number;
|
|
26
|
+
/** GPS time of week from the header (ms). */
|
|
27
|
+
towMs: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Iterate every CRC-valid OEM4 frame in `data`. Corrupt or truncated
|
|
31
|
+
* candidates resync at the next byte; CRC failures additionally
|
|
32
|
+
* increment `stats.badCrc`.
|
|
33
|
+
*/
|
|
34
|
+
declare function oem4Frames(data: Uint8Array, view: DataView, stats: {
|
|
35
|
+
badCrc: number;
|
|
36
|
+
}): Generator<Oem4Frame>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* NovAtel navigation-message decoding: RAWEPHEM (message 41, raw GPS
|
|
40
|
+
* LNAV subframes 1–3) and GLOEPHEMERIS (message 723, decoded GLONASS
|
|
41
|
+
* L1 C/A ephemeris).
|
|
42
|
+
*
|
|
43
|
+
* Ported from RTKLIB demo5 (rtklibexplorer fork, src/rcv/novatel.c:
|
|
44
|
+
* decode_rawephemb / decode_gloephemerisb, Copyright (c) 2007-2020
|
|
45
|
+
* T. Takasu, BSD-2-Clause) and cross-checked against the OEM7
|
|
46
|
+
* Commands and Logs Reference Manual. Output records mirror what
|
|
47
|
+
* `parseNavFile` produces for the equivalent RINEX 3 navigation file:
|
|
48
|
+
* GPS `tocDate` is a GPS-scale Date, GLONASS `tocDate` is the UTC
|
|
49
|
+
* epoch, GLONASS state vectors are in km (PZ-90), the RINEX clock bias
|
|
50
|
+
* is −τ_n, and `messageFrameTime` is the frame time as seconds of the
|
|
51
|
+
* UTC week.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
interface NovatelNavResult {
|
|
55
|
+
/** Broadcast ephemerides in stream order, duplicates suppressed. */
|
|
56
|
+
ephemerides: Ephemeris[];
|
|
57
|
+
/** Frames whose CRC failed (corruption indicator). */
|
|
58
|
+
badCrc: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Decode every navigation message (RAWEPHEM, GLOEPHEMERIS) in a
|
|
62
|
+
* NovAtel binary byte stream. Repeated broadcasts of an unchanged
|
|
63
|
+
* ephemeris are suppressed the same way RTKLIB does: GPS by issue of
|
|
64
|
+
* data, GLONASS by reference time and health.
|
|
65
|
+
*/
|
|
66
|
+
declare function parseNovatelNav(data: Uint8Array): NovatelNavResult;
|
|
67
|
+
|
|
1
68
|
/**
|
|
2
69
|
* NovAtel OEM4/6/7 raw-measurement decoding (RANGE log, message 43).
|
|
3
70
|
*
|
|
@@ -15,6 +82,7 @@
|
|
|
15
82
|
* without known parity are dropped, and code/phase are individually
|
|
16
83
|
* gated by their lock flags.
|
|
17
84
|
*/
|
|
85
|
+
|
|
18
86
|
interface NovatelMeasurement {
|
|
19
87
|
/** RINEX PRN, e.g. "G04", "R11", "S23", "J01". */
|
|
20
88
|
prn: string;
|
|
@@ -54,4 +122,4 @@ interface NovatelParseResult {
|
|
|
54
122
|
*/
|
|
55
123
|
declare function parseNovatelRange(data: Uint8Array): NovatelParseResult;
|
|
56
124
|
|
|
57
|
-
export { type NovatelEpoch, type NovatelMeasurement, type NovatelParseResult, parseNovatelRange };
|
|
125
|
+
export { type NovatelEpoch, type NovatelMeasurement, type NovatelNavResult, type NovatelParseResult, OEM4_HLEN, type Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange };
|
package/dist/novatel.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
OEM4_HLEN,
|
|
3
|
+
crc32,
|
|
4
|
+
oem4Frames,
|
|
5
|
+
parseNovatelNav,
|
|
2
6
|
parseNovatelRange
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I4UV45NT.js";
|
|
8
|
+
import "./chunk-HVXYFUCB.js";
|
|
9
|
+
import "./chunk-LEEU5OIO.js";
|
|
4
10
|
export {
|
|
11
|
+
OEM4_HLEN,
|
|
12
|
+
crc32,
|
|
13
|
+
oem4Frames,
|
|
14
|
+
parseNovatelNav,
|
|
5
15
|
parseNovatelRange
|
|
6
16
|
};
|
package/dist/orbit.js
CHANGED
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
navTimesFromEph,
|
|
15
15
|
rangeRate,
|
|
16
16
|
selectEphemeris
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-HVXYFUCB.js";
|
|
17
|
+
} from "./chunk-OMVL3X7V.js";
|
|
19
18
|
import {
|
|
20
19
|
ecefToGeodetic,
|
|
21
20
|
geodeticToEcef
|
|
22
21
|
} from "./chunk-37QNKGTC.js";
|
|
23
22
|
import "./chunk-6FAL6P4G.js";
|
|
23
|
+
import "./chunk-HVXYFUCB.js";
|
|
24
24
|
import "./chunk-LEEU5OIO.js";
|
|
25
25
|
import "./chunk-FIEWO4J4.js";
|
|
26
26
|
export {
|
package/dist/positioning.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
klobucharDelay,
|
|
4
4
|
satClockCorrection,
|
|
5
5
|
solveSpp
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-HVXYFUCB.js";
|
|
6
|
+
} from "./chunk-QXZZNXE3.js";
|
|
7
|
+
import "./chunk-OMVL3X7V.js";
|
|
9
8
|
import "./chunk-37QNKGTC.js";
|
|
10
9
|
import "./chunk-6FAL6P4G.js";
|
|
10
|
+
import "./chunk-HVXYFUCB.js";
|
|
11
11
|
import "./chunk-LEEU5OIO.js";
|
|
12
12
|
import "./chunk-FIEWO4J4.js";
|
|
13
13
|
export {
|
package/dist/rtcm3.cjs
CHANGED
|
@@ -587,6 +587,96 @@ function decodeEphemeris(frame) {
|
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
|
|
590
|
+
// src/constants/time.ts
|
|
591
|
+
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
592
|
+
var MILLISECONDS_IN_SECOND = 1e3;
|
|
593
|
+
var MILLISECONDS_GPS_TAI = 19e3;
|
|
594
|
+
var START_GPS_TIME = /* @__PURE__ */ new Date("1980-01-06T00:00:00Z");
|
|
595
|
+
var START_BDS_TIME = /* @__PURE__ */ new Date("2006-01-01T00:00:14Z");
|
|
596
|
+
var START_NTP_TIME = /* @__PURE__ */ new Date("1900-01-01T00:00:00Z");
|
|
597
|
+
|
|
598
|
+
// src/time/gnss.ts
|
|
599
|
+
function getTaiDate(date) {
|
|
600
|
+
return new Date(date.getTime() + MILLISECONDS_GPS_TAI);
|
|
601
|
+
}
|
|
602
|
+
function getNtpTime(date) {
|
|
603
|
+
return getTaiDate(date).getTime() - START_NTP_TIME.getTime();
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// src/time/utc.ts
|
|
607
|
+
var LEAP_SECONDS_TABLE = [
|
|
608
|
+
[3692217600, 37],
|
|
609
|
+
// 1 Jan 2017
|
|
610
|
+
[3644697600, 36],
|
|
611
|
+
// 1 Jul 2015
|
|
612
|
+
[3550089600, 35],
|
|
613
|
+
// 1 Jul 2012
|
|
614
|
+
[3439756800, 34],
|
|
615
|
+
// 1 Jan 2009
|
|
616
|
+
[3345062400, 33],
|
|
617
|
+
// 1 Jan 2006
|
|
618
|
+
[3124137600, 32],
|
|
619
|
+
// 1 Jan 1999
|
|
620
|
+
[3076704e3, 31],
|
|
621
|
+
// 1 Jul 1997
|
|
622
|
+
[3029443200, 30],
|
|
623
|
+
// 1 Jan 1996
|
|
624
|
+
[2982009600, 29],
|
|
625
|
+
// 1 Jul 1994
|
|
626
|
+
[2950473600, 28],
|
|
627
|
+
// 1 Jul 1993
|
|
628
|
+
[2918937600, 27],
|
|
629
|
+
// 1 Jul 1992
|
|
630
|
+
[2871676800, 26],
|
|
631
|
+
// 1 Jan 1991
|
|
632
|
+
[2840140800, 25],
|
|
633
|
+
// 1 Jan 1990
|
|
634
|
+
[2776982400, 24],
|
|
635
|
+
// 1 Jan 1988
|
|
636
|
+
[2698012800, 23],
|
|
637
|
+
// 1 Jul 1985
|
|
638
|
+
[2634854400, 22],
|
|
639
|
+
// 1 Jul 1983
|
|
640
|
+
[2603318400, 21],
|
|
641
|
+
// 1 Jul 1982
|
|
642
|
+
[2571782400, 20],
|
|
643
|
+
// 1 Jul 1981
|
|
644
|
+
[2524521600, 19],
|
|
645
|
+
// 1 Jan 1980
|
|
646
|
+
[2492985600, 18],
|
|
647
|
+
// 1 Jan 1979
|
|
648
|
+
[2461449600, 17],
|
|
649
|
+
// 1 Jan 1978
|
|
650
|
+
[2429913600, 16],
|
|
651
|
+
// 1 Jan 1977
|
|
652
|
+
[2398291200, 15],
|
|
653
|
+
// 1 Jan 1976
|
|
654
|
+
[2366755200, 14],
|
|
655
|
+
// 1 Jan 1975
|
|
656
|
+
[2335219200, 13],
|
|
657
|
+
// 1 Jan 1974
|
|
658
|
+
[2303683200, 12],
|
|
659
|
+
// 1 Jan 1973
|
|
660
|
+
[2287785600, 11],
|
|
661
|
+
// 1 Jul 1972
|
|
662
|
+
[2272060800, 10]
|
|
663
|
+
// 1 Jan 1972
|
|
664
|
+
];
|
|
665
|
+
function getLeap(date) {
|
|
666
|
+
const ntp_time = getNtpTime(date);
|
|
667
|
+
for (const [timestamp, leapSeconds] of LEAP_SECONDS_TABLE) {
|
|
668
|
+
if (ntp_time / MILLISECONDS_IN_SECOND - leapSeconds >= timestamp) {
|
|
669
|
+
return leapSeconds;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return 8;
|
|
673
|
+
}
|
|
674
|
+
function getGpsLeap(date) {
|
|
675
|
+
const leap_seconds = getLeap(date);
|
|
676
|
+
if (leap_seconds < 0) return 0;
|
|
677
|
+
return leap_seconds - 19;
|
|
678
|
+
}
|
|
679
|
+
|
|
590
680
|
// src/constants/gnss.ts
|
|
591
681
|
var C_LIGHT = 299792458;
|
|
592
682
|
var FREQ = {
|
|
@@ -616,11 +706,6 @@ var GLO_F1_STEP = 562500;
|
|
|
616
706
|
var GLO_F2_BASE = 1246e6;
|
|
617
707
|
var GLO_F2_STEP = 437500;
|
|
618
708
|
|
|
619
|
-
// src/constants/time.ts
|
|
620
|
-
var MILLISECONDS_IN_WEEK = 6048e5;
|
|
621
|
-
var START_GPS_TIME = /* @__PURE__ */ new Date("1980-01-06T00:00:00Z");
|
|
622
|
-
var START_BDS_TIME = /* @__PURE__ */ new Date("2006-01-01T00:00:14Z");
|
|
623
|
-
|
|
624
709
|
// src/rtcm3/msm.ts
|
|
625
710
|
var GPS_L1 = FREQ.G["1"];
|
|
626
711
|
var GPS_L2 = FREQ.G["2"];
|
|
@@ -1130,7 +1215,7 @@ function msmEpochToDate(sys, epochMs, refTime = /* @__PURE__ */ new Date()) {
|
|
|
1130
1215
|
let t2 = refMs - refMs % dayMs + diff * dayMs + msOfDay - 3 * 36e5;
|
|
1131
1216
|
while (t2 - refMs > 3 * dayMs) t2 -= 7 * dayMs;
|
|
1132
1217
|
while (refMs - t2 > 3 * dayMs) t2 += 7 * dayMs;
|
|
1133
|
-
return new Date(t2);
|
|
1218
|
+
return new Date(t2 + getGpsLeap(new Date(t2)) * 1e3);
|
|
1134
1219
|
}
|
|
1135
1220
|
if (sys === "C") {
|
|
1136
1221
|
const BDS_EPOCH = START_BDS_TIME.getTime();
|
|
@@ -1138,14 +1223,12 @@ function msmEpochToDate(sys, epochMs, refTime = /* @__PURE__ */ new Date()) {
|
|
|
1138
1223
|
let t2 = BDS_EPOCH + weeksSinceEpoch2 * MS_PER_WEEK + epochMs;
|
|
1139
1224
|
if (t2 - refMs > MS_PER_WEEK / 2) t2 -= MS_PER_WEEK;
|
|
1140
1225
|
else if (refMs - t2 > MS_PER_WEEK / 2) t2 += MS_PER_WEEK;
|
|
1141
|
-
t2 -= 18e3;
|
|
1142
1226
|
return new Date(t2);
|
|
1143
1227
|
}
|
|
1144
1228
|
const weeksSinceEpoch = Math.floor((refMs - GPS_EPOCH) / MS_PER_WEEK);
|
|
1145
1229
|
let t = GPS_EPOCH + weeksSinceEpoch * MS_PER_WEEK + epochMs;
|
|
1146
1230
|
if (t - refMs > MS_PER_WEEK / 2) t -= MS_PER_WEEK;
|
|
1147
1231
|
else if (refMs - t > MS_PER_WEEK / 2) t += MS_PER_WEEK;
|
|
1148
|
-
t -= 18e3;
|
|
1149
1232
|
return new Date(t);
|
|
1150
1233
|
}
|
|
1151
1234
|
function setGloFreqNumber(slot, k) {
|
package/dist/rtcm3.d.cts
CHANGED
|
@@ -62,6 +62,14 @@ declare function decodeMsmFull(frame: Rtcm3Frame): MsmEpoch | null;
|
|
|
62
62
|
*
|
|
63
63
|
* Requires an approximate reference time to resolve the current week.
|
|
64
64
|
*/
|
|
65
|
+
/**
|
|
66
|
+
* NOTE: returns a GPS-scale Date — the clock-face convention used by
|
|
67
|
+
* the RINEX parser and every consumer of epoch milliseconds in this
|
|
68
|
+
* library (satellite propagation, SPP, RINEX epoch tags). It is NOT
|
|
69
|
+
* UTC: converting to UTC here put every downstream satellite position
|
|
70
|
+
* 18 s (the current leap-second count) off — a ±14 km per-satellite
|
|
71
|
+
* range error that scattered live SPP solutions by kilometres.
|
|
72
|
+
*/
|
|
65
73
|
declare function msmEpochToDate(sys: string, epochMs: number, refTime?: Date): Date;
|
|
66
74
|
/**
|
|
67
75
|
* Set a GLONASS FDMA frequency number (k = -7..+13) for a slot (1-24),
|
package/dist/rtcm3.d.ts
CHANGED
|
@@ -62,6 +62,14 @@ declare function decodeMsmFull(frame: Rtcm3Frame): MsmEpoch | null;
|
|
|
62
62
|
*
|
|
63
63
|
* Requires an approximate reference time to resolve the current week.
|
|
64
64
|
*/
|
|
65
|
+
/**
|
|
66
|
+
* NOTE: returns a GPS-scale Date — the clock-face convention used by
|
|
67
|
+
* the RINEX parser and every consumer of epoch milliseconds in this
|
|
68
|
+
* library (satellite propagation, SPP, RINEX epoch tags). It is NOT
|
|
69
|
+
* UTC: converting to UTC here put every downstream satellite position
|
|
70
|
+
* 18 s (the current leap-second count) off — a ±14 km per-satellite
|
|
71
|
+
* range error that scattered live SPP solutions by kilometres.
|
|
72
|
+
*/
|
|
65
73
|
declare function msmEpochToDate(sys: string, epochMs: number, refTime?: Date): Date;
|
|
66
74
|
/**
|
|
67
75
|
* Set a GLONASS FDMA frequency number (k = -7..+13) for a slot (1-24),
|
package/dist/rtcm3.js
CHANGED