Skip to content

Commit 1d58830

Browse files
committed
Change accel axis for Facet.
1 parent 5bf070e commit 1d58830

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void displaySplash()
140140
printTextCenter("Facet", yPos, 1, 1, false);
141141
}
142142

143-
yPos = yPos + fontHeight + 9;
143+
yPos = yPos + fontHeight + 7;
144144
char unitFirmware[50];
145145
sprintf(unitFirmware, "v%d.%d", FIRMWARE_VERSION_MAJOR, FIRMWARE_VERSION_MINOR);
146146
printTextCenter(unitFirmware, yPos, 0, 1, false);
@@ -1362,11 +1362,28 @@ void getAngles()
13621362
{
13631363
while (accel.available() == false) delay(1);
13641364

1365-
float accelX = accel.getX();
1366-
float accelZ = accel.getY();
1367-
float accelY = accel.getZ();
1368-
accelZ *= -1.0;
1369-
accelX *= -1.0;
1365+
float accelX;
1366+
float accelZ;
1367+
float accelY;
1368+
1369+
//Express Accel orientation is different from Facet
1370+
if (productVariant == RTK_EXPRESS || productVariant == RTK_EXPRESS_PLUS)
1371+
{
1372+
accelX = accel.getX();
1373+
accelZ = accel.getY();
1374+
accelY = accel.getZ();
1375+
accelZ *= -1.0;
1376+
accelX *= -1.0;
1377+
}
1378+
else if (productVariant == RTK_FACET)
1379+
{
1380+
accelZ = accel.getX();
1381+
accelX = accel.getY();
1382+
accelY = accel.getZ();
1383+
accelZ *= -1.0;
1384+
accelY *= -1.0;
1385+
accelX *= -1.0;
1386+
}
13701387

13711388
double roll = atan2(accelY , accelZ) * 57.3;
13721389
double pitch = atan2((-accelX) , sqrt(accelY * accelY + accelZ * accelZ)) * 57.3;

Firmware/RTK_Surveyor/Rover.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void updateAccuracyLEDs()
233233
{
234234
lastAccuracyLEDUpdate = millis();
235235

236-
uint32_t accuracy = i2cGNSS.getHorizontalAccuracy(250);
236+
uint32_t accuracy = i2cGNSS.getHorizontalAccuracy();
237237

238238
if (accuracy > 0)
239239
{

0 commit comments

Comments
 (0)