Skip to content

Commit

Permalink
more elevator and offset gyro 180
Browse files Browse the repository at this point in the history
(cherry picked from commit 0239aac)
  • Loading branch information
TylerSeiford committed Feb 4, 2025
1 parent 5c41766 commit 2c15353
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class Drive extends SubsystemBase {
private final GyroIOInputsAutoLogged gyroInputs = new GyroIOInputsAutoLogged();
private final Module[] modules = new Module[4]; // FL, FR, BL, BR
private final SysIdRoutine sysId;
private final Rotation2d gyroOffSet = Rotation2d.fromDegrees(180);
private final Alert gyroDisconnectedAlert =
new Alert("Disconnected gyro, using kinematics as fallback.", AlertType.kError);

Expand Down Expand Up @@ -167,7 +168,7 @@ public void periodic() {
// Update gyro angle
if (gyroInputs.connected) {
// Use the real gyro angle
rawGyroRotation = gyroInputs.odometryYawPositions[i];
rawGyroRotation = gyroInputs.odometryYawPositions[i].plus(gyroOffSet);
} else {
// Use the angle delta from the kinematics and module deltas
Twist2d twist = kinematics.toTwist2d(moduleDeltas);
Expand Down

0 comments on commit 2c15353

Please sign in to comment.