Skip to content

Commit d5fdc17

Browse files
authored
Merge pull request #810 from sparkfun/Add_BaseAssist
Merging Add_BaseAssist into pcUpdates_ntripServer_CasterEnabled
2 parents 8a73029 + db2e3a8 commit d5fdc17

18 files changed

+234
-62
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/Display.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ void displayUpdate()
346346
break;
347347

348348
case (STATE_BASE_CASTER_NOT_STARTED):
349+
case (STATE_BASE_ASSIST_NOT_STARTED):
349350
case (STATE_BASE_NOT_STARTED):
350351
case (STATE_BASE_CONFIG_WAIT):
351352
displayBaseStart(0); // Show 'Base' while the system configures the Base
@@ -1281,6 +1282,7 @@ void setModeIcon(std::vector<iconPropertyBlinking> *iconList)
12811282
break;
12821283

12831284
case (STATE_BASE_CASTER_NOT_STARTED):
1285+
case (STATE_BASE_ASSIST_NOT_STARTED):
12841286
case (STATE_BASE_NOT_STARTED):
12851287
case (STATE_BASE_CONFIG_WAIT):
12861288
// Do nothing. Static display shown during state change.

Firmware/RTK_Everywhere/GNSS.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ typedef enum
2121
class GNSS
2222
{
2323
protected:
24-
float _altitude; // Altitude in meters
24+
double _altitude; // Altitude in meters
25+
double _geoidalSeparation; // Geoidal separation in meters
2526
float _horizontalAccuracy; // Horizontal position accuracy in meters
2627
double _latitude; // Latitude in degrees
2728
double _longitude; // Longitude in degrees
@@ -166,6 +167,9 @@ class GNSS
166167
// Returns the fix type or zero if not online
167168
virtual uint8_t getFixType();
168169

170+
// Returns the geoidal separation
171+
virtual double getGeoidalSeparation();
172+
169173
// Returns the hours of 24 hour clock or zero if not online
170174
virtual uint8_t getHour();
171175

Firmware/RTK_Everywhere/GNSS_LG290P.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ class GNSS_LG290P : GNSS
230230
// Returns the fix type or zero if not online
231231
uint8_t getFixType();
232232

233+
// Returns the geoidal separation
234+
double getGeoidalSeparation();
235+
233236
// Returns the hours of 24 hour clock or zero if not online
234237
uint8_t getHour();
235238

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 14 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

@@ -829,6 +832,16 @@ uint8_t GNSS_LG290P::getFixType()
829832
return 0;
830833
}
831834

835+
//----------------------------------------
836+
// Returns the geoidal separation in meters or zero if the GNSS is offline
837+
//----------------------------------------
838+
double GNSS_LG290P::getGeoidalSeparation()
839+
{
840+
if (online.gnss)
841+
return (_lg290p->getGeoidalSeparation());
842+
return (0);
843+
}
844+
832845
//----------------------------------------
833846
// Get the horizontal position accuracy
834847
// Returns the horizontal position accuracy or zero if offline

Firmware/RTK_Everywhere/GNSS_Mosaic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ class GNSS_MOSAIC : GNSS
699699
// Returns the fix type or zero if not online
700700
uint8_t getFixType();
701701

702+
// Returns the geoidal separation
703+
double getGeoidalSeparation();
704+
702705
// Returns the hours of 24 hour clock or zero if not online
703706
uint8_t getHour();
704707

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 12 additions & 1 deletion
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

@@ -952,6 +954,14 @@ uint8_t GNSS_MOSAIC::getFixType()
952954
return _fixType;
953955
}
954956

957+
//----------------------------------------
958+
// Returns the geoidal separation in meters or zero if the GNSS is offline
959+
//----------------------------------------
960+
double GNSS_MOSAIC::getGeoidalSeparation()
961+
{
962+
return _geoidalSeparation;
963+
}
964+
955965
//----------------------------------------
956966
// Returns the hours of 24 hour clock or zero if not online
957967
//----------------------------------------
@@ -2527,7 +2537,8 @@ void GNSS_MOSAIC::storeBlock4007(SEMP_PARSE_STATE *parse)
25272537
{
25282538
_latitude = sempSbfGetF8(parse, 16) * 180.0 / PI; // Convert from radians to degrees
25292539
_longitude = sempSbfGetF8(parse, 24) * 180.0 / PI;
2530-
_altitude = (float)sempSbfGetF8(parse, 32);
2540+
_altitude = sempSbfGetF8(parse, 32); // Ellipsoidal height
2541+
_geoidalSeparation = (double)sempSbfGetF4(parse, 40); // Geoid undulation
25312542
_horizontalAccuracy = ((float)sempSbfGetU2(parse, 90)) / 100.0; // Convert from cm to m
25322543

25332544
// NrSV is the total number of satellites used in the PVT computation.

Firmware/RTK_Everywhere/GNSS_None.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ class GNSS_None : public GNSS
234234
return _fixType;
235235
}
236236

237+
// Get the geoidal separation
238+
// Outputs:
239+
// Returns the geoidal separation in meters or zero if the GNSS is offline
240+
double getGeoidalSeparation()
241+
{
242+
return _geoidalSeparation;
243+
}
244+
237245
// Returns the hours of 24 hour clock or zero if not online
238246
uint8_t getHour()
239247
{

Firmware/RTK_Everywhere/GNSS_UM980.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ class GNSS_UM980 : GNSS
241241
// Returns the fix type or zero if not online
242242
uint8_t getFixType();
243243

244+
// Returns the geoidal separation
245+
double getGeoidalSeparation();
246+
244247
// Returns the hours of 24 hour clock or zero if not online
245248
uint8_t getHour();
246249

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 14 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

@@ -586,6 +589,16 @@ uint8_t GNSS_UM980::getFixType()
586589
return 0;
587590
}
588591

592+
//----------------------------------------
593+
// Returns the geoidal separation in meters or zero if the GNSS is offline
594+
//----------------------------------------
595+
double GNSS_UM980::getGeoidalSeparation()
596+
{
597+
if (online.gnss)
598+
return (_um980->getGeoidalSeparation());
599+
return (0);
600+
}
601+
589602
//----------------------------------------
590603
// Get the horizontal position accuracy
591604
// Returns the horizontal position accuracy or zero if offline

0 commit comments

Comments
 (0)