From e3448466411c6afbcdda035237fb82ea009fbfc6 Mon Sep 17 00:00:00 2001 From: iefomit Date: Tue, 24 Feb 2026 18:07:23 -0800 Subject: [PATCH] small cleanup --- src/main/java/frc/robot/RobotContainer.java | 4 ++-- .../frc/robot/commands/gpm/ReverseMotors.java | 2 -- .../controls/PS5ControllerDriverConfig.java | 23 ++++++++++++++----- .../util/TrenchAssist/TrenchAssist2.java | 9 ++++---- .../TrenchAssist/TrenchAssistConstants.java | 10 ++++---- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a9b8670..bbe567d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -100,11 +100,11 @@ public class RobotContainer { case SwerveCompetition: // AKA "Vantage" case BetaBot: // AKA "Pancake" - //vision = new Vision(VisionConstants.APRIL_TAG_CAMERAS); + // vision = new Vision(VisionConstants.APRIL_TAG_CAMERAS); // fall-through case Vivace: - //linearClimb = new LinearClimb(); + // linearClimb = new LinearClimb(); case Phil: // AKA "IHOP" diff --git a/src/main/java/frc/robot/commands/gpm/ReverseMotors.java b/src/main/java/frc/robot/commands/gpm/ReverseMotors.java index b85c9d9..60cb84e 100644 --- a/src/main/java/frc/robot/commands/gpm/ReverseMotors.java +++ b/src/main/java/frc/robot/commands/gpm/ReverseMotors.java @@ -2,8 +2,6 @@ package frc.robot.commands.gpm; import edu.wpi.first.wpilibj2.command.Command; import frc.robot.subsystems.Intake.Intake; -import frc.robot.subsystems.shooter.Shooter; -import frc.robot.subsystems.shooter.ShooterConstants; import frc.robot.subsystems.spindexer.Spindexer; public class ReverseMotors extends Command { diff --git a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java index ccf4755..89337f1 100644 --- a/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java +++ b/src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java @@ -4,7 +4,6 @@ import java.util.function.BooleanSupplier; import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.PS5Controller.Button; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; import edu.wpi.first.wpilibj2.command.FunctionalCommand; @@ -81,11 +80,23 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig { () -> false, getDrivetrain()).withTimeout(2)); // Trench align - controller.get(PS5Button.CIRCLE).onTrue(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(true); getDrivetrain().setTrenchAlign(true);})) - .onFalse(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(false); getDrivetrain().setTrenchAlign(false);})); - - controller.get(DPad.LEFT).onTrue(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(true); getDrivetrain().setTrenchAlign(true);})) - .onFalse(new InstantCommand(() -> {getDrivetrain().setTrenchAssist(false); getDrivetrain().setTrenchAlign(false);})); + controller.get(PS5Button.CIRCLE).onTrue(new InstantCommand(() -> { + getDrivetrain().setTrenchAssist(true); + getDrivetrain().setTrenchAlign(true); + })) + .onFalse(new InstantCommand(() -> { + getDrivetrain().setTrenchAssist(false); + getDrivetrain().setTrenchAlign(false); + })); + + controller.get(DPad.LEFT).onTrue(new InstantCommand(() -> { + getDrivetrain().setTrenchAssist(true); + getDrivetrain().setTrenchAlign(true); + })) + .onFalse(new InstantCommand(() -> { + getDrivetrain().setTrenchAssist(false); + getDrivetrain().setTrenchAlign(false); + })); // Reverse motors if (intake != null && spindexer != null && shooter != null) { diff --git a/src/main/java/frc/robot/util/TrenchAssist/TrenchAssist2.java b/src/main/java/frc/robot/util/TrenchAssist/TrenchAssist2.java index 0188a0d..cd93f0d 100644 --- a/src/main/java/frc/robot/util/TrenchAssist/TrenchAssist2.java +++ b/src/main/java/frc/robot/util/TrenchAssist/TrenchAssist2.java @@ -32,17 +32,18 @@ public class TrenchAssist2 { double correctionVelocity = pid.calculate(distanceFromSlideLatitude, 0); - if (distanceFromSlideLatitude < Units.inchesToMeters(3)){ + if (distanceFromSlideLatitude < Units.inchesToMeters(3)) { correctionVelocity = 0.0; } - ChassisSpeeds horizontalSpeeds = new ChassisSpeeds(chassisSpeeds.vxMetersPerSecond, correctionVelocity, chassisSpeeds.omegaRadiansPerSecond); - var y = new Translation2d(horizontalSpeeds.vxMetersPerSecond, horizontalSpeeds.vyMetersPerSecond).rotateBy(drive.getYaw()); + var y = new Translation2d(horizontalSpeeds.vxMetersPerSecond, horizontalSpeeds.vyMetersPerSecond) + .rotateBy(drive.getYaw()); - var z = ChassisSpeeds.fromFieldRelativeSpeeds(new ChassisSpeeds(y.getX(), y.getY(), horizontalSpeeds.omegaRadiansPerSecond), + var z = ChassisSpeeds.fromFieldRelativeSpeeds( + new ChassisSpeeds(y.getX(), y.getY(), horizontalSpeeds.omegaRadiansPerSecond), drive.getYaw()); return z; diff --git a/src/main/java/frc/robot/util/TrenchAssist/TrenchAssistConstants.java b/src/main/java/frc/robot/util/TrenchAssist/TrenchAssistConstants.java index f745e2e..c6e1208 100644 --- a/src/main/java/frc/robot/util/TrenchAssist/TrenchAssistConstants.java +++ b/src/main/java/frc/robot/util/TrenchAssist/TrenchAssistConstants.java @@ -21,11 +21,11 @@ public class TrenchAssistConstants { new Rectangle2d(new Translation2d(99.99, 99.9), new Translation2d(0.0, 0.0)), }; - public static final double[] SLIDE_LATITUDES = new double[]{ - FieldConstants.FIELD_WIDTH - Units.inchesToMeters(30.0), - Units.inchesToMeters(30.0), // should be accurate, i think our field is slightly too small - // 6.550, - // 0.668, + public static final double[] SLIDE_LATITUDES = new double[] { + FieldConstants.FIELD_WIDTH - Units.inchesToMeters(30.0), + Units.inchesToMeters(30.0), // should be accurate, i think our field is slightly too small + // 6.550, + // 0.668, }; -- 2.39.5