Skip to content

Commit

Permalink
more elevator and offset gyro 180
Browse files Browse the repository at this point in the history
  • Loading branch information
Isdogmc committed Feb 4, 2025
1 parent 2b1f571 commit 0239aac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/elevator/Elevator.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Elevator() {
PersistMode.kPersistParameters));
}

public void setShoulderSetpoint(Rotation2d setpoint) { // change values later
public void elevatorSetpoint(Rotation2d setpoint) { // change values later
if (setpoint.getDegrees() < -5) {
setpoint = Rotation2d.fromDegrees(-5);
} else if (setpoint.getDegrees() > 100) {
Expand Down

0 comments on commit 0239aac

Please sign in to comment.