Skip to content

Commit 830e080

Browse files
committed
Move the geoidal separation fix into the GNSS classes
1 parent 9c644df commit 830e080

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

Firmware/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ RUN arduino-cli lib install "SparkFun BQ40Z50 Battery Manager Arduino Library"@1
8181
RUN arduino-cli lib install "ArduinoMqttClient"@0.1.8
8282
RUN arduino-cli lib install "SparkFun u-blox PointPerfect Library"@1.11.4
8383
RUN arduino-cli lib install "SparkFun IM19 IMU Arduino Library"@1.0.1
84-
RUN arduino-cli lib install "SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.9
84+
RUN arduino-cli lib install "SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.10
8585
RUN arduino-cli lib install "SparkFun LG290P Quadband RTK GNSS Arduino Library"@1.0.8
8686
RUN arduino-cli lib install "SparkFun I2C Expander Arduino Library"@1.0.1
8787
RUN arduino-cli lib install "SparkFun Apple Accessory Arduino Library"@3.0.9

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,10 @@ uint8_t GNSS_LG290P::getActiveRtcmMessageCount()
593593
double GNSS_LG290P::getAltitude()
594594
{
595595
if (online.gnss)
596-
return (_lg290p->getAltitude());
596+
// See issue #809
597+
// getAltitude returns the Altitude above mean sea level (meters)
598+
// For Height above Ellipsoid, we need to add the the geoidalSeparation
599+
return (_lg290p->getAltitude() + _lg290p->getGeoidalSeparation());
597600
return (0);
598601
}
599602

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ uint8_t GNSS_MOSAIC::getActiveMessageCount()
855855
//----------------------------------------
856856
double GNSS_MOSAIC::getAltitude()
857857
{
858+
// _altitude contains the Ellipsoidal height (meters) from SBF Block 4007
859+
// We don't need to adjust for the Geoidal Separation (Undulation)
858860
return _altitude;
859861
}
860862

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ uint8_t GNSS_UM980::getActiveRtcmMessageCount()
510510
double GNSS_UM980::getAltitude()
511511
{
512512
if (online.gnss)
513-
return (_um980->getAltitude());
513+
// See issue #809
514+
// getAltitude returns the Height above mean sea level (meters) from BESTNAVB
515+
// For Height above Ellipsoid, we need to add the the geoidalSeparation
516+
return (_um980->getAltitude() + _um980->getGeoidalSeparation());
514517
return (0);
515518
}
516519

Firmware/RTK_Everywhere/GNSS_ZED.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ uint8_t GNSS_ZED::getActiveRtcmMessageCount()
892892
//----------------------------------------
893893
double GNSS_ZED::getAltitude()
894894
{
895+
// _altitude contains the Height above ellipsoid from NAV-PVT height
896+
// We don't need to adjust for the Geoidal Separation (Undulation)
895897
return _altitude;
896898
}
897899

Firmware/RTK_Everywhere/States.ino

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,9 @@ void stateUpdate()
241241
settings.fixedLong = gnss->getLongitude();
242242

243243
// See issue #809
244-
// Strictly we should implement this inside each GNSS class / instance
245-
double fixedAltitude = gnss->getAltitude();
246-
if ((present.gnss_lg290p) || (present.gnss_um980))
247-
fixedAltitude += gnss->getGeoidalSeparation();
248-
settings.fixedAltitude = fixedAltitude;
244+
// gnss->getAltitude() will always return Height above ellipsoid
245+
// even if the underlying library getAltitude does not
246+
settings.fixedAltitude = gnss->getAltitude();
249247

250248
systemPrint("Switching to Fixed Base mode using:");
251249
systemPrint(" Lat: ");

0 commit comments

Comments
 (0)