Skip to content

Commit d782ce2

Browse files
committed
Fix inverse logic with ECEF vs Geodetic coords in AP config
1 parent 6190c94 commit d782ce2

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

Firmware/RTK_Surveyor/Base.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ bool startFixedBase()
164164
maxWait
165165
); //With high precision 0.1mm parts
166166
}
167-
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEOGRAPHIC)
167+
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
168168
{
169169
//Break coordinates into main and high precision parts
170170
//The type casting should not effect rounding of original double cast coordinate

Firmware/RTK_Surveyor/Form.ino

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,21 @@ void createSettingsString(char* settingsCSV)
306306
stringRecord(settingsCSV, "baseTypeFixed", settings.fixedBase);
307307
stringRecord(settingsCSV, "observationSeconds", settings.observationSeconds);
308308
stringRecord(settingsCSV, "observationPositionAccuracy", settings.observationPositionAccuracy, 2);
309-
stringRecord(settingsCSV, "fixedBaseCoordinateTypeECEF", !settings.fixedBaseCoordinateType); //COORD_TYPE_ECEF = 0
309+
310+
if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
311+
{
312+
stringRecord(settingsCSV, "fixedBaseCoordinateTypeECEF", true);
313+
stringRecord(settingsCSV, "fixedBaseCoordinateTypeGeo", false);
314+
}
315+
else
316+
{
317+
stringRecord(settingsCSV, "fixedBaseCoordinateTypeECEF", false);
318+
stringRecord(settingsCSV, "fixedBaseCoordinateTypeGeo", true);
319+
}
320+
310321
stringRecord(settingsCSV, "fixedEcefX", settings.fixedEcefX, 3);
311322
stringRecord(settingsCSV, "fixedEcefY", settings.fixedEcefY, 3);
312323
stringRecord(settingsCSV, "fixedEcefZ", settings.fixedEcefZ, 3);
313-
stringRecord(settingsCSV, "fixedBaseCoordinateTypeGeo", settings.fixedBaseCoordinateType);
314324
stringRecord(settingsCSV, "fixedLat", settings.fixedLat, 9);
315325
stringRecord(settingsCSV, "fixedLong", settings.fixedLong, 9);
316326
stringRecord(settingsCSV, "fixedAltitude", settings.fixedAltitude, 4);
@@ -363,10 +373,6 @@ void createSettingsString(char* settingsCSV)
363373
strcat(settingsCSV, "\0");
364374
Serial.printf("settingsCSV len: %d\n\r", strlen(settingsCSV));
365375

366-
//Upon AP load, Survey In is always checked.
367-
//Sometimes, (perhaps if fixed should be checked) fixed area is left enabled. Check main.js for correct disable of baseTypeFixed if fixedBase = false
368-
369-
370376
//Is baseTypeSurveyIn 1 or 0
371377
Serial.printf("settingsCSV: %s\n\r", settingsCSV);
372378
}
@@ -396,7 +402,7 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
396402
else if (strcmp(settingName, "observationPositionAccuracy") == 0)
397403
settings.observationPositionAccuracy = settingValue;
398404
else if (strcmp(settingName, "fixedBaseCoordinateTypeECEF") == 0)
399-
settings.fixedBaseCoordinateType = settingValueBool;
405+
settings.fixedBaseCoordinateType = !settingValueBool; //When ECEF is true, fixedBaseCoordinateType = 0 (COORD_TYPE_ECEF)
400406
else if (strcmp(settingName, "fixedEcefX") == 0)
401407
settings.fixedEcefX = settingValue;
402408
else if (strcmp(settingName, "fixedEcefY") == 0)
@@ -469,7 +475,7 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
469475
factoryReset();
470476
else if (strcmp(settingName, "exitAndReset") == 0)
471477
{
472-
if(newAPSettings == true) recordSystemSettings(); //If we've recieved settings, record before restart
478+
if (newAPSettings == true) recordSystemSettings(); //If we've recieved settings, record before restart
473479

474480
ESP.restart();
475481
}
@@ -597,7 +603,7 @@ bool parseIncomingSettings()
597603
headPtr = commaPtr + 1;
598604
}
599605

