Skip to content

Commit

Permalink
Add field rel trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenTomato5 committed Oct 7, 2024
1 parent f74061b commit 7a3db9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/frc/robot/subsystems/drive/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class Drive extends Subsystem<DriveStates> {
private double lastHeadingRadians;
private PIDController headingCorrectionController;
private boolean headingCorrectionEnabled;
private boolean fieldRelative = true;

private SwerveDriveKinematics kinematics = new SwerveDriveKinematics(getModuleTranslations());
private Rotation2d rawGyroRotation = new Rotation2d();
Expand Down Expand Up @@ -129,13 +130,17 @@ public void runState() {
getState().getRotationModifier(),
getState().getTranslationModifier(),
headingCorrectionEnabled,
false
fieldRelative
);
}

if (Constants.controller.getStartButtonPressed()) {
zeroGryo();
}

if (Constants.controller.getBackButtonPressed()) {
fieldRelative = !fieldRelative;
}
}

// L code??? (taken from AA) good enough
Expand Down

0 comments on commit 7a3db9d

Please sign in to comment.