Upgrading to 2025.7.2

This commit is contained in:
thenetworkgrinch
2025-03-19 03:45:47 +00:00
parent 4016ee2190
commit 65874df0b2
15 changed files with 195 additions and 149 deletions

View File

@@ -20,7 +20,7 @@ public class NavXSwerve extends SwerveIMU
/**
* Mutable {@link MutAngularVelocity} for readings.
*/
private final MutAngularVelocity yawVel = new MutAngularVelocity(0, 0, DegreesPerSecond);
private final MutAngularVelocity yawVel = new MutAngularVelocity(0, 0, DegreesPerSecond);
/**
* NavX IMU.
*/
@@ -28,15 +28,15 @@ public class NavXSwerve extends SwerveIMU
/**
* Offset for the NavX.
*/
private Rotation3d offset = new Rotation3d();
/**
* Inversion for the gyro
*/
private boolean invertedIMU = false;
private Rotation3d offset = new Rotation3d();
/**
* An {@link Alert} for if there is an error instantiating the NavX.
*/
private Alert navXError;
/**
* Inversion state of the {@link AHRS}.
*/
private boolean inverted = false;
/**
* Constructor for the NavX({@link AHRS}) swerve.
@@ -61,7 +61,8 @@ public class NavXSwerve extends SwerveIMU
}
@Override
public void close() {
public void close()
{
imu.close();
}
@@ -101,8 +102,8 @@ public class NavXSwerve extends SwerveIMU
*/
public void setInverted(boolean invertIMU)
{
invertedIMU = invertIMU;
setOffset(getRawRotation3d());
inverted = invertIMU;
// setOffset(getRawRotation3d());
}
/**
@@ -113,7 +114,7 @@ public class NavXSwerve extends SwerveIMU
@Override
public Rotation3d getRawRotation3d()
{
return invertedIMU ? imu.getRotation3d().unaryMinus() : imu.getRotation3d();
return inverted ? imu.getRotation3d().unaryMinus() : imu.getRotation3d();
}
/**
@@ -124,7 +125,7 @@ public class NavXSwerve extends SwerveIMU
@Override
public Rotation3d getRotation3d()
{
return getRawRotation3d().minus(offset);
return getRawRotation3d().rotateBy(offset.unaryMinus());
}
/**