600-
//Serial.printf("settingName: %s value: %s\n\r", settingName, valueStr);
606+
Serial.printf("settingName: %s value: %s\n\r", settingName, valueStr);
601607

602608
//Ignore zero length values (measurementRateSec) received from browser
603609
if (strlen(valueStr) > 0)

Firmware/RTK_Surveyor/form.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
575575
ge("fixedEcefX").disabled = false;
576576
ge("fixedEcefY").disabled = false;
577577
ge("fixedEcefZ").disabled = false;
578-
//Disable Geographic inputs
578+
//Disable Geodetic inputs
579579
ge("fixedLat").disabled = true;
580580
ge("fixedLong").disabled = true;
581581
ge("fixedAltitude").disabled = true;
@@ -585,7 +585,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
585585
ge("fixedEcefX").disabled = true;
586586
ge("fixedEcefY").disabled = true;
587587
ge("fixedEcefZ").disabled = true;
588-
//Disable Geographic inputs
588+
//Disable Geodetic inputs
589589
ge("fixedLat").disabled = false;
590590
ge("fixedLong").disabled = false;
591591
ge("fixedAltitude").disabled = false;
@@ -600,7 +600,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
600600
ge("fixedEcefX").disabled = false;
601601
ge("fixedEcefY").disabled = false;
602602
ge("fixedEcefZ").disabled = false;
603-
//Disable Geographic inputs
603+
//Disable Geodetic inputs
604604
ge("fixedLat").disabled = true;
605605
ge("fixedLong").disabled = true;
606606
ge("fixedAltitude").disabled = true;
@@ -610,7 +610,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
610610
ge("fixedEcefX").disabled = true;
611611
ge("fixedEcefY").disabled = true;
612612
ge("fixedEcefZ").disabled = true;
613-
//Disable Geographic inputs
613+
//Disable Geodetic inputs
614614
ge("fixedLat").disabled = false;
615615
ge("fixedLong").disabled = false;
616616
ge("fixedAltitude").disabled = false;
@@ -624,7 +624,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
624624
ge("fixedEcefX").disabled = true;
625625
ge("fixedEcefY").disabled = true;
626626
ge("fixedEcefZ").disabled = true;
627-
//Enable Geographic inputs
627+
//Enable Geodetic inputs
628628
ge("fixedLat").disabled = false;
629629
ge("fixedLong").disabled = false;
630630
ge("fixedAltitude").disabled = false;
@@ -634,7 +634,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
634634
ge("fixedEcefX").disabled = false;
635635
ge("fixedEcefY").disabled = false;
636636
ge("fixedEcefZ").disabled = false;
637-
//Disable Geographic inputs
637+
//Disable Geodetic inputs
638638
ge("fixedLat").disabled = true;
639639
ge("fixedLong").disabled = true;
640640
ge("fixedAltitude").disabled = true;

Firmware/RTK_Surveyor/menuBase.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void menuBase()
1717
{
1818
Serial.print(F("2) Toggle Coordinate System: "));
1919
if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF) Serial.println(F("ECEF"));
20-
else Serial.println(F("Geographic"));
20+
else Serial.println(F("Geodetic"));
2121

2222
if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
2323
{
@@ -29,7 +29,7 @@ void menuBase()
2929
Serial.print(settings.fixedEcefZ, 4);
3030
Serial.println(F("m"));
3131
}
32-
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEOGRAPHIC)
32+
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
3333
{
3434
Serial.print(F("3) Set Lat/Long/Altitude coordinates: "));
3535
Serial.print(settings.fixedLat, 9);
@@ -115,7 +115,7 @@ void menuBase()
115115
}
116116
}
117117
}
118-
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEOGRAPHIC)
118+
else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEODETIC)
119119
{
120120
Serial.println(F("Enter the fixed Lat/Long/Altitude coordinates that will be used in Base mode:"));
121121

Firmware/RTK_Surveyor/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typedef enum muxConnectionType_e
6767
typedef enum
6868
{
6969
COORD_TYPE_ECEF = 0,
70-
COORD_TYPE_GEOGRAPHIC,
70+
COORD_TYPE_GEODETIC,
7171
} coordinateType_e;
7272

7373
//User can select output pulse as either falling or rising edge

0 commit comments

Comments
 (0)