Closed mfrydrysiak closed 2 years ago
Hi @mfrydrysiak ,
pyubx2 applies the scaling factors automatically during message generation and parse, so you can just pass the actual value you want, e.g.
pvt = UBXMessage(0x01, 0x07, GET, headMot=247, month=6, fixType=3, gSpeed=3000, flags=b"\x01", parsebitfield=0)
print(pvt)
<UBX(NAV-PVT, iTOW=23:59:42, year=0, month=6, day=0, hour=0, min=0, second=0, valid=b'\x00', tAcc=0, nano=0, fixType=3, flags=b'\x01', flags2=b'\x00', numSV=0, lon=0, lat=0, height=0, hMSL=0, hAcc=0, vAcc=0, velN=0, velE=0, velD=0, gSpeed=3000, headMot=247, sAcc=0, headAcc=0, pDOP=0, flags3=b'\x00\x00', reserved0=0, headVeh=0, magDec=0, magAcc=0)>
This would also work if you know the individual bitfield values:
pvt = UBXMessage("NAV", "NAV-PVT", GET, headMot=247, month=6, fixType=3, gSpeed=3000, gnssFixOk=1)
Hope this helps
Hi @semuadmin
Thank you for clarification.
BR
Describe the bug
UBXTypeError is thrown when providing
headMot
parameter toUBXMessage
constructor. According to the documentation this field isI4
with scaling10^-5
, thus I pass there value in range0...359
multiplied bypow(10,5)
:where
self.hom
is in range1...359
.pyubx2 version: 1.2.16
Traceback:
To Reproduce
Expected Behaviour
A UBXMessage is created without throwing exception.
Desktop (please complete the following information):
OS: Ubuntu 20.04 Python 3.8.10
GNSS/GPS Device (please complete the following information as best you can):
Additional context
NONE