Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
[swerve] Apply deadzone to controller (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty authored Jul 9, 2024
1 parent 2cc4a52 commit e23532d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ private void configureBindings() {
m_drivetrain.applyRequest(
() ->
drive
.withVelocityX(-m_driver.getLeftY() * Constants.DrivebaseMaxSpeed)
.withVelocityY(-m_driver.getLeftX() * Constants.DrivebaseMaxSpeed)
.withVelocityX(
Utils.deadzone(-m_driver.getLeftY() * Constants.DrivebaseMaxSpeed))
.withVelocityY(
Utils.deadzone(-m_driver.getLeftX() * Constants.DrivebaseMaxSpeed))
.withRotationalRate(
-m_driver.getRightX() * Constants.DrivebaseMaxAngularRate)));
Utils.deadzone(
-m_driver.getRightX() * Constants.DrivebaseMaxAngularRate))));

m_driver.a().whileTrue(m_drivetrain.applyRequest(() -> brake));
m_driver.x().onTrue(m_drivetrain.runOnce(() -> m_drivetrain.seedFieldRelative()));
Expand Down

0 comments on commit e23532d

Please sign in to comment.