Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.terminal.activateEnvironment": true,
"editor.formatOnSave": true,
"modulename": "${workspaceFolderBasename}",
Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# pyubx2 Release Notes

### RELEASE 1.2.57

ENHANCEMENTS:

1. NAV Payload definition updates for ZED-X20P HPG 2.00 (NAV-GEOFENCE, NAV-PVT, NAV-SAT, NAV-SIG, NAV-TIMETRUSTED).
1. Add new configuration database keys and other minor updates for ZED-F9R HPS 1.40 - thanks to @djshake for contribution.

### RELEASE 1.2.56

ENHANCEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion src/pyubx2/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:license: BSD 3-Clause
"""

__version__ = "1.2.56"
__version__ = "1.2.57"
11 changes: 11 additions & 0 deletions src/pyubx2/ubxtypes_configdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"CFG_LOGFILTER_TIME_THRS": (0x30DE0006, U2),
"CFG_MOT_GNSSDIST_THRS": (0x3025003B, U2),
"CFG_MOT_GNSSSPEED_THRS": (0x20250038, U1),
"CFG_MOT_IMU_FILT_WINDOW": (0x30250016, U2),
"CFG_MSGOUT_NMEA_ID_DTM_I2C": (0x209100A6, U1),
"CFG_MSGOUT_NMEA_ID_DTM_SPI": (0x209100AA, U1),
"CFG_MSGOUT_NMEA_ID_DTM_UART1": (0x209100A7, U1),
Expand Down Expand Up @@ -1132,6 +1133,9 @@
"CFG_SEC_JAMDET_SENSITIVITY_HI": (0x10F60051, L),
"CFG_SEC_SPOOFDET_SIM_SIG_DIS": (0x10F6005D, L),
"CFG_SFCORE_HNR_RATE": (0x2008001A, U1),
"CFG_SFCORE_IMU2CRP_LA_X": (0x30080002, I2),
"CFG_SFCORE_IMU2CRP_LA_Y": (0x30080003, I2),
"CFG_SFCORE_IMU2CRP_LA_Z": (0x30080004, I2),
"CFG_SFCORE_USE_SF": (0x10080001, L),
"CFG_SFIMU_ACCEL_ACCURACY": (0x30060018, U2),
"CFG_SFIMU_ACCEL_FREQUENCY": (0x20060016, U1),
Expand All @@ -1148,7 +1152,11 @@
"CFG_SFIMU_IMU_I2C_SDA_PIO": (0x2006001F, U1),
"CFG_SFIMU_IMU_MNTALG_PITCH": (0x3006002E, I2),
"CFG_SFIMU_IMU_MNTALG_ROLL": (0x3006002F, I2),
"CFG_SFIMU_IMU_MNTALG_TOLERANCE": (0x20060030, E1),
"CFG_SFIMU_IMU_MNTALG_YAW": (0x4006002D, U4),
"CFG_SFIMU_IMU2ANT_LA_X": (0x30060020, I2),
"CFG_SFIMU_IMU2ANT_LA_Y": (0x30060021, I2),
"CFG_SFIMU_IMU2ANT_LA_Z": (0x30060022, I2),
"CFG_SFODO_CNT_BOTH_EDGES": (0x1007000D, L),
"CFG_SFODO_COMBINE_TICKS": (0x10070001, L),
"CFG_SFODO_COUNT_MAX": (0x40070009, U4),
Expand All @@ -1160,6 +1168,9 @@
"CFG_SFODO_DIS_DIR_INFO": (0x1007001C, L),
"CFG_SFODO_FACTOR": (0x40070007, U4),
"CFG_SFODO_FREQUENCY": (0x2007000B, U1),
"CFG_SFODO_IMU2VRP_LA_X": (0x30070012, I2),
"CFG_SFODO_IMU2VRP_LA_Y": (0x30070013, I2),
"CFG_SFODO_IMU2VRP_LA_Z": (0x30070014, I2),
"CFG_SFODO_LATENCY": (0x3007000A, U2),
"CFG_SFODO_QUANT_ERROR": (0x40070008, U4),
"CFG_SFODO_SPEED_BAND": (0x3007000E, U2),
Expand Down
2 changes: 1 addition & 1 deletion src/pyubx2/ubxtypes_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
b"\x01\x26": "NAV-TIMELS",
b"\x01\x63": "NAV-TIMENAVIC",
b"\x01\x27": "NAV-TIMEQZSS",
# b"\x01\x64": "NAV-TIMETRUSTED", # not publicly documented
b"\x01\x64": "NAV-TIMETRUSTED",
b"\x01\x21": "NAV-TIMEUTC",
b"\x01\x11": "NAV-VELECEF",
b"\x01\x12": "NAV-VELNED",
Expand Down
11 changes: 9 additions & 2 deletions src/pyubx2/ubxtypes_decodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
DGNSMODE = {
2: "RTK float",
3: "RTK fixed",
5: "RTK CAR", # Conservative ambiguity resolution
}
"""Differential correction mode from UBX-CFG-DGNSS"""

Expand Down Expand Up @@ -84,6 +85,7 @@
10: "motorbike", # (supported for protocol versions 19.20, and 35.10)
11: "robotic lawn mower", # (supported for protocol versions 33.21)
12: "electric kick scooter", # (supported for protocol versions 33.21, and 35.10)
13: "rail", # trains and trams
}
"""Dynamic model from UBX-CFG-NAV5"""

Expand Down Expand Up @@ -424,7 +426,11 @@
5: "RTCM3 SSR",
6: "QZSS SLAS",
7: "SPARTN",
8: "CLAS",
8: "CLAS", # not used in HPG 2.00
9: "CLAS",
10: "LPP OSR",
11: "LPP SSR",
12: "GAL HAS",
}
"""DGPS correction source from UBX-NAV-SIG"""

Expand All @@ -433,7 +439,8 @@
1: "Klobuchar GPS",
2: "SBAS",
3: "Klobuchar BeiDou",
4: "Dual Frequency",
4: "Dual Frequency", # not used in HPG 2.00
8: "Dual frequency",
}
"""Ionospheric model type from UBX-NAV-SIG"""

Expand Down
43 changes: 32 additions & 11 deletions src/pyubx2/ubxtypes_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@
{
"mem": U1,
"alloc": U1,
"outputPort": U3,
},
),
"reserved0": U1,
Expand Down Expand Up @@ -2160,7 +2161,7 @@
"combState": U1,
"group": ( # repeating group * numFences
"numFences",
{"state": U1, "reserved1": U1},
{"state": U1, "id": U1},
),
},
"NAV-HPPOSECEF": {
Expand Down Expand Up @@ -2478,6 +2479,9 @@
{
"invalidLlh": U1,
"lastCorrectionAge": U4,
"reserved1": U8,
"authTime": U1,
"nmaFixStatus": U1,
},
),
"reserved0": U4, # NB this is incorrectly stated as U5 in older documentation
Expand Down Expand Up @@ -2586,6 +2590,9 @@
"prCorrUsed": U1,
"crCorrUsed": U1,
"doCorrUsed": U1,
"clasCorrUsed": U1,
"lppCorrUsed": U1,
"hasCorrUsed": U1,
},
),
},
Expand Down Expand Up @@ -2657,6 +2664,7 @@
"prCorrUsed": U1,
"crCorrUsed": U1,
"doCorrUsed": U1,
"authStatus": U1,
},
),
"reserved1": U4,
Expand Down Expand Up @@ -2925,15 +2933,28 @@
),
"tAcc": U4,
},
# nominal definition, excluded from public HPG 1.50 interface manual:
# "NAV-TIMETRUSTED": {
# "group": (
# "None",
# {
# "data": X1,
# },
# ),
# },
"NAV-TIMETRUSTED": {
"version": U1,
"refSys": U1,
"validFlags": (
X1,
{
"trustedTimeValid": U1,
"deltaTimeValid": U1,
},
),
"reserved0": U1,
"iTOW": U4,
"iniWho": U2,
"propWho": U2,
"iniTow": U4,
"propTow": U4,
"iniTAcc": U4,
"propTAcc": U4,
"deltaS": I4,
"deltaMs": I4,
"reserved1": U4,
},
"NAV-TIMEUTC": {
"iTOW": U4,
"tAcc": U4,
Expand All @@ -2950,7 +2971,7 @@
"validTOW": U1,
"validWKN": U1,
"validUTC": U1,
"reserved0": U1,
"authStatus": U1,
"utcStandard": U4,
},
),
Expand Down
Binary file added tests/pygpsdata-NAV-ZED-X20P.log
Binary file not shown.
Binary file modified tests/pygpsdata-NAV.log
Binary file not shown.
23 changes: 18 additions & 5 deletions tests/test_bitfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

@author: semuadmin
"""

