Skip to content

Commit

Permalink
Merge pull request #20 from FRC-7525/autoAlign-bug-fix
Browse files Browse the repository at this point in the history
quick auto align bug fix
  • Loading branch information
PotmanNob authored Aug 7, 2024
2 parents 5327bbc + 27cd24a commit a8fc24c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ public Drive(

@Override
public void runState() {
// Can't run in auto otherwise it will constantly tell drive not to drive in auto (and thats not good)
if (DriverStation.isTeleop()) {
// Can't run in auto otherwise it will constantly tell drive not to drive in auto (and thats not
// good)

if (!DriverStation.isAutonomous()) AutoAlign.periodic();
if (DriverStation.isTeleop() && getState() != DriveStates.AUTO_ALIGN) {
drive(
this,
() -> Constants.controller.getLeftY(),
Expand All @@ -107,6 +110,8 @@ public void runState() {
getState().getRotationModifier(),
getState().getTranslationModifier()
);
} else if (DriverStation.isTeleop() && getState() == DriveStates.AUTO_ALIGN) {
AutoAlign.calculateChassisSpeed();
}
}

Expand Down

0 comments on commit a8fc24c

Please sign in to comment.