From 1dc8e1fb2da4850f84d8b4d010894ad39ffcb49b Mon Sep 17 00:00:00 2001 From: Ruthie Date: Wed, 19 Nov 2025 14:35:23 +0000 Subject: [PATCH] fixed formatting and issues with non ascii characters --- .../subsystems/drive/DriveConstants.java | 8 ++-- .../subsystems/drive/ModuleIOSpark.java | 2 +- .../frc/robot/outReach/RobotContainer.java | 3 +- .../outReach/subsystems/shooter/Shooter.java | 45 +++++++++---------- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/main/java/frc/robot/generic/subsystems/drive/DriveConstants.java b/src/main/java/frc/robot/generic/subsystems/drive/DriveConstants.java index 9e94410..c34f00a 100644 --- a/src/main/java/frc/robot/generic/subsystems/drive/DriveConstants.java +++ b/src/main/java/frc/robot/generic/subsystems/drive/DriveConstants.java @@ -52,12 +52,12 @@ public class DriveConstants { Stand (or imagine standing) beside the robot, facing the same direction as its absolute front. - For front wheels: - Overrotated → pointing toward the robot’s right (your left) - Underrotated → pointing toward the robot’s left (your right) + Overrotated -> pointing toward the robot's right (your left) + Underrotated -> pointing toward the robot's left (your right) - For back wheels: - Overrotated → pointing toward the robot’s right (your left) - Underrotated → pointing toward the robot’s left (your right) + Overrotated -> pointing toward the robot's right (your left) + Underrotated -> pointing toward the robot's left (your right) */ public static final Rotation2d frontLeftZeroRotation = new Rotation2d(-0.7853181997882291).minus(new Rotation2d(Degrees.of(16 + 5))); diff --git a/src/main/java/frc/robot/generic/subsystems/drive/ModuleIOSpark.java b/src/main/java/frc/robot/generic/subsystems/drive/ModuleIOSpark.java index 1a7b320..b75e367 100644 --- a/src/main/java/frc/robot/generic/subsystems/drive/ModuleIOSpark.java +++ b/src/main/java/frc/robot/generic/subsystems/drive/ModuleIOSpark.java @@ -73,7 +73,7 @@ public class ModuleIOSpark implements ModuleIO { private final Debouncer driveConnectedDebounce = new Debouncer(0.5); private final Debouncer turnConnectedDebounce = new Debouncer(0.5); - // Cached cancoder status — updated only in resetToAbsolute() + // Cached cancoder status - updated only in resetToAbsolute() private boolean lastCancoderConnected = false; private final int module; diff --git a/src/main/java/frc/robot/outReach/RobotContainer.java b/src/main/java/frc/robot/outReach/RobotContainer.java index 1cb5f33..48bbfde 100644 --- a/src/main/java/frc/robot/outReach/RobotContainer.java +++ b/src/main/java/frc/robot/outReach/RobotContainer.java @@ -31,10 +31,9 @@ import frc.robot.generic.util.LoggedTalon.NoOppTalonFX; import frc.robot.generic.util.LoggedTalon.PhoenixTalonFX; import frc.robot.generic.util.LoggedTalon.SimpleMotorSim; -import frc.robot.outReach.subsystems.turret.Turret; import frc.robot.generic.util.RobotConfig; import frc.robot.generic.util.SwerveBuilder; - +import frc.robot.outReach.subsystems.turret.Turret; import org.littletonrobotics.junction.networktables.LoggedDashboardChooser; /** diff --git a/src/main/java/frc/robot/outReach/subsystems/shooter/Shooter.java b/src/main/java/frc/robot/outReach/subsystems/shooter/Shooter.java index 0e97dd4..e98a6d8 100644 --- a/src/main/java/frc/robot/outReach/subsystems/shooter/Shooter.java +++ b/src/main/java/frc/robot/outReach/subsystems/shooter/Shooter.java @@ -3,9 +3,6 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.outReach.subsystems.shooter; -import frc.robot.generic.util.LoggedTalon.LoggedTalonFX; - -import java.util.function.DoubleSupplier; import com.ctre.phoenix6.configs.CurrentLimitsConfigs; import com.ctre.phoenix6.configs.FeedbackConfigs; @@ -13,13 +10,12 @@ import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.controls.NeutralOut; -import com.ctre.phoenix6.controls.VelocityDutyCycle; import com.ctre.phoenix6.controls.VelocityVoltage; -import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.signals.NeutralModeValue; - import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.generic.util.LoggedTalon.LoggedTalonFX; +import java.util.function.DoubleSupplier; public class Shooter extends SubsystemBase { private final LoggedTalonFX shooterMotor; @@ -28,29 +24,30 @@ public class Shooter extends SubsystemBase { /** Creates a new Torrent. */ public Shooter(LoggedTalonFX shooterMotor) { - var config = - new TalonFXConfiguration() - .withCurrentLimits( - new CurrentLimitsConfigs().withStatorCurrentLimit(30).withSupplyCurrentLimit(60)) - .withSlot0(new Slot0Configs().withKP(0).withKI(0).withKD(0).withKS(0).withKV(0)) - .withFeedback(new FeedbackConfigs().withSensorToMechanismRatio(0)) - .withMotorOutput(new MotorOutputConfigs().withNeutralMode(NeutralModeValue.Coast)); + var config = + new TalonFXConfiguration() + .withCurrentLimits( + new CurrentLimitsConfigs().withStatorCurrentLimit(30).withSupplyCurrentLimit(60)) + .withSlot0(new Slot0Configs().withKP(0).withKI(0).withKD(0).withKS(0).withKV(0)) + .withFeedback(new FeedbackConfigs().withSensorToMechanismRatio(0)) + .withMotorOutput(new MotorOutputConfigs().withNeutralMode(NeutralModeValue.Coast)); + + this.shooterMotor = shooterMotor.withConfig(config); + } - this.shooterMotor = shooterMotor.withConfig(config); + public Command spinToVelocityAndRotationsCommand(DoubleSupplier velocityRPS) { + return runEnd( + () -> { + shooterMotor.setControl(velocityPIDRequest.withVelocity(velocityRPS.getAsDouble())); + }, + () -> { + shooterMotor.setControl(neutralOut); + }); } -public Command spinToVelocityAndRotationsCommand(DoubleSupplier velocityRPS) { - return runEnd(()->{ - shooterMotor.setControl(velocityPIDRequest.withVelocity(velocityRPS.getAsDouble())); - }, ()-> { - shooterMotor.setControl(neutralOut); - }); -} - -@Override + @Override public void periodic() { // This method will be called once per scheduler run shooterMotor.periodic(); } } - \ No newline at end of file