Skip to content

Commit

Permalink
#44: implement workaround factor for ROT
Browse files Browse the repository at this point in the history
  • Loading branch information
wellenvogel committed Nov 16, 2022
1 parent c02be79 commit b4d5e97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/boatData/GwBoatData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#define GW_BOAT_VALUE_LEN 32
#define GWSC(name) static constexpr const __FlashStringHelper* name=F(#name)

//see https://github.com/wellenvogel/esp32-nmea2000/issues/44
//factor to convert from N2k/SI rad/s to current NMEA rad/min
#define ROT_WA_FACTOR 60

class GwJsonDocument;
class GwBoatItemBase{
public:
Expand Down
1 change: 1 addition & 0 deletions lib/nmea0183ton2k/NMEA0183DataToN2K.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ class NMEA0183DataToN2KFunctions : public NMEA0183DataToN2K
LOG_DEBUG(GwLog::DEBUG,"unable to parse ROT %s",msg.line);
return;
}
ROT=ROT / ROT_WA_FACTOR;
if (! updateDouble(boatData->ROT,ROT,msg.sourceId)) return;
tN2kMsg n2kMsg;
SetN2kRateOfTurn(n2kMsg,1,ROT);
Expand Down
3 changes: 1 addition & 2 deletions lib/nmea2kto0183/N2kDataToNMEA0183.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@




N2kDataToNMEA0183::N2kDataToNMEA0183(GwLog * logger, GwBoatData *boatData,
SendNMEA0183MessageCallback callback, String talkerId)
{
Expand Down Expand Up @@ -1055,7 +1054,7 @@ class N2kToNMEA0183Functions : public N2kDataToNMEA0183
}
if (!updateDouble(boatData->ROT,ROT)) return;
tNMEA0183Msg nmeamsg;
if (NMEA0183SetROT(nmeamsg,ROT,talkerId)){
if (NMEA0183SetROT(nmeamsg,ROT * ROT_WA_FACTOR,talkerId)){
SendMessage(nmeamsg);
}
}
Expand Down

0 comments on commit b4d5e97

Please sign in to comment.