gnss-js 1.52.0 → 1.54.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-ZS5RLFWI.js → chunk-KUTNIP3O.js} +53 -3
- package/dist/{chunk-DEVUKH6A.js → chunk-MRC6LIPM.js} +54 -2
- package/dist/{chunk-DE5IUULR.js → chunk-ZPNMIUNZ.js} +57 -4
- package/dist/index.cjs +192 -34
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +9 -3
- package/dist/novatel.cjs +54 -3
- package/dist/novatel.d.cts +9 -1
- package/dist/novatel.d.ts +9 -1
- package/dist/novatel.js +3 -1
- package/dist/receiver-pvt-CVFvi4kT.d.cts +29 -0
- package/dist/receiver-pvt-CVFvi4kT.d.ts +29 -0
- package/dist/sbf.cjs +70 -16
- package/dist/sbf.d.cts +14 -1
- package/dist/sbf.d.ts +14 -1
- package/dist/sbf.js +3 -1
- package/dist/ubx.cjs +55 -2
- package/dist/ubx.d.cts +9 -1
- package/dist/ubx.d.ts +9 -1
- package/dist/ubx.js +3 -1
- package/package.json +1 -1
package/dist/novatel.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.cjs';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* NovAtel OEM4/6/7 binary framing shared by the measurement and
|
|
@@ -113,6 +114,13 @@ declare function parseNovatelNav(data: Uint8Array, opts?: {
|
|
|
113
114
|
onSbasMessage?: (msg: Uint8Array, prn: number, week: number, tow: number) => void;
|
|
114
115
|
}): NovatelNavResult;
|
|
115
116
|
|
|
117
|
+
interface NovatelPvtResult {
|
|
118
|
+
records: ReceiverPvt[];
|
|
119
|
+
messages: number;
|
|
120
|
+
}
|
|
121
|
+
/** Decode every BESTPOS (binary) message in a NovAtel OEM4/7 byte stream. */
|
|
122
|
+
declare function parseNovatelPvt(data: Uint8Array): NovatelPvtResult;
|
|
123
|
+
|
|
116
124
|
/**
|
|
117
125
|
* NovAtel OEM4/6/7 raw-measurement decoding (RANGE log, message 43).
|
|
118
126
|
*
|
|
@@ -170,4 +178,4 @@ interface NovatelParseResult {
|
|
|
170
178
|
*/
|
|
171
179
|
declare function parseNovatelRange(data: Uint8Array): NovatelParseResult;
|
|
172
180
|
|
|
173
|
-
export { type NovatelEpoch, type NovatelMeasurement, type NovatelNavResult, type NovatelParseResult, OEM4_HLEN, type Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange };
|
|
181
|
+
export { type NovatelEpoch, type NovatelMeasurement, type NovatelNavResult, type NovatelParseResult, type NovatelPvtResult, OEM4_HLEN, type Oem4Frame, ReceiverPvt, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange };
|
package/dist/novatel.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.js';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* NovAtel OEM4/6/7 binary framing shared by the measurement and
|
|
@@ -113,6 +114,13 @@ declare function parseNovatelNav(data: Uint8Array, opts?: {
|
|
|
113
114
|
onSbasMessage?: (msg: Uint8Array, prn: number, week: number, tow: number) => void;
|
|
114
115
|
}): NovatelNavResult;
|
|
115
116
|
|
|
117
|
+
interface NovatelPvtResult {
|
|
118
|
+
records: ReceiverPvt[];
|
|
119
|
+
messages: number;
|
|
120
|
+
}
|
|
121
|
+
/** Decode every BESTPOS (binary) message in a NovAtel OEM4/7 byte stream. */
|
|
122
|
+
declare function parseNovatelPvt(data: Uint8Array): NovatelPvtResult;
|
|
123
|
+
|
|
116
124
|
/**
|
|
117
125
|
* NovAtel OEM4/6/7 raw-measurement decoding (RANGE log, message 43).
|
|
118
126
|
*
|
|
@@ -170,4 +178,4 @@ interface NovatelParseResult {
|
|
|
170
178
|
*/
|
|
171
179
|
declare function parseNovatelRange(data: Uint8Array): NovatelParseResult;
|
|
172
180
|
|
|
173
|
-
export { type NovatelEpoch, type NovatelMeasurement, type NovatelNavResult, type NovatelParseResult, OEM4_HLEN, type Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange };
|
|
181
|
+
export { type NovatelEpoch, type NovatelMeasurement, type NovatelNavResult, type NovatelParseResult, type NovatelPvtResult, OEM4_HLEN, type Oem4Frame, ReceiverPvt, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange };
|
package/dist/novatel.js
CHANGED
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
crc32,
|
|
4
4
|
oem4Frames,
|
|
5
5
|
parseNovatelNav,
|
|
6
|
+
parseNovatelPvt,
|
|
6
7
|
parseNovatelRange
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KUTNIP3O.js";
|
|
8
9
|
import "./chunk-WQX354KD.js";
|
|
9
10
|
import "./chunk-YUW33VXK.js";
|
|
10
11
|
import "./chunk-V2D5KUKH.js";
|
|
@@ -15,5 +16,6 @@ export {
|
|
|
15
16
|
crc32,
|
|
16
17
|
oem4Frames,
|
|
17
18
|
parseNovatelNav,
|
|
19
|
+
parseNovatelPvt,
|
|
18
20
|
parseNovatelRange
|
|
19
21
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A receiver's own navigation solution (position/velocity/time), normalised
|
|
3
|
+
* across manufacturers: Septentrio PVTGeodetic, NovAtel BESTPOS, u-blox
|
|
4
|
+
* NAV-PVT. Useful as a truth/reference to cross-check an independent SPP/SBAS
|
|
5
|
+
* solution against (position + accuracy), and to know the receiver's own
|
|
6
|
+
* solution mode.
|
|
7
|
+
*/
|
|
8
|
+
interface ReceiverPvt {
|
|
9
|
+
/** GPS-scale epoch time (ms). */
|
|
10
|
+
timeMs: number;
|
|
11
|
+
week: number;
|
|
12
|
+
/** Time of week (s). */
|
|
13
|
+
tow: number;
|
|
14
|
+
/** Solution mode: 'standalone' | 'differential' | 'sbas-aided' |
|
|
15
|
+
* 'rtk-float' | 'rtk-fixed' | 'ppp' | 'no-pvt' | 'fixed-location' | … */
|
|
16
|
+
mode: string;
|
|
17
|
+
latDeg: number | null;
|
|
18
|
+
lonDeg: number | null;
|
|
19
|
+
/** Ellipsoidal height (m). */
|
|
20
|
+
heightM: number | null;
|
|
21
|
+
/** Satellites used in the receiver's solution. */
|
|
22
|
+
nrSV: number | null;
|
|
23
|
+
/** Receiver horizontal accuracy estimate (m). */
|
|
24
|
+
hAccuracyM: number | null;
|
|
25
|
+
/** Receiver vertical accuracy estimate (m). */
|
|
26
|
+
vAccuracyM: number | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type { ReceiverPvt as R };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A receiver's own navigation solution (position/velocity/time), normalised
|
|
3
|
+
* across manufacturers: Septentrio PVTGeodetic, NovAtel BESTPOS, u-blox
|
|
4
|
+
* NAV-PVT. Useful as a truth/reference to cross-check an independent SPP/SBAS
|
|
5
|
+
* solution against (position + accuracy), and to know the receiver's own
|
|
6
|
+
* solution mode.
|
|
7
|
+
*/
|
|
8
|
+
interface ReceiverPvt {
|
|
9
|
+
/** GPS-scale epoch time (ms). */
|
|
10
|
+
timeMs: number;
|
|
11
|
+
week: number;
|
|
12
|
+
/** Time of week (s). */
|
|
13
|
+
tow: number;
|
|
14
|
+
/** Solution mode: 'standalone' | 'differential' | 'sbas-aided' |
|
|
15
|
+
* 'rtk-float' | 'rtk-fixed' | 'ppp' | 'no-pvt' | 'fixed-location' | … */
|
|
16
|
+
mode: string;
|
|
17
|
+
latDeg: number | null;
|
|
18
|
+
lonDeg: number | null;
|
|
19
|
+
/** Ellipsoidal height (m). */
|
|
20
|
+
heightM: number | null;
|
|
21
|
+
/** Satellites used in the receiver's solution. */
|
|
22
|
+
nrSV: number | null;
|
|
23
|
+
/** Receiver horizontal accuracy estimate (m). */
|
|
24
|
+
hAccuracyM: number | null;
|
|
25
|
+
/** Receiver vertical accuracy estimate (m). */
|
|
26
|
+
vAccuracyM: number | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type { ReceiverPvt as R };
|
package/dist/sbf.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(sbf_exports, {
|
|
|
33
33
|
parseSbfIonoUtc: () => parseSbfIonoUtc,
|
|
34
34
|
parseSbfMeas: () => parseSbfMeas,
|
|
35
35
|
parseSbfNav: () => parseSbfNav,
|
|
36
|
+
parseSbfPvt: () => parseSbfPvt,
|
|
36
37
|
parseSbfReceiverSetup: () => parseSbfReceiverSetup,
|
|
37
38
|
sbfCrc16: () => crc16,
|
|
38
39
|
scanSbfFrames: () => scanSbfFrames
|
|
@@ -601,9 +602,61 @@ function parseSbfReceiverSetup(data) {
|
|
|
601
602
|
return out;
|
|
602
603
|
}
|
|
603
604
|
|
|
605
|
+
// src/sbf/pvt.ts
|
|
606
|
+
var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
|
|
607
|
+
var RAD2DEG = 180 / Math.PI;
|
|
608
|
+
var DNU_F8 = -2e10;
|
|
609
|
+
var MODE_LABELS = {
|
|
610
|
+
0: "no-pvt",
|
|
611
|
+
1: "standalone",
|
|
612
|
+
2: "differential",
|
|
613
|
+
3: "fixed-location",
|
|
614
|
+
4: "rtk-fixed",
|
|
615
|
+
5: "rtk-float",
|
|
616
|
+
6: "sbas-aided",
|
|
617
|
+
7: "moving-base-rtk-fixed",
|
|
618
|
+
8: "moving-base-rtk-float",
|
|
619
|
+
10: "ppp"
|
|
620
|
+
};
|
|
621
|
+
function parseSbfPvt(data) {
|
|
622
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
623
|
+
const records = [];
|
|
624
|
+
let messages = 0;
|
|
625
|
+
scanSbfFrames(data, view, (id, b, len) => {
|
|
626
|
+
if (id !== 4007 || len < 96) return;
|
|
627
|
+
messages++;
|
|
628
|
+
const tow = view.getUint32(b + 8, true);
|
|
629
|
+
const wnc = view.getUint16(b + 12, true);
|
|
630
|
+
if (tow === 4294967295 || wnc === 65535) return;
|
|
631
|
+
const modeByte = view.getUint8(b + 14);
|
|
632
|
+
const modeType = modeByte & 15;
|
|
633
|
+
const lat = view.getFloat64(b + 16, true);
|
|
634
|
+
const lon = view.getFloat64(b + 24, true);
|
|
635
|
+
const hgt = view.getFloat64(b + 32, true);
|
|
636
|
+
const nrSV = view.getUint8(b + 74);
|
|
637
|
+
const hAcc = view.getUint16(b + 90, true);
|
|
638
|
+
const vAcc = view.getUint16(b + 92, true);
|
|
639
|
+
const hasFix = lat > DNU_F8 && lon > DNU_F8 && hgt > DNU_F8;
|
|
640
|
+
records.push({
|
|
641
|
+
timeMs: GPS_EPOCH_MS2 + wnc * 6048e5 + tow,
|
|
642
|
+
week: wnc,
|
|
643
|
+
tow: tow / 1e3,
|
|
644
|
+
modeType,
|
|
645
|
+
mode: MODE_LABELS[modeType] ?? `mode-${modeType}`,
|
|
646
|
+
latDeg: hasFix ? lat * RAD2DEG : null,
|
|
647
|
+
lonDeg: hasFix ? lon * RAD2DEG : null,
|
|
648
|
+
heightM: hasFix ? hgt : null,
|
|
649
|
+
nrSV: nrSV === 255 ? null : nrSV,
|
|
650
|
+
hAccuracyM: hAcc === 65535 ? null : hAcc / 100,
|
|
651
|
+
vAccuracyM: vAcc === 65535 ? null : vAcc / 100
|
|
652
|
+
});
|
|
653
|
+
});
|
|
654
|
+
return { records, messages };
|
|
655
|
+
}
|
|
656
|
+
|
|
604
657
|
// src/navbits/index.ts
|
|
605
658
|
var GPS_PI = 3.1415926535898;
|
|
606
|
-
var
|
|
659
|
+
var GPS_EPOCH_MS3 = Date.UTC(1980, 0, 6);
|
|
607
660
|
var SEC_PER_WEEK2 = 7 * 86400;
|
|
608
661
|
function getBitU(buff, pos, len) {
|
|
609
662
|
let bits = 0;
|
|
@@ -733,13 +786,13 @@ function decodeGpsLnavFrame(subframes, opts = {}) {
|
|
|
733
786
|
const iodc = iodc0 * 256 + iodc1;
|
|
734
787
|
if (id1 !== 1 || id2 !== 2 || id3 !== 3) return null;
|
|
735
788
|
if (iode3 !== iode || iode !== (iodc & 255)) return null;
|
|
736
|
-
const ref = opts.refWeek ?? Math.floor((Date.now() -
|
|
789
|
+
const ref = opts.refWeek ?? Math.floor((Date.now() - GPS_EPOCH_MS3) / 1e3 / SEC_PER_WEEK2);
|
|
737
790
|
let week = week10 + 1024 * Math.round((ref - week10) / 1024);
|
|
738
791
|
if (toes < tow1 - 302400) week++;
|
|
739
792
|
else if (toes > tow1 + 302400) week--;
|
|
740
793
|
const prn = opts.prn ?? "G00";
|
|
741
794
|
const tocDate = new Date(
|
|
742
|
-
|
|
795
|
+
GPS_EPOCH_MS3 + (week * SEC_PER_WEEK2 + tocSec) * 1e3
|
|
743
796
|
);
|
|
744
797
|
return {
|
|
745
798
|
system: prn[0] === "J" ? "J" : "G",
|
|
@@ -812,7 +865,7 @@ function parseSbfGpsNav(data) {
|
|
|
812
865
|
}
|
|
813
866
|
|
|
814
867
|
// src/navbits/cnav.ts
|
|
815
|
-
var
|
|
868
|
+
var GPS_EPOCH_MS4 = Date.UTC(1980, 0, 6);
|
|
816
869
|
var SEC_PER_WEEK3 = 7 * 86400;
|
|
817
870
|
var HALF_WEEK = 302400;
|
|
818
871
|
var CNAV_PREAMBLE = 139;
|
|
@@ -917,7 +970,7 @@ function resolveWeek(week, towSec, sec) {
|
|
|
917
970
|
return week;
|
|
918
971
|
}
|
|
919
972
|
function gpsDate(week, sec) {
|
|
920
|
-
return new Date(
|
|
973
|
+
return new Date(GPS_EPOCH_MS4 + (week * SEC_PER_WEEK3 + sec) * 1e3);
|
|
921
974
|
}
|
|
922
975
|
var CnavAssembler = class {
|
|
923
976
|
sats = /* @__PURE__ */ new Map();
|
|
@@ -1047,7 +1100,7 @@ function parseSbfCnav(data) {
|
|
|
1047
1100
|
}
|
|
1048
1101
|
|
|
1049
1102
|
// src/navbits/gal.ts
|
|
1050
|
-
var
|
|
1103
|
+
var GPS_EPOCH_MS5 = Date.UTC(1980, 0, 6);
|
|
1051
1104
|
var SEC_PER_WEEK4 = 7 * 86400;
|
|
1052
1105
|
var HALF_WEEK2 = 302400;
|
|
1053
1106
|
var GST_GPS_WEEK_OFFSET = 1024;
|
|
@@ -1060,7 +1113,7 @@ function galFnavPageCrcOk(page) {
|
|
|
1060
1113
|
return crc24q(page, 214) === getBitU(page, 214, 24);
|
|
1061
1114
|
}
|
|
1062
1115
|
function gpsDate2(week, sec) {
|
|
1063
|
-
return new Date(
|
|
1116
|
+
return new Date(GPS_EPOCH_MS5 + (week * SEC_PER_WEEK4 + sec) * 1e3);
|
|
1064
1117
|
}
|
|
1065
1118
|
function weekOfToe(week, tow, toe) {
|
|
1066
1119
|
if (toe - tow > HALF_WEEK2) return week - 1;
|
|
@@ -1691,7 +1744,7 @@ var BdsAssembler = class {
|
|
|
1691
1744
|
};
|
|
1692
1745
|
|
|
1693
1746
|
// src/navbits/glo.ts
|
|
1694
|
-
var
|
|
1747
|
+
var GPS_EPOCH_MS6 = Date.UTC(1980, 0, 6);
|
|
1695
1748
|
var SEC_PER_WEEK6 = 7 * 86400;
|
|
1696
1749
|
var SEC_PER_DAY = 86400;
|
|
1697
1750
|
var GLO_STRING_BYTES = 10;
|
|
@@ -1785,7 +1838,7 @@ function decodeGloStrings(strings, refDate, opts = {}) {
|
|
|
1785
1838
|
const slot = getBitU(b, i, 5);
|
|
1786
1839
|
if (frn1 !== 1 || frn2 !== 2 || frn3 !== 3 || frn4 !== 4) return null;
|
|
1787
1840
|
if (slot < 1 || slot > 27) return null;
|
|
1788
|
-
const utcSec = (getUtcDate(refDate).getTime() -
|
|
1841
|
+
const utcSec = (getUtcDate(refDate).getTime() - GPS_EPOCH_MS6) / 1e3;
|
|
1789
1842
|
const week = Math.floor(utcSec / SEC_PER_WEEK6);
|
|
1790
1843
|
let tow = utcSec - week * SEC_PER_WEEK6;
|
|
1791
1844
|
const tod = tow % SEC_PER_DAY;
|
|
@@ -1800,7 +1853,7 @@ function decodeGloStrings(strings, refDate, opts = {}) {
|
|
|
1800
1853
|
system: "R",
|
|
1801
1854
|
prn: `R${String(slot).padStart(2, "0")}`,
|
|
1802
1855
|
// RINEX GLONASS epochs are UTC: build the UTC toe Date directly.
|
|
1803
|
-
tocDate: new Date(
|
|
1856
|
+
tocDate: new Date(GPS_EPOCH_MS6 + (week * SEC_PER_WEEK6 + tow + toe) * 1e3),
|
|
1804
1857
|
tauN: -tauN,
|
|
1805
1858
|
// RINEX stores −τn; the SIS carries τn (ICD sign)
|
|
1806
1859
|
gammaN,
|
|
@@ -1854,7 +1907,7 @@ var GloStringAssembler = class {
|
|
|
1854
1907
|
};
|
|
1855
1908
|
|
|
1856
1909
|
// src/sbf/rawnav-bds.ts
|
|
1857
|
-
var
|
|
1910
|
+
var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
|
|
1858
1911
|
var MS_PER_WEEK3 = 7 * 86400 * 1e3;
|
|
1859
1912
|
var TOW_DNU = 4294967295;
|
|
1860
1913
|
var WNC_DNU2 = 65535;
|
|
@@ -1915,7 +1968,7 @@ function feedGloBlock(view, b, assembler) {
|
|
|
1915
1968
|
const eph = assembler.push(
|
|
1916
1969
|
prn,
|
|
1917
1970
|
str2,
|
|
1918
|
-
new Date(
|
|
1971
|
+
new Date(GPS_EPOCH_MS7 + wnc * MS_PER_WEEK3 + towMs),
|
|
1919
1972
|
view.getUint8(b + 18) - 8
|
|
1920
1973
|
// FreqNr, offset by 8
|
|
1921
1974
|
);
|
|
@@ -1938,7 +1991,7 @@ function parseSbfGloNav(data) {
|
|
|
1938
1991
|
}
|
|
1939
1992
|
|
|
1940
1993
|
// src/navbits/sbas.ts
|
|
1941
|
-
var
|
|
1994
|
+
var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
|
|
1942
1995
|
var MS_PER_WEEK4 = 7 * 86400 * 1e3;
|
|
1943
1996
|
var two3 = (n) => String(n).padStart(2, "0");
|
|
1944
1997
|
var SBAS_MT_GEO_NAV = 9;
|
|
@@ -1960,7 +2013,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
|
|
|
1960
2013
|
return {
|
|
1961
2014
|
system: "S",
|
|
1962
2015
|
prn: `S${two3(prn - 100)}`,
|
|
1963
|
-
tocDate: new Date(
|
|
2016
|
+
tocDate: new Date(GPS_EPOCH_MS8 + week * MS_PER_WEEK4 + t0Sec * 1e3),
|
|
1964
2017
|
tauN: getBitS(msg, 206, 12) * 2 ** -31,
|
|
1965
2018
|
// a_Gf0, clock offset (s)
|
|
1966
2019
|
gammaN: getBitS(msg, 218, 8) * 2 ** -39 / 2,
|
|
@@ -2708,7 +2761,7 @@ function parseSbfHas(data) {
|
|
|
2708
2761
|
|
|
2709
2762
|
// src/sbf/index.ts
|
|
2710
2763
|
var CLIGHT = 299792458;
|
|
2711
|
-
var
|
|
2764
|
+
var GPS_EPOCH_MS9 = Date.UTC(1980, 0, 6);
|
|
2712
2765
|
var MS_PER_WEEK5 = 7 * 864e5;
|
|
2713
2766
|
var M3_SYS = ["G", "R", "E", "C", "S", "J", "I"];
|
|
2714
2767
|
var M3_PR_BASE = [19e6, 19e6, 22e6, 2e7, 34e6, 34e6, 34e6];
|
|
@@ -3362,7 +3415,7 @@ function parseSbfMeas(data) {
|
|
|
3362
3415
|
const tow = view.getUint32(i + 8, true);
|
|
3363
3416
|
const wnc = view.getUint16(i + 12, true);
|
|
3364
3417
|
if (tow !== 4294967295 && wnc !== 65535) {
|
|
3365
|
-
ensureEpoch(
|
|
3418
|
+
ensureEpoch(GPS_EPOCH_MS9 + wnc * MS_PER_WEEK5 + tow);
|
|
3366
3419
|
if (id === 4109) decodeMeas3Ranges(i, tow);
|
|
3367
3420
|
else if (id === 4110) decodeMeas3CN0(i, len);
|
|
3368
3421
|
else if (id === 4111) decodeMeas3Doppler(i, len);
|
|
@@ -3388,6 +3441,7 @@ function parseSbfMeas(data) {
|
|
|
3388
3441
|
parseSbfIonoUtc,
|
|
3389
3442
|
parseSbfMeas,
|
|
3390
3443
|
parseSbfNav,
|
|
3444
|
+
parseSbfPvt,
|
|
3391
3445
|
parseSbfReceiverSetup,
|
|
3392
3446
|
sbfCrc16,
|
|
3393
3447
|
scanSbfFrames
|
package/dist/sbf.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { S as SbfAlmanac, a as SbfAlmanacResult, b as SbfGlonassAlmanac, c as SbfKeplerAlmanac, d as SbfNavResult, p as parseSbfAlmanac, e as parseSbfNav } from './nav-BYmYoh9A.cjs';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.cjs';
|
|
2
3
|
import { K as KeplerEphemeris, C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris } from './nav-DImXUdbp.cjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -124,6 +125,18 @@ interface SbfReceiverSetup {
|
|
|
124
125
|
*/
|
|
125
126
|
declare function parseSbfReceiverSetup(data: Uint8Array): SbfReceiverSetup | null;
|
|
126
127
|
|
|
128
|
+
interface SbfPvt extends ReceiverPvt {
|
|
129
|
+
/** PVT solution type (Mode & 0x0F) — the raw Septentrio code. */
|
|
130
|
+
modeType: number;
|
|
131
|
+
}
|
|
132
|
+
interface SbfPvtResult {
|
|
133
|
+
records: SbfPvt[];
|
|
134
|
+
/** PVTGeodetic blocks seen (with valid framing). */
|
|
135
|
+
messages: number;
|
|
136
|
+
}
|
|
137
|
+
/** Decode every PVTGeodetic (4007) block in an SBF byte stream. */
|
|
138
|
+
declare function parseSbfPvt(data: Uint8Array): SbfPvtResult;
|
|
139
|
+
|
|
127
140
|
/**
|
|
128
141
|
* Septentrio SBF raw GPS / QZSS LNAV navigation-bit blocks: GPSRawCA
|
|
129
142
|
* (4017) and QZSRawL1CA (4066) each carry one 300-bit L1 C/A (LNAV)
|
|
@@ -634,4 +647,4 @@ interface SbfParseResult {
|
|
|
634
647
|
*/
|
|
635
648
|
declare function parseSbfMeas(data: Uint8Array): SbfParseResult;
|
|
636
649
|
|
|
637
|
-
export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
|
|
650
|
+
export { CnavEphemeris, type HasMessage, ReceiverPvt, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfPvt, type SbfPvtResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
|
package/dist/sbf.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { S as SbfAlmanac, a as SbfAlmanacResult, b as SbfGlonassAlmanac, c as SbfKeplerAlmanac, d as SbfNavResult, p as parseSbfAlmanac, e as parseSbfNav } from './nav-CN8rxL4h.js';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.js';
|
|
2
3
|
import { K as KeplerEphemeris, C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris } from './nav-DImXUdbp.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -124,6 +125,18 @@ interface SbfReceiverSetup {
|
|
|
124
125
|
*/
|
|
125
126
|
declare function parseSbfReceiverSetup(data: Uint8Array): SbfReceiverSetup | null;
|
|
126
127
|
|
|
128
|
+
interface SbfPvt extends ReceiverPvt {
|
|
129
|
+
/** PVT solution type (Mode & 0x0F) — the raw Septentrio code. */
|
|
130
|
+
modeType: number;
|
|
131
|
+
}
|
|
132
|
+
interface SbfPvtResult {
|
|
133
|
+
records: SbfPvt[];
|
|
134
|
+
/** PVTGeodetic blocks seen (with valid framing). */
|
|
135
|
+
messages: number;
|
|
136
|
+
}
|
|
137
|
+
/** Decode every PVTGeodetic (4007) block in an SBF byte stream. */
|
|
138
|
+
declare function parseSbfPvt(data: Uint8Array): SbfPvtResult;
|
|
139
|
+
|
|
127
140
|
/**
|
|
128
141
|
* Septentrio SBF raw GPS / QZSS LNAV navigation-bit blocks: GPSRawCA
|
|
129
142
|
* (4017) and QZSRawL1CA (4066) each carry one 300-bit L1 C/A (LNAV)
|
|
@@ -634,4 +647,4 @@ interface SbfParseResult {
|
|
|
634
647
|
*/
|
|
635
648
|
declare function parseSbfMeas(data: Uint8Array): SbfParseResult;
|
|
636
649
|
|
|
637
|
-
export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
|
|
650
|
+
export { CnavEphemeris, type HasMessage, ReceiverPvt, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfPvt, type SbfPvtResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
|
package/dist/sbf.js
CHANGED
|
@@ -13,9 +13,10 @@ import {
|
|
|
13
13
|
parseSbfIonoUtc,
|
|
14
14
|
parseSbfMeas,
|
|
15
15
|
parseSbfNav,
|
|
16
|
+
parseSbfPvt,
|
|
16
17
|
parseSbfReceiverSetup,
|
|
17
18
|
scanSbfFrames
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZPNMIUNZ.js";
|
|
19
20
|
import "./chunk-FA2UTLEQ.js";
|
|
20
21
|
import "./chunk-WQX354KD.js";
|
|
21
22
|
import "./chunk-37QNKGTC.js";
|
|
@@ -38,6 +39,7 @@ export {
|
|
|
38
39
|
parseSbfIonoUtc,
|
|
39
40
|
parseSbfMeas,
|
|
40
41
|
parseSbfNav,
|
|
42
|
+
parseSbfPvt,
|
|
41
43
|
parseSbfReceiverSetup,
|
|
42
44
|
crc16 as sbfCrc16,
|
|
43
45
|
scanSbfFrames
|
package/dist/ubx.cjs
CHANGED
|
@@ -23,6 +23,7 @@ __export(ubx_exports, {
|
|
|
23
23
|
parseUbxCnav: () => parseUbxCnav,
|
|
24
24
|
parseUbxIonoUtc: () => parseUbxIonoUtc,
|
|
25
25
|
parseUbxNav: () => parseUbxNav,
|
|
26
|
+
parseUbxPvt: () => parseUbxPvt,
|
|
26
27
|
parseUbxRawNav: () => parseUbxRawNav,
|
|
27
28
|
parseUbxRawx: () => parseUbxRawx,
|
|
28
29
|
ubxFrames: () => ubxFrames
|
|
@@ -1423,8 +1424,59 @@ function parseUbxRawNav(data, opts = {}) {
|
|
|
1423
1424
|
return { ephemerides, counts, badParity };
|
|
1424
1425
|
}
|
|
1425
1426
|
|
|
1426
|
-
// src/ubx/
|
|
1427
|
+
// src/ubx/pvt.ts
|
|
1427
1428
|
var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
|
|
1429
|
+
function parseUbxPvt(data) {
|
|
1430
|
+
const records = [];
|
|
1431
|
+
let messages = 0;
|
|
1432
|
+
for (const f of ubxFrames(data)) {
|
|
1433
|
+
if (f.msgClass !== 1 || f.msgId !== 7 || f.payload.length < 92)
|
|
1434
|
+
continue;
|
|
1435
|
+
messages++;
|
|
1436
|
+
const v = new DataView(
|
|
1437
|
+
f.payload.buffer,
|
|
1438
|
+
f.payload.byteOffset,
|
|
1439
|
+
f.payload.byteLength
|
|
1440
|
+
);
|
|
1441
|
+
const iTow = v.getUint32(0, true);
|
|
1442
|
+
const year = v.getUint16(4, true);
|
|
1443
|
+
const month = v.getUint8(6);
|
|
1444
|
+
const day = v.getUint8(7);
|
|
1445
|
+
const hour = v.getUint8(8);
|
|
1446
|
+
const min = v.getUint8(9);
|
|
1447
|
+
const sec = v.getUint8(10);
|
|
1448
|
+
const fixType = v.getUint8(20);
|
|
1449
|
+
const flags = v.getUint8(21);
|
|
1450
|
+
const numSV = v.getUint8(23);
|
|
1451
|
+
const lon = v.getInt32(24, true) * 1e-7;
|
|
1452
|
+
const lat = v.getInt32(28, true) * 1e-7;
|
|
1453
|
+
const height = v.getInt32(32, true) / 1e3;
|
|
1454
|
+
const hAcc = v.getUint32(40, true) / 1e3;
|
|
1455
|
+
const vAcc = v.getUint32(44, true) / 1e3;
|
|
1456
|
+
const carrSoln = flags >> 6 & 3;
|
|
1457
|
+
const diffSoln = flags >> 1 & 1;
|
|
1458
|
+
const mode = carrSoln === 2 ? "rtk-fixed" : carrSoln === 1 ? "rtk-float" : diffSoln ? "differential" : fixType >= 2 ? "standalone" : "no-pvt";
|
|
1459
|
+
const hasFix = fixType >= 2;
|
|
1460
|
+
const timeMs = year > 1980 ? Date.UTC(year, month - 1, day, hour, min, sec) : GPS_EPOCH_MS7 + iTow;
|
|
1461
|
+
const week = Math.floor((timeMs - GPS_EPOCH_MS7) / 1e3 / 604800);
|
|
1462
|
+
records.push({
|
|
1463
|
+
timeMs,
|
|
1464
|
+
week,
|
|
1465
|
+
tow: iTow / 1e3,
|
|
1466
|
+
mode,
|
|
1467
|
+
latDeg: hasFix ? lat : null,
|
|
1468
|
+
lonDeg: hasFix ? lon : null,
|
|
1469
|
+
heightM: hasFix ? height : null,
|
|
1470
|
+
nrSV: numSV,
|
|
1471
|
+
hAccuracyM: hasFix ? hAcc : null,
|
|
1472
|
+
vAccuracyM: hasFix ? vAcc : null
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
return { records, messages };
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
// src/ubx/index.ts
|
|
1479
|
+
var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
|
|
1428
1480
|
var MS_PER_WEEK3 = 7 * 864e5;
|
|
1429
1481
|
var SIGNALS = {
|
|
1430
1482
|
0: { 0: ["G", "1C"], 3: ["G", "2X"], 4: ["G", "2X"] },
|
|
@@ -1507,7 +1559,7 @@ function parseUbxRawx(data) {
|
|
|
1507
1559
|
if (!codes.includes(sig[1])) codes.push(sig[1]);
|
|
1508
1560
|
}
|
|
1509
1561
|
epochs.push({
|
|
1510
|
-
timeMs:
|
|
1562
|
+
timeMs: GPS_EPOCH_MS8 + week * MS_PER_WEEK3 + Math.round(rcvTow * 1e3),
|
|
1511
1563
|
leapS: leapValid ? leapS : null,
|
|
1512
1564
|
meas
|
|
1513
1565
|
});
|
|
@@ -1520,6 +1572,7 @@ function parseUbxRawx(data) {
|
|
|
1520
1572
|
parseUbxCnav,
|
|
1521
1573
|
parseUbxIonoUtc,
|
|
1522
1574
|
parseUbxNav,
|
|
1575
|
+
parseUbxPvt,
|
|
1523
1576
|
parseUbxRawNav,
|
|
1524
1577
|
parseUbxRawx,
|
|
1525
1578
|
ubxFrames
|
package/dist/ubx.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.cjs';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-blox UBX framing shared by the measurement and navigation decoders:
|
|
@@ -267,6 +268,13 @@ interface UbxRawNavResult {
|
|
|
267
268
|
*/
|
|
268
269
|
declare function parseUbxRawNav(data: Uint8Array, opts?: UbxRawNavOptions): UbxRawNavResult;
|
|
269
270
|
|
|
271
|
+
interface UbxPvtResult {
|
|
272
|
+
records: ReceiverPvt[];
|
|
273
|
+
messages: number;
|
|
274
|
+
}
|
|
275
|
+
/** Decode every UBX-NAV-PVT message in a u-blox byte stream. */
|
|
276
|
+
declare function parseUbxPvt(data: Uint8Array): UbxPvtResult;
|
|
277
|
+
|
|
270
278
|
/**
|
|
271
279
|
* u-blox UBX raw-measurement decoding (RXM-RAWX) — the path from a
|
|
272
280
|
* receiver log to RINEX-grade observables.
|
|
@@ -323,4 +331,4 @@ interface UbxParseResult {
|
|
|
323
331
|
*/
|
|
324
332
|
declare function parseUbxRawx(data: Uint8Array): UbxParseResult;
|
|
325
333
|
|
|
326
|
-
export { type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawNavOptions, type UbxRawNavResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames };
|
|
334
|
+
export { ReceiverPvt, type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxPvtResult, type UbxRawNavOptions, type UbxRawNavResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames };
|
package/dist/ubx.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.js';
|
|
2
|
+
import { R as ReceiverPvt } from './receiver-pvt-CVFvi4kT.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* u-blox UBX framing shared by the measurement and navigation decoders:
|
|
@@ -267,6 +268,13 @@ interface UbxRawNavResult {
|
|
|
267
268
|
*/
|
|
268
269
|
declare function parseUbxRawNav(data: Uint8Array, opts?: UbxRawNavOptions): UbxRawNavResult;
|
|
269
270
|
|
|
271
|
+
interface UbxPvtResult {
|
|
272
|
+
records: ReceiverPvt[];
|
|
273
|
+
messages: number;
|
|
274
|
+
}
|
|
275
|
+
/** Decode every UBX-NAV-PVT message in a u-blox byte stream. */
|
|
276
|
+
declare function parseUbxPvt(data: Uint8Array): UbxPvtResult;
|
|
277
|
+
|
|
270
278
|
/**
|
|
271
279
|
* u-blox UBX raw-measurement decoding (RXM-RAWX) — the path from a
|
|
272
280
|
* receiver log to RINEX-grade observables.
|
|
@@ -323,4 +331,4 @@ interface UbxParseResult {
|
|
|
323
331
|
*/
|
|
324
332
|
declare function parseUbxRawx(data: Uint8Array): UbxParseResult;
|
|
325
333
|
|
|
326
|
-
export { type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawNavOptions, type UbxRawNavResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames };
|
|
334
|
+
export { ReceiverPvt, type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxPvtResult, type UbxRawNavOptions, type UbxRawNavResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames };
|
package/dist/ubx.js
CHANGED
|
@@ -2,10 +2,11 @@ import {
|
|
|
2
2
|
parseUbxCnav,
|
|
3
3
|
parseUbxIonoUtc,
|
|
4
4
|
parseUbxNav,
|
|
5
|
+
parseUbxPvt,
|
|
5
6
|
parseUbxRawNav,
|
|
6
7
|
parseUbxRawx,
|
|
7
8
|
ubxFrames
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MRC6LIPM.js";
|
|
9
10
|
import "./chunk-FA2UTLEQ.js";
|
|
10
11
|
import "./chunk-WQX354KD.js";
|
|
11
12
|
import "./chunk-YUW33VXK.js";
|
|
@@ -16,6 +17,7 @@ export {
|
|
|
16
17
|
parseUbxCnav,
|
|
17
18
|
parseUbxIonoUtc,
|
|
18
19
|
parseUbxNav,
|
|
20
|
+
parseUbxPvt,
|
|
19
21
|
parseUbxRawNav,
|
|
20
22
|
parseUbxRawx,
|
|
21
23
|
ubxFrames
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gnss-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.54.0",
|
|
4
4
|
"description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|