Closed davidalo closed 6 months ago
Hey @davidalo,
The GPSD project - the de facto reference documentation for this project - does not round: https://gitlab.com/gpsd/gpsd/-/blob/master/devtools/ais.py#L117. Therefore, I dropped the round
statement, because it caused some trouble for other users.
However, I am not 100% sure, since the values for ROT vary slightly from decoder to decoder. Depending on the decoder, there seems to be a certain confidence interval of +/- 5 degrees, in which all available decoders scatter. 🤷
For example the very same messages are decoded differently:
!AIVDO,1,1,,A,10000Nh200000000000000000000,0*01
!AIVDM,1,1,,A,14QIG<5620KF@Gl:L9DI4o8N0P00,0*28
:
I am inclined to accept your PR with the addition to round to two decimals places.
Hello,
When encoding and decoding some messages I found an inconsistency in ROT (
turn
). For some values it's inconsistent becauseto_turn
function is truncating instead of rounding.You can see the effect in the following screenshots:
I added a new test
test_rot_encode_decode
to cover this.Related PR: https://github.com/M0r13n/pyais/pull/74 . I see that
to_turn
was rounding in the past, but it was changed for some reason. Could you shed some light on this?