SignalK/signalk-to-nmea0183

VHW sentence should you not subtract the variation from headingTrue

rezder opened this issue · 1 comments

In VHW.js

var headingMagnetic = headingTrue + magneticVariation
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).

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