Skip to content

Commit 83989bb

Browse files
committed
Add pole length + ARP if tip altitude disabled during tilt
Reimplement @APOS80 PR #382
1 parent 4b2f781 commit 83989bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Firmware/RTK_Everywhere/Tilt.ino

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,11 @@ void tiltApplyCompensationGNS(char *nmeaSentence, int arraySize)
588588
// Add interstitial between end of lon and beginning of alt
589589
strncat(newSentence, nmeaSentence + longitudeStop, altitudeStart - longitudeStop);
590590

591+
// If outputTipAltitude is enabled, then we don't have to make any adjustments: the tilt compensation module outputs tip altitude
592+
// If outputTipAltitude is disabled, then we need to add back the pole length and ARP
593+
if(settings.outputTipAltitude == false)
594+
orthometricHeight = orthometricHeight + settings.tiltPoleLength + (present.antennaReferencePoint_mm / 1000.0);
595+
591596
// Convert altitude double to string
592597
snprintf(coordinateStringDDMM, sizeof(coordinateStringDDMM), "%0.3f", orthometricHeight);
593598

@@ -900,6 +905,11 @@ void tiltApplyCompensationGGA(char *nmeaSentence, int arraySize)
900905
// Add interstitial between end of lon and beginning of alt
901906
strncat(newSentence, nmeaSentence + longitudeStop, altitudeStart - longitudeStop);
902907

908+
// If outputTipAltitude is enabled, then we don't have to make any adjustments: the tilt compensation module outputs tip altitude
909+
// If outputTipAltitude is disabled, then we need to add back the pole length and ARP
910+
if(settings.outputTipAltitude == false)
911+
orthometricHeight = orthometricHeight + settings.tiltPoleLength + (present.antennaReferencePoint_mm / 1000.0);
912+
903913
// Convert altitude double to string
904914
snprintf(coordinateStringDDMM, sizeof(coordinateStringDDMM), "%0.3f", orthometricHeight);
905915

0 commit comments

Comments
 (0)