Skip to content

Commit

Permalink
-Magnetic and True AHRS heading
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-gomez-windhover committed Feb 23, 2024
1 parent 9ef8a60 commit 5c911be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/windhoverlabs/yamcs/gdl90/AHRS.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ public byte[] toBytes() throws Exception {

byte iaByte = packedHeadingBytes[1];

// NOTE:It seems that the ForeFlight Docs have these definitions flipped
switch (HeadingType) {
case MAGNETIC:
case TRUE_HEADING:
// packedHeading = packedHeading | (1 << 15);
iaByte = (byte) setNibble(packedHeadingBytes[2], 0x01, 1);

break;
case TRUE_HEADING:
case MAGNETIC:
// packedHeading = packedHeading | ~(1 << 15);
iaByte = (byte) setNibble(packedHeadingBytes[2], 0x00, 1);

Expand Down

0 comments on commit 5c911be

Please sign in to comment.