# pylint: disable=line-too-long, invalid-name, missing-docstring, no-member

import unittest
Expand All @@ -20,6 +21,7 @@ def setUp(self):
self.nav_sat2 = b"\xb5b\x015\x14\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00+*\xf0\x00\xfd\xff\x07\x07\x00\x00\x9bt" # qualityInd = 7, orbitSource = 7
self.nav_sat3 = b"\xb5b\x015\x14\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00+*\xf0\x00\xfd\xff\x03\x04\x02\x00\x96_" # rtcmCorrUsed = 1
self.nav_sat4 = b"\xb5b\x015\x14\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00+*\xf0\x00\xfd\xff\x0a\x15\x5f\x00\x0bh" # svUsed = 1, almUsed = 1
self.nav_sat6 = b"\xb5b\x015\x14\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00+*\xf0\x00\xfd\xff\n\x15_\x01\x0ci"

def tearDown(self):
pass
Expand All @@ -28,27 +30,30 @@ def testNavSat2(
self,
): # check X4 bitfield correctly parsed (remember little-endian)
res = UBXReader.parse(self.nav_sat2)
# print(res)
self.assertEqual(
str(res),
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=7, svUsed_01=0, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=7, ephAvail_01=0, almAvail_01=0, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=0, rtcmCorrUsed_01=0, slasCorrUsed_01=0, spartnCorrUsed_01=0, prCorrUsed_01=0, crCorrUsed_01=0, doCorrUsed_01=0)>",
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=7, svUsed_01=0, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=7, ephAvail_01=0, almAvail_01=0, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=0, rtcmCorrUsed_01=0, slasCorrUsed_01=0, spartnCorrUsed_01=0, prCorrUsed_01=0, crCorrUsed_01=0, doCorrUsed_01=0, clasCorrUsed_01=0, lppCorrUsed_01=0, hasCorrUsed_01=0)>",
)

