mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated IMU
This commit is contained in:
@@ -403,7 +403,7 @@ public class SwerveDrive
|
||||
// simulated
|
||||
if (!SwerveDriveTelemetry.isSimulation)
|
||||
{
|
||||
imu.setYaw(0);
|
||||
imu.setOffset(imu.getRawRotation3d());
|
||||
} else
|
||||
{
|
||||
simIMU.setAngle(0);
|
||||
@@ -682,7 +682,7 @@ public class SwerveDrive
|
||||
|
||||
if (!SwerveDriveTelemetry.isSimulation)
|
||||
{
|
||||
imu.setYaw(swerveDrivePoseEstimator.getEstimatedPosition().getRotation().getDegrees());
|
||||
imu.setOffset(new Rotation3d(0, 0, swerveDrivePoseEstimator.getEstimatedPosition().getRotation().getRadians()));
|
||||
// Yaw reset recommended by Team 1622
|
||||
} else
|
||||
{
|
||||
@@ -691,13 +691,13 @@ public class SwerveDrive
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Gyroscope offset using a {@link Rotation3d} object. (Only yaw works currently.)
|
||||
* Set the Gyroscope offset using a {@link Rotation3d} object.
|
||||
*
|
||||
* @param gyro Gyroscope offset.
|
||||
*/
|
||||
public void setGyro(Rotation3d gyro)
|
||||
{
|
||||
imu.setYaw(gyro.getZ());
|
||||
imu.setOffset(gyro);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user