ttlappalainen / NMEA0183

Library for handling NMEA0183 messages
69 stars 44 forks source link

WindAngle returned in Deg #25

Open lsoltero opened 3 years ago

lsoltero commented 3 years ago

It seems that the library returns SI units for everithing including headings and angles. Lat/Lon are in deg which makes sense. COG is in radians.... looking at the code in RMC we see

SOG=atof(NMEA0183Msg.Field(6))*knToms;
TrueCOG=atof(NMEA0183Msg.Field(7))*degToRad;

so it would seem that WindAngle should also be in radians... but its in degrees. Here is the code

bool NMEA0183ParseMWV_nc(const tNMEA0183Msg &NMEA0183Msg,double &WindAngle, tNMEA0183WindReference &Reference, double &WindSpeed) { bool result=( NMEA0183Msg.FieldCount()>=4 );

if ( result ) { WindAngle=atof(NMEA0183Msg.Field(0));

it would be nice if the definitions in NMEA0183Messages.h would list the units of the arguments in the commets as is done in the NMEA2000 library.

ttlappalainen commented 3 years ago

Yes, thats my mistake. I should have been more carefull with units. Also on N2k flow is in l/h and fluid capacity in l, which are not SI units.

There is no way to change them anymore to keep compatibility.