SignalK / signalk-derived-data

Generates deltas for values derived from signalk values
Apache License 2.0
18 stars 30 forks source link

Why does this plugin trusts navigation.magneticVariation NULL or exacltly 0 #136

Closed mgrouch closed 2 weeks ago

mgrouch commented 1 month ago

In both cases they are clearly wrong

tkurki commented 1 month ago

Which calculations are affected? Can you provide test cases with input and expected output?

mgrouch commented 1 month ago

Calculation true values from magnetic are affected

tkurki commented 1 month ago

And the test cases?

mgrouch commented 1 month ago

navigation.magneticVariation is NULL or 0

makes COGT same as COGM, and other things 'true' heading not correct

tkurki commented 1 month ago

Zero is a perfectly valid value for magnetic variation.

mgrouch commented 1 month ago

When its exact 0 to many decimal points chances are it’s just unknown and some device sends it as 0.

tkurki commented 1 month ago

I don't think we should have a special case for exactly zero. If a system has variation as zero when it should not then the system's source of variation data needs to be fixed.

tkurki commented 1 month ago

I am curious: what real world magnetic variation sources produce null or exactly zero values?

mgrouch commented 1 month ago

Many USB GPS pucks do that.