def testNavSat3(
self,
): # check X4 bitfield correctly parsed (remember little-endian)
res = UBXReader.parse(self.nav_sat3)
# print(res)
self.assertEqual(
str(res),
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=3, svUsed_01=0, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=4, ephAvail_01=0, almAvail_01=0, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=0, rtcmCorrUsed_01=1, slasCorrUsed_01=0, spartnCorrUsed_01=0, prCorrUsed_01=0, crCorrUsed_01=0, doCorrUsed_01=0)>",
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=3, svUsed_01=0, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=4, ephAvail_01=0, almAvail_01=0, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=0, rtcmCorrUsed_01=1, slasCorrUsed_01=0, spartnCorrUsed_01=0, prCorrUsed_01=0, crCorrUsed_01=0, doCorrUsed_01=0, clasCorrUsed_01=0, lppCorrUsed_01=0, hasCorrUsed_01=0)>",
)

def testNavSat4(
self,
): # check X4 bitfield correctly parsed (remember little-endian)
res = UBXReader.parse(self.nav_sat4)
print(res)
self.assertEqual(
str(res),
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=2, svUsed_01=1, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=5, ephAvail_01=0, almAvail_01=1, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=1, rtcmCorrUsed_01=1, slasCorrUsed_01=1, spartnCorrUsed_01=1, prCorrUsed_01=1, crCorrUsed_01=0, doCorrUsed_01=1)>",
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.3, qualityInd_01=2, svUsed_01=1, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=5, ephAvail_01=0, almAvail_01=1, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=1, rtcmCorrUsed_01=1, slasCorrUsed_01=1, spartnCorrUsed_01=1, prCorrUsed_01=1, crCorrUsed_01=0, doCorrUsed_01=1, clasCorrUsed_01=0, lppCorrUsed_01=0, hasCorrUsed_01=0)>",
)

def testNavSat5(self): # check message bytes match original byte stream
Expand Down Expand Up @@ -87,12 +92,20 @@ def testNavSat6(
prCorrUsed_01=1,
crCorrUsed_01=0,
doCorrUsed_01=1,
clasCorrUsed_01=0,
lppCorrUsed_01=1,
hasCorrUsed_01=0,
)
# print(res)
self.assertEqual(
str(res),
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.30000000000000004, qualityInd_01=2, svUsed_01=1, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=5, ephAvail_01=0, almAvail_01=1, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=1, rtcmCorrUsed_01=1, slasCorrUsed_01=1, spartnCorrUsed_01=1, prCorrUsed_01=1, crCorrUsed_01=0, doCorrUsed_01=1)>",
"<UBX(NAV-SAT, iTOW=23:59:42, version=1, numSvs=1, reserved0=0, gnssId_01=GPS, svId_01=0, cno_01=43, elev_01=42, azim_01=240, prRes_01=-0.30000000000000004, qualityInd_01=2, svUsed_01=1, health_01=0, diffCorr_01=0, smoothed_01=0, orbitSource_01=5, ephAvail_01=0, almAvail_01=1, anoAvail_01=0, aopAvail_01=0, sbasCorrUsed_01=1, rtcmCorrUsed_01=1, slasCorrUsed_01=1, spartnCorrUsed_01=1, prCorrUsed_01=1, crCorrUsed_01=0, doCorrUsed_01=1, clasCorrUsed_01=0, lppCorrUsed_01=1, hasCorrUsed_01=0)>",
)
# print(res.serialize())
self.assertEqual(
res.serialize(),
self.nav_sat6,
)
self.assertEqual(res.serialize(), self.nav_sat4)


if __name__ == "__main__":
Expand Down
36 changes: 20 additions & 16 deletions tests/test_stream.py

Large diffs are not rendered by default.