mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to 2024
This commit is contained in:
@@ -96,10 +96,7 @@ public class NavXSwerve extends SwerveIMU
|
||||
public void factoryDefault()
|
||||
{
|
||||
// gyro.reset(); // Reported to be slow
|
||||
offset = new Rotation3d(new Quaternion(gyro.getQuaternionW(),
|
||||
gyro.getQuaternionX(),
|
||||
gyro.getQuaternionY(),
|
||||
gyro.getQuaternionZ()));
|
||||
offset = gyro.getRotation3d();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,13 +122,10 @@ public class NavXSwerve extends SwerveIMU
|
||||
*
|
||||
* @return {@link Rotation3d} from the IMU.
|
||||
*/
|
||||
@Override
|
||||
public Rotation3d getRawRotation3d()
|
||||
{
|
||||
return new Rotation3d(new Quaternion(gyro.getQuaternionW() * 0.5,
|
||||
gyro.getQuaternionX() * 0.5,
|
||||
gyro.getQuaternionY() * 0.5,
|
||||
gyro.getQuaternionZ() *
|
||||
0.5)); // TODO: Remove when Studica's official release is made.
|
||||
return gyro.getRotation3d();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +136,7 @@ public class NavXSwerve extends SwerveIMU
|
||||
@Override
|
||||
public Rotation3d getRotation3d()
|
||||
{
|
||||
return getRawRotation3d().minus(offset);
|
||||
return gyro.getRotation3d().minus(offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user