@@ -497,17 +497,21 @@ bool GNSS_ZED::configure()
497497// ----------------------------------------
498498bool GNSS_ZED::configureBase ()
499499{
500- if (settings.fixedBase == false && gnssInBaseSurveyInMode ())
501- {
502- if (settings.debugGnssConfig )
503- systemPrintln (" Skipping - F9P already in Survey-In Base configuration" );
504- return (true ); // No changes needed
505- }
506- if (settings.fixedBase == true && gnssInBaseFixedMode ())
500+ // If we are already in the appropriate base mode, no changes needed
501+
502+ // We may have been in a previous survey-in. We want to restart a survey-in regardless.
503+ // If we are already in the appropriate base mode, no changes needed
504+ // if (settings.fixedBase == false && gnssInBaseSurveyInMode())
505+ // return (true); // No changes needed
506+
507+ if (settings.fixedBase == true )
507508 {
508- if (settings.debugGnssConfig )
509- systemPrintln (" Skipping - F9P already in Fixed Base configuration" );
510- return (true ); // No changes needed
509+ // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed ECEF, 3 - Base Fixed LLH
510+ int currentMode = getMode ();
511+ if (currentMode == 2 && settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
512+ return (true ); // No changes needed
513+ if (currentMode == 3 && settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
514+ return (true ); // No changes needed
511515 }
512516
513517 // Assume we are changing from Rover to Base, request any additional config changes
@@ -521,7 +525,7 @@ bool GNSS_ZED::configureBase()
521525 if (settings.fixedBase == false )
522526 {
523527 // If we are doing a Survey-In (temporary) style Base, change to Rover Mode so our location can settle
524- response &= _zed->setVal8 (UBLOX_CFG_TMODE_MODE, 0 );
528+ response &= _zed->setVal8 (UBLOX_CFG_TMODE_MODE, 0 ); // Change to Rover Mode
525529 }
526530
527531 if (response == false )
@@ -742,7 +746,12 @@ bool GNSS_ZED::fixedBaseStart()
742746 return (false );
743747
744748 // If we are already in the appropriate base mode, no changes needed
745- if (gnssInBaseFixedMode ())
749+
750+ // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed ECEF, 3 - Base Fixed LLH
751+ int currentMode = getMode ();
752+ if (currentMode == 2 && settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
753+ return (true ); // No changes needed
754+ if (currentMode == 3 && settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
746755 return (true ); // No changes needed
747756
748757 if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
@@ -1045,15 +1054,30 @@ uint8_t GNSS_ZED::getMinute()
10451054
10461055// ----------------------------------------
10471056// Returns the current mode
1048- // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed
1057+ // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed ECEF, 3 - Base Fixed LLH
10491058// ----------------------------------------
10501059uint8_t GNSS_ZED::getMode ()
10511060{
10521061 if (online.gnss )
10531062 {
10541063 // Survey mode is only available on ZED-F9P modules
10551064 if (commandSupported (UBLOX_CFG_TMODE_MODE))
1056- return (_zed->getVal8 (UBLOX_CFG_TMODE_MODE));
1065+ {
1066+ int currentMode = _zed->getVal8 (UBLOX_CFG_TMODE_MODE);
1067+
1068+ if (currentMode == 0 ) // Rover
1069+ return (0 );
1070+ if (currentMode == 1 ) // Survey-in
1071+ return (1 );
1072+ if (currentMode == 2 ) // Fixed
1073+ {
1074+ int baseType = _zed->getVal8 (UBLOX_CFG_TMODE_POS_TYPE);
1075+ if (baseType == 0 ) // ECEF
1076+ return (2 ); // Base Fixed ECEF
1077+ if (baseType == 1 ) // LLH
1078+ return (3 ); // Base Fixed LLH
1079+ }
1080+ }
10571081 }
10581082
10591083 return (0 ); // Rover
@@ -1186,6 +1210,9 @@ int GNSS_ZED::getSurveyInObservationTime()
11861210 if (online.gnss == false )
11871211 return (0 );
11881212
1213+ if (gnssConfigureComplete () == false )
1214+ return (0 );
1215+
11891216 // Use a local static so we don't have to request these values multiple times (ZED takes many ms to respond
11901217 // to this command)
11911218 if ((millis () - lastCheck) > 1000 )
@@ -1217,7 +1244,7 @@ uint16_t GNSS_ZED::getYear()
12171244// ----------------------------------------
12181245bool GNSS_ZED::gnssInBaseFixedMode ()
12191246{
1220- if (getMode () == 2 ) // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed
1247+ if (getMode () == 2 || getMode () == 3 ) // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed ECEF, 3 - Base Fixed LLH
12211248 return (true );
12221249
12231250 return (false );
@@ -1228,7 +1255,7 @@ bool GNSS_ZED::gnssInBaseFixedMode()
12281255// ----------------------------------------
12291256bool GNSS_ZED::gnssInBaseSurveyInMode ()
12301257{
1231- if (getMode () == 1 ) // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed
1258+ if (getMode () == 1 ) // 0 - Rover, 1 - Base Survey-In, 2 - Base Fixed ECEF, 3 - Base Fixed LLH
12321259 return (true );
12331260
12341261 return (false );
@@ -2641,16 +2668,16 @@ bool GNSS_ZED::surveyInReset()
26412668
26422669// ----------------------------------------
26432670// Start the survey-in operation
2644- // The ZED-F9P is slightly different than the NEO-M8P. See the Integration manual 3.5.8 for more info.
26452671// ----------------------------------------
26462672bool GNSS_ZED::surveyInStart ()
26472673{
26482674 if (online.gnss == false )
26492675 return (false );
26502676
2677+ // We may have been in a previous survey-in. We want to restart a survey-in regardless.
26512678 // If we are already in the appropriate base mode, no changes needed
2652- if (gnssInBaseSurveyInMode ())
2653- return (true ); // No changes needed
2679+ // if (gnssInBaseSurveyInMode())
2680+ // return (true); // No changes needed
26542681
26552682 _zed->setVal8 (UBLOX_CFG_TMODE_MODE, 0 , VAL_LAYER_ALL); // Disable survey-in mode
26562683 delay (100 );
0 commit comments