Closed davidsanner closed 6 years ago
Can you please add defaults
for HDG in case magneticVariation is not available. See RMC for an example.
RMC conversion to degrees should be smarter too. Needs to check for a real value. typeof magneticVariation === 'number'
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).
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?)
Thanks!
Thanks for your help getting things cleaned up.
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)