SignalK / signalk-to-nmea0183

Signal K Node server plugin to convert Signal K to NMEA 0183
Apache License 2.0
13 stars 28 forks source link

fix RMC sentence, add Variation to HDG setence #21

Closed davidsanner closed 6 years ago

davidsanner commented 6 years ago

RMC was using radians, updated to spec using degrees. Added varation to HDG sentence

(side note: looks like RMC is using local time not required UTC)

sbender9 commented 6 years ago

Can you please add defaults for HDG in case magneticVariation is not available. See RMC for an example.

sbender9 commented 6 years ago

RMC conversion to degrees should be smarter too. Needs to check for a real value. typeof magneticVariation === 'number'

davidsanner commented 6 years ago

I tested the code and it performed well, leaves fields empty if no magVar available and populate correctly otherwise ... but pulled the define outside of the block, it is cleaner. Also updated to use Math.abs (I had snipped the * -1 from the RMC code).

davidsanner commented 6 years ago

I just made some changes to HDT to still output true heading when headingTrue is not available but headingMagnetic & magneticVariation are (as with my B&G/Simrad/Lowrance 10Hz GPS w/ heading sensor). Not sure about the empty return if no heading info is available at all ... perhaps there needs to be two separate like HDM & HDMC is split? (Perhaps headingTrue be generated inside the server-node?)

tkurki commented 6 years ago

Thanks!

davidsanner commented 6 years ago

Thanks for your help getting things cleaned up.