Updated YAGSL to remove misconception of IEEERemainder

This commit is contained in:
thenetworkgrinch
2023-02-27 21:59:12 -06:00
parent ef58f545df
commit 9b78c6363f
117 changed files with 137 additions and 161 deletions

View File

@@ -47,7 +47,7 @@ public class NavXSwerve extends SwerveIMU
public void factoryDefault()
{
// gyro.reset(); // Reported to be slow
yawOffset = Math.IEEEremainder(gyro.getYaw(), 360);
yawOffset = gyro.getYaw() % 360;
}
/**
@@ -67,7 +67,7 @@ public class NavXSwerve extends SwerveIMU
public void setYaw(double yaw)
{
// gyro.reset(); // Reported to be slow using the offset.
yawOffset = Math.IEEEremainder(yaw, 360) + Math.IEEEremainder(gyro.getYaw(), 360);
yawOffset = (yaw % 360) + (gyro.getYaw() % 360);
}
/**
@@ -79,9 +79,9 @@ public class NavXSwerve extends SwerveIMU
public void getYawPitchRoll(double[] yprArray)
{
yprArray[0] = (Math.IEEEremainder(gyro.getYaw(), 360)) - yawOffset;
yprArray[1] = Math.IEEEremainder(gyro.getPitch(), 360);
yprArray[2] = Math.IEEEremainder(gyro.getRoll(), 360);
yprArray[0] = (gyro.getYaw() % 360) - yawOffset;
yprArray[1] = (gyro.getPitch() % 360);
yprArray[2] = (gyro.getRoll() % 360);
}
/**