(I'm not sure this is the right forum as it's not strictly
OpenCPN related, but it seems like the most suited to find forum members who might know the answer to this... happy for this to be moved to a different forum if more appropriate)
Trying to sort out why my
SeaTalk <-> NMEA0183 bridge is giving me lat/long positions with only 0.01 min precision (i.e. ~ 18.5 m). (Following from
this thread.) I think I've figured it out but am hoping some
SeaTalk guru on the board might be able to confirm: it seems to me that one set of SeaTalk datagrams (50 & 51) only output position with 0.01 min precision, while a different datagram (58) outputs position with 0.001 min precision. My bridge seems to use the former set rather than the latter to create RMC and GLL NMEA0183 sentences, which gives me a choppy-looking track in
OpenCPN.
Thomas Knauf's excellent
SeaTalk Technical Reference gives two sets of datagrams that can give lat/long: Datagrams 50 and 51 give, respectively, latitude and longitude as a 'stable filtered position', whatever that means, while 58 gives both latitude and longitude in the same datagram.
50 Z2 XX YY YY LAT position:
XX degrees, (YYYY & 0x7FFF)/100 minutes
MSB of Y = YYYY & 0x8000 = South if set, North if cleared
Z= 0xA or 0x0 (reported for Raystar 120 GPS), meaning unknown
Stable filtered position, for raw data use command 58
Corresponding NMEA sentences: RMC, GAA, GLL
(
51 for longitude works the same was as 50 above)
58 Z5 LA XX YY LO QQ RR LAT/LON
LA Degrees LAT, LO Degrees LON
minutes LAT = (XX*256+YY) / 1000
minutes LON = (QQ*256+RR) / 1000
Z&1: South (Z&1 = 0: North)
Z&2: East (Z&2 = 0: West)
Raw unfiltered position, for filtered data use commands 50&51
Corresponding NMEA sentences: RMC, GAA, GLL
Datagram 50 (latitude) uses two bytes (YY YY) to encode both minutes and N/S. The most significant bit sets the N/S flag, and the rest of the bytes encode minutes, but the result is necessarily minutes with four significant figures and two decimal places. (51 for longitude works the same way for E/W.)
Datagram 58, on the other hand, uses one nibble (Z) to encode both N/S and E/W, and then two full bytes (XX YY) to encode minutes, which allows five significant figures and three decimal places. It's been a while since I've played with hexadecimal (I am not a computer programmer!); can anyone confirm I am correct about this?
If I'm correct, to get the most precise location data from SeaTalk one should use datagram 58, not 50 and 51. Additionally, does anyone know what "stable filtered position" means and what it would be typically used for in a SeaTalk application? My old
chartplotter (Raytheon RC520) displays the full three decimal places.
Thanks for any info!
Dave