SignalK / signalk-to-nmea0183

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

VHW sentence should you not subtract the variation from headingTrue #63

Open rezder opened 3 years ago

rezder commented 3 years ago

In VHW.js https://github.com/SignalK/signalk-to-nmea0183/blob/1cabd1357cf182f73ba632f61aaa6c2e20af3357/sentences/VHW.js#L22 you are adding the magneticVariation to headingTrue to get the headingMagnetic should you not subtract.

From the documentation on https://signalk.org/specification/1.5.0/doc/vesselsBranch.html

Description: The magnetic variation (declination) at the current position that must be added to the magnetic heading to derive the true heading. Easterly variations are positive and Westerly variations are negative (in Radians).

kdschmidt1 commented 3 years ago

i agree with the statement of rezder! Line 22 should be changed to: var headingMagnetic = headingTrue - magneticVariation