From 97b26ce8f6b4ba08b25095d7d1de2de36c755cb8 Mon Sep 17 00:00:00 2001 From: TheRealGreydon Date: Thu, 15 Oct 2026 20:26:36 -0400 Subject: [PATCH] Ruckus --- src/main/java/frc/robot/Constants.java | 2 +- .../robot/commands/UltraShooterCommand.java | 23 ------------------- .../frc/robot/subsystems/HopperSubsystem.java | 4 ++-- .../frc/robot/subsystems/IntakeSubsystem.java | 4 ++-- .../frc/robot/subsystems/TurretSubsystem.java | 8 +++---- 5 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 5ca93ec..6ce6930 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -163,7 +163,7 @@ public final class Constants { public static final double SCORING_DISTANCE_MAX_ALLOWED_METERS = 7.0; // The maximum distance from the hub we'll allow the robot to shoot from // This is the distance increment in inches for adjusting hood angle according to distance from the target, in inches per degree: public static final double HOOD_ANGLE_CALC_DIVISION = (SCORING_DISTANCE_LONG_IN - SCORING_DISTANCE_SHORT_IN) / (HOOD_ANGLE_SCORING_MAX_DEG - HOOD_ANGLE_SCORING_MIN_DEG); - public static final double SHOOTER_EFFICIENCY_GENERAL = 0.31; // This is the baseline shooter efficiency assumption + public static final double SHOOTER_EFFICIENCY_GENERAL = 0.325; // This is the baseline shooter efficiency assumption public static final double SHOOTER_FLYWHEEL_DIAMETER_IN = 3.0; // Flywheel diameter is 3.0 inches public static final double SHOOTER_FLYWHEEL_GEAR_RATIO = 2.0; // Flywheel moves at twice the RPM of the flywheel motor public static final Angle TARGET_ELEVATION_DIF = edu.wpi.first.units.Units.Degrees.of(1); diff --git a/src/main/java/frc/robot/commands/UltraShooterCommand.java b/src/main/java/frc/robot/commands/UltraShooterCommand.java index 199a76f..08019f9 100644 --- a/src/main/java/frc/robot/commands/UltraShooterCommand.java +++ b/src/main/java/frc/robot/commands/UltraShooterCommand.java @@ -46,7 +46,6 @@ public class UltraShooterCommand extends Command{ @Override public void initialize() { - //hopperSubsystem.spindexerOn(); // Activate spindexer so it's on while command is active hopperSubsystem.stopKicker(); // Make sure kicker is off when command is called CommandScheduler.getInstance().schedule(waitCommand); // Kick off a wait timer so robot doesn't shoot until hopper is ready alliance = DriverStation.getAlliance().get(); // Fetch our alliance @@ -201,13 +200,6 @@ public class UltraShooterCommand extends Command{ hopperSubsystem.stopKicker(); } Logger.recordOutput("UltraShooter-OkToShoot", okToShoot); - - // OPTIONAL: Activate rumble if it's not ok to shoot - if (!okToShoot) { - // ACTIVATE CONTROLLER RUMBLE - } else { - // DEACTIVATE CONTROLLER RUMBLE - } } @Override @@ -218,27 +210,12 @@ public class UltraShooterCommand extends Command{ @Override public void end(boolean interrupted) { waitCommand.cancel(); - //hopperSubsystem.spindexerOff(); hopperSubsystem.stopKicker(); turretSubsystem.setLauncher(0); turretSubsystem.setTargetElevation(Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE); Logger.recordOutput("UltraShooter-State", "INACTIVE"); - - // Removed the following since we're don't setting turret targets. - /* - DriverStation.getAlliance().ifPresent((alliance) -> { - if (alliance == Alliance.Blue) { - turretSubsystem.setTurretTargetPose(Constants.FieldPoses.BLUE_HUB_POSE); - } else { - turretSubsystem.setTurretTargetPose(Constants.FieldPoses.RED_HUB_POSE); - } - }); - */ - - // turretSubsystem.setTurretMotorRotation(-0.34); // Return to 0 after MIAMI VALLEY - // TODO: Deactivate rumble if we decided to use the rumble feature when the robot prevents shooting } } diff --git a/src/main/java/frc/robot/subsystems/HopperSubsystem.java b/src/main/java/frc/robot/subsystems/HopperSubsystem.java index f345f67..e9b2436 100644 --- a/src/main/java/frc/robot/subsystems/HopperSubsystem.java +++ b/src/main/java/frc/robot/subsystems/HopperSubsystem.java @@ -78,11 +78,11 @@ public class HopperSubsystem extends TestableSubsystem { } public void spindexerOn() { - spindexerMotor.set(0.75); + spindexerMotor.set(0.6); } public void spindexerReverse() { - spindexerMotor.set(-0.75); + spindexerMotor.set(-0.6); } public void spindexerOff() { diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index a9042a6..fea92b7 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -70,7 +70,7 @@ public class IntakeSubsystem extends TestableSubsystem { public Command intake(XboxController m_XboxController) { return this.runOnce(() -> { if (intakeMotor.get() == 0) { - setSpeed(-.5); + setSpeed(-.45); m_XboxController.setRumble(RumbleType.kBothRumble, .5); } else { intakeMotor.stopMotor(); @@ -80,7 +80,7 @@ public class IntakeSubsystem extends TestableSubsystem { } public Command reverseIntake() { - return this.runEnd(() -> setSpeed(.5), () -> { + return this.runEnd(() -> setSpeed(.45), () -> { intakeMotor.stopMotor(); }); } diff --git a/src/main/java/frc/robot/subsystems/TurretSubsystem.java b/src/main/java/frc/robot/subsystems/TurretSubsystem.java index 728f06f..0c70764 100644 --- a/src/main/java/frc/robot/subsystems/TurretSubsystem.java +++ b/src/main/java/frc/robot/subsystems/TurretSubsystem.java @@ -117,8 +117,8 @@ public class TurretSubsystem extends TestableSubsystem { SparkMaxConfig config = new SparkMaxConfig().apply((SparkMaxConfig) SparkMaxConfig.Presets.REV_NEO); config.inverted(Constants.ShooterConstants.LAUNCHER_MOTOR_INVERTED); config.voltageCompensation(10); - config.closedLoop.p(0.0002).i(0.000001).d(0.0005); // I = 0.0000001 - config.closedLoop.feedForward.kS(0.2).kV(0.00005).kA(0.001); + config.closedLoop.p(0.0002).i(0.000001).d(0.0009); // I = 0.0000001 + config.closedLoop.feedForward.kS(0.2).kV(0.00009).kA(0.0001); // config.closedLoop.allowedClosedLoopError(10, ClosedLoopSlot.kSlot0); config.closedLoop.feedbackSensor(FeedbackSensor.kPrimaryEncoder); config.closedLoop.positionWrappingEnabled(false); @@ -217,9 +217,7 @@ public class TurretSubsystem extends TestableSubsystem { public void homeTurret() { - if(turretState != TurretState.INIT){ - return; - } + if(turretState != TurretState.INIT) {return;} turretMotor.set(Constants.ShooterConstants.HOMING_SPEED); turretState = TurretState.HOMING; }