Skip to content

Commit

Permalink
Merge pull request #78 from ronzeiller/heel-pitch-nmea0183-openCPN
Browse files Browse the repository at this point in the history
NMEA0183 for heel, pitch for Expedition & openCPN - closes #63.
  • Loading branch information
sarfata authored Nov 27, 2017
2 parents 92fe729 + db9e0d0 commit b6b9621
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ node_modules
Network Trash Folder
Temporary Items
.apdisk

# Platformio likes to auto-create this
lib/readme.txt
15 changes: 5 additions & 10 deletions src/common/signalk/SKNMEAVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,16 @@ void SKNMEAVisitor::visitSKEnvironmentOutsidePressure(const SKUpdate& u, const S
void SKNMEAVisitor::visitSKNavigationAttitude(const SKUpdate &u, const SKPath &p, const SKValue &v) {
// Same comment on XDR. It's not very well standardized but at least its a way
// to share the data.
NMEASentenceBuilder sb("II", "XDR", 12);
NMEASentenceBuilder sb( "II", "XDR", 8);
sb.setField(1, "A");
sb.setField(2, SKRadToDeg(v.getAttitudeValue().yaw), 1);
sb.setField(2, SKRadToDeg(v.getAttitudeValue().pitch), 1);
sb.setField(3, "D");
sb.setField(4, "Yaw");
sb.setField(4, "PTCH");

sb.setField(5, "A");
sb.setField(6, SKRadToDeg(v.getAttitudeValue().pitch), 1);
sb.setField(6, SKRadToDeg(v.getAttitudeValue().roll), 1);
sb.setField(7, "D");
sb.setField(8, "Pitch");

sb.setField(9, "A");
sb.setField(10, SKRadToDeg(v.getAttitudeValue().roll), 1);
sb.setField(11, "D");
sb.setField(12, "Roll");
sb.setField(8, "ROLL");

_sentences.add(sb.toNMEA() + "\r\n");
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/signalk/SKNMEAVisitorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ TEST_CASE("SKNMEAVisitorTest") {

if (v.getSentences().size() > 0) {
String s = *(v.getSentences().begin());
CHECK( s == "$IIXDR,A,4.2,D,Yaw,A,10.1,D,Pitch,A,29.0,D,Roll*5C\r\n" );
CHECK( s == "$IIXDR,A,10.1,D,PTCH,A,29.0,D,ROLL*57\r\n" );
}
}

Expand Down

0 comments on commit b6b9621

Please sign in to comment.