From a05791747862d2be50dc0f224bd544f274ce8129 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Thu, 13 Aug 2026 17:36:49 -0700 Subject: [PATCH 1/8] hw 5 --- .../frc/robot/subsystems/ArmSubsystem.java | 100 ++++++++++++++++++ .../robot/subsystems/ShooterSubsystem.java | 73 ++++++++----- 2 files changed, 145 insertions(+), 28 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/ArmSubsystem.java diff --git a/src/main/java/frc/robot/subsystems/ArmSubsystem.java b/src/main/java/frc/robot/subsystems/ArmSubsystem.java new file mode 100644 index 0000000..61750f7 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/ArmSubsystem.java @@ -0,0 +1,100 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.subsystems; + +import com.ctre.phoenix6.configs.CurrentLimitsConfigs; +import com.ctre.phoenix6.configs.MotorOutputConfigs; +import com.ctre.phoenix6.configs.TalonFXConfiguration; +import com.ctre.phoenix6.configs.TalonFXConfigurator; +import com.ctre.phoenix6.controls.DutyCycleOut; +import com.ctre.phoenix6.controls.TorqueCurrentFOC; +import com.ctre.phoenix6.controls.VoltageOut; +import com.ctre.phoenix6.hardware.TalonFX; +import com.ctre.phoenix6.signals.InvertedValue; +import com.ctre.phoenix6.signals.NeutralModeValue; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; + + + +public class ArmSubsystem extends SubsystemBase { + private TalonFX armMotor, rollerMotor; + + + private final DutyCycleOut m_dutyCycleRequest = new DutyCycleOut(0.0); + private final VoltageOut m_voltageRequest = new VoltageOut(0.0); + private final TorqueCurrentFOC m_torqueRequest = new TorqueCurrentFOC(0.0); + + public ArmSubsystem() { + armMotor = new TalonFX(Constants.Arm.ARM_MOTOR_ID); + rollerMotor = new TalonFX(Constants.Arm.ROLLER_MOTOR_ID); + + CurrentLimitsConfigs rollerClc = + new CurrentLimitsConfigs() + .withStatorCurrentLimit(50) + .withStatorCurrentLimitEnable(true) + .withSupplyCurrentLimit(30) + .withSupplyCurrentLimitEnable(true); + + CurrentLimitsConfigs armClc = + new CurrentLimitsConfigs() + .withStatorCurrentLimit(100) + .withStatorCurrentLimitEnable(true) + .withSupplyCurrentLimit(50) + .withSupplyCurrentLimitEnable(true); + + MotorOutputConfigs rollerMotorOutputConfigs = + new MotorOutputConfigs() + .withInverted(InvertedValue.CounterClockwise_Positive) + .withNeutralMode(NeutralModeValue.Coast); + + MotorOutputConfigs armMotorOutputConfigs = + new MotorOutputConfigs() + .withInverted(InvertedValue.CounterClockwise_Positive) + .withNeutralMode(NeutralModeValue.Brake); + + TalonFXConfiguration rollerConfig = + new TalonFXConfiguration() + .withCurrentLimits(rollerClc) + .withMotorOutput(rollerMotorOutputConfigs); + + TalonFXConfiguration armConfig = + new TalonFXConfiguration() + .withCurrentLimits(armClc) + .withMotorOutput(armMotorOutputConfigs); + + TalonFXConfigurator rollerConfigurator = rollerMotor.getConfigurator(); + TalonFXConfigurator armConfigurator = armMotor.getConfigurator(); + + rollerConfigurator.apply(rollerConfig); + armConfigurator.apply(armConfig); + + } + + + + public void setRollerDutyCycle(double output) { + rollerMotor.setControl(m_dutyCycleRequest.withOutput(output)); + } + + public void setRollerVoltage(double volts) { + rollerMotor.setControl(m_voltageRequest.withOutput(volts)); + } + + public void setArmTorqueCurrent(double currentAmps) { + armMotor.setControl(m_torqueRequest.withOutput(currentAmps)); + } + + @Override + public void periodic() { + // This method will be called once per scheduler run + } + + @Override + public void simulationPeriodic() { + // This method will be called once per scheduler run during simulation + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index ee6829c..e035771 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -3,13 +3,20 @@ import static edu.wpi.first.units.Units.Rotations; import com.ctre.phoenix6.CANBus; import com.ctre.phoenix6.configs.CANcoderConfiguration; +import com.ctre.phoenix6.configs.CurrentLimitsConfigs; import com.ctre.phoenix6.configs.FeedbackConfigs; import com.ctre.phoenix6.configs.MagnetSensorConfigs; +import com.ctre.phoenix6.configs.MotorOutputConfigs; +import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.controls.Follower; +import com.ctre.phoenix6.controls.PositionVoltage; +import com.ctre.phoenix6.controls.VelocityVoltage; import com.ctre.phoenix6.hardware.CANcoder; import com.ctre.phoenix6.signals.FeedbackSensorSourceValue; +import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.MotorAlignmentValue; +import com.ctre.phoenix6.signals.NeutralModeValue; import com.ctre.phoenix6.signals.SensorDirectionValue; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -22,11 +29,11 @@ public class ShooterSubsystem extends SubsystemBase { private final LoggedTalonFX warmup1, warmup2, warmup3, shooter, hood; private final CANcoder hoodEncoder; + VelocityVoltage mVelocityVoltage = new VelocityVoltage(0.0); + PositionVoltage mPositionVoltage = new PositionVoltage(0.0); - /* - * make instance variables for necessary closed loop control requests: VelocityVoltage, PositionVoltage. Initialize them with value 0.0. - * make instance variables of type double for the target roller speed and target hood angle - */ + double targetRoller; + double targetAngle; public ShooterSubsystem() { // The canbus is a communication system that can connect devices like the roboRIO, pdh, and motors. @@ -39,30 +46,32 @@ public ShooterSubsystem() { shooter = warmup3; // warmup1 and warmup2 will be set as "followers" of the "lead" warmup3, so later we can just reference the `shooter` variable - // Initialize the hood motor just like the warmup motors. You can find the necessary ID in Constants. - - // Create a variable of type Slot0Configs called rollersSlot0Configs, and initialize it with the pid and feedforward gains found in Constants - - // Create a variable of type CurrentLimitsConfigs called rollersClConfigs, and initialize it with the stator and supply limits found in Constants - - // Create a variable of type MotorOutputConifigs called rollersOutputConfigs, and initialize it to treat clockwise as positive, and neutral mode as coast - - TalonFXConfiguration rollersConfig = new TalonFXConfiguration(); - // Set the Slot0, CurrentLimits, and MotorOutput parameters of `rollersConfig` to the configs you just created. - - warmup1.getConfigurator().apply(rollersConfig); - // I just applied the configuration that you just created to warmup1. Apply it to warmup2 and warmup3 as well. + hood = new LoggedTalonFX("Hood", Constants.Shooter.Hood.HOOD_ID, canbus); + Follower follower = new Follower(Constants.Shooter.Rollers.WARMUP_3_ID, MotorAlignmentValue.Aligned); - // use the `setControl` method of warmup1 and 2 to configure them to use this follower configuration. + warmup1.setControl(follower); + warmup2.setControl(follower); + hoodEncoder = new CANcoder(Constants.Shooter.Hood.ENCODER_PORT, Constants.Swerve.CAN_BUS); - // Create a variable of type Slot0Configs called hoodSlot0Configs, and initialize it with the pid and feedforward gains found in Constants - - // Create a variable of type CurrentLimitsConfigs called hoodClConfigs, and initialize it with the stator and supply limits found in Constants - - // Create a variable of type MotorOutputConifigs called hoodOutputConfigs, and initialize it to treat counterclockwise as positive, and neutral mode as coast + Slot0Configs rollersSlot0Configs = new Slot0Configs(); + rollersSlot0Configs.kP = Constants.Shooter.Rollers.KP; + rollersSlot0Configs.kI = Constants.Shooter.Rollers.KI; + rollersSlot0Configs.kD = Constants.Shooter.Rollers.KD; + rollersSlot0Configs.kV = Constants.Shooter.Rollers.KV; + rollersSlot0Configs.kS = Constants.Shooter.Rollers.KS; + + CurrentLimitsConfigs rollersCLConfigs = new CurrentLimitsConfigs(); + rollersCLConfigs.StatorCurrentLimit = Constants.Shooter.Rollers.STATOR_CURRENT_LIMIT; + rollersCLConfigs.StatorCurrentLimitEnable = true; + rollersCLConfigs.SupplyCurrentLimit = Constants.Shooter.Rollers.SUPPLY_CURRENT_LIMIT; + rollersCLConfigs.SupplyCurrentLimitEnable = true; + + MotorOutputConfigs rollersOutputConfigs = new MotorOutputConfigs(); + rollersOutputConfigs.Inverted = InvertedValue.Clockwise_Positive; + rollersOutputConfigs.NeutralMode = NeutralModeValue.Coast; FeedbackConfigs hoodFeedbackConfigs = new FeedbackConfigs() @@ -71,10 +80,19 @@ public ShooterSubsystem() { .withSensorToMechanismRatio(Constants.Shooter.Hood.ENCODER_ROTS_PER_HOOD_ROT) .withRotorToSensorRatio(Constants.Shooter.Hood.MOTOR_ROTS_PER_ENCODER_ROT); - // Create a TalonFXConfiguration called hoodConfig - // Set the Slot0, CurrentLimits, MotorOutput, and Feedback parameters to the device configs above + TalonFXConfiguration rollersConfig = new TalonFXConfiguration(); + TalonFXConfiguration hoodConfig = new TalonFXConfiguration(); + hoodConfig.Slot0 = hoodSlot0Configs; + hoodConfig.CurrentLimits = hoodClConfigs; + hoodConfig.MotorOutput = hoodOutputConfigs; + + rollersConfig.Slot0 = rollersSlot0Configs; + rollersConfig.CurrentLimits = rollersCLConfigs; + rollersConfig.MotorOutput = rollersOutputConfigs; - // Apply the created configuration to the hood motor + warmup1.getConfigurator().apply(rollersConfig); + warmup2.getConfigurator().apply(rollersConfig); + warmup3.getConfigurator().apply(rollersConfig); MagnetSensorConfigs hoodCANcoderConfig = new CANcoderConfiguration() @@ -82,7 +100,6 @@ public ShooterSubsystem() { .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive) .withMagnetOffset(Rotations.of(Constants.Shooter.Hood.ENCODER_OFFSET)); - // Apply this config to the `hoodEncoder`. Notice how applying a device configuration is similar between motors and other devices - + hoodEncoder.getConfigurator().apply(hoodCANcoderConfig); } } From 9fdcd614e7644961180b45ac7732f44bed777cdc Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Mon, 24 Aug 2026 17:23:37 -0700 Subject: [PATCH 2/8] hw 6 --- .../robot/commandGroups/ShootCommandGroups/ShootBasicHood.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java diff --git a/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java b/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java new file mode 100644 index 0000000..e69de29 From ed360fd122aea94cdf558c75637c0f87da4fc1ec Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Mon, 24 Aug 2026 19:20:42 -0700 Subject: [PATCH 3/8] changes --- src/main/java/frc/robot/Constants.java | 3 + src/main/java/frc/robot/RobotContainer.java | 56 ++--- .../ShootCommandGroups/ShootBasicHood.java | 19 ++ .../frc/robot/subsystems/ArmSubsystem.java | 4 +- .../robot/subsystems/ShooterSubsystem.java | 218 +++++++++++------- 5 files changed, 181 insertions(+), 119 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index fe1260d..3786291 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -730,6 +730,9 @@ public static final class Hood { public static final double MIN_HOOD_POSITION = 3.8; public static final double MAX_HOOD_POSITION = 18.369; + public static final double MIN_HOOD_ANGLE = 3.8; + public static final double MAX_HOOD_ANGLE = 18.369; + public static double ENCODER_OFFSET = 0.296; // TODO public static final int ENCODER_PORT = 18; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9760900..dba5e79 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -14,6 +14,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import frc.robot.commandGroups.ShootCommandGroups.ShootBasicHood; // * KEEP FOR WIN COMMAND TESTING import frc.robot.commandGroups.ShootCommandGroups.ShootPassing; import frc.robot.commandGroups.ShootCommandGroups.ShootWithAim; @@ -50,7 +51,7 @@ public class RobotContainer { Constants.hopperOnRobot ? new HopperSubsystem(drivetrain, redside) : null; public final IntakeSubsystem intakeSubsystem = Constants.intakeOnRobot ? new IntakeSubsystem() : null; - + public final ShooterSubsystem shooterSubsystem = new ShooterSubsystem(); // private final AutoRoutines autoRoutines; // private final AutoChooser autoChooser; @@ -152,48 +153,25 @@ private void configureBindings() { hopperSubsystem.runHopperUntilInterruptedCommand( -Constants.Hopper.TARGET_SURFACE_SPEED_MPS))); - // * KEEP FOR WIN COMMAND - // joystick - // .a() - // .whileTrue( - // new DriveToAndShoot( - // () -> (new Pose2d(new Translation2d(3.0, 5.0), new Rotation2d())), - // lebron, - // intakeSubsystem, - // hopperSubsystem, - // drivetrain, - // redside)); - - // joystick - // .a() - // .whileTrue( - // new DriveToPose( - // drivetrain, - // () -> - // new Pose2d( - // new Translation2d(2.462480068206787, 2.26101016998291), new - // Rotation2d()))); - - // * KEEP FOR INTERMAP TESTING - // joystick - // .rightTrigger() - // .whileTrue( - // lebron - // .shootAtSpeedHoodCommand(() -> shooterSpeed, () -> hoodAngle) - // .alongWith(Commands.waitUntil(lebron::isAtSpeed).andThen - // - // (hopperSubsystem.runHopperUntilInterruptedCommand().alongWith(Commands.waitSeconds(0.4).andThen(intakeSubsystem.powerRetractRollersCommand()))))); + // Shooter + shooterSubsystem.setDefaultCommand(shooterSubsystem.runOnce(shooterSubsystem::stopShooter)); + + joystick + .rightBumper() + .whileTrue( + new ShootBasicHood( + 44.2, Constants.Shooter.Hood.MIN_HOOD_ANGLE, shooterSubsystem)); + + joystick + .rightTrigger() + .whileTrue( + new ShootBasicHood( + 58.2, Constants.Shooter.Hood.MAX_HOOD_ANGLE, shooterSubsystem)); secondController.intakeOverride().whileTrue(intakeSubsystem.retractIntakeCommand()); // Hopper hopperSubsystem.setDefaultCommand(hopperSubsystem.run(hopperSubsystem::stop)); - - // * KEEP FOR INTERMAP TESTING - // joystick.x().onTrue(new InstantCommand(() -> hoodAngle+=0.2)); - // joystick.y().onTrue(new InstantCommand(() -> hoodAngle-=0.2)); - // joystick.a().onTrue(new InstantCommand(() -> shooterSpeed+=0.5)); - // joystick.b().onTrue(new InstantCommand(() -> shooterSpeed-=0.5)); } public static boolean isRedAlliance() { @@ -227,4 +205,4 @@ public boolean inAllianceSide() { // public Command getAutonomousCommand() { // return autoChooser.selectedCommand(); // } -} +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java b/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java index e69de29..e1a9217 100644 --- a/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java +++ b/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java @@ -0,0 +1,19 @@ +package frc.robot.commandGroups.ShootCommandGroups; + +import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; + +import frc.robot.subsystems.ShooterSubsystem; + +public class ShootBasicHood extends ParallelCommandGroup { + + public ShootBasicHood( + double speed, + double hoodAngle, + ShooterSubsystem shooterSubsystem + ) { + addCommands( + shooterSubsystem.shootWithHood(speed, hoodAngle) + // shootWithHood runs continuously and updates speed and angle + ); + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/ArmSubsystem.java b/src/main/java/frc/robot/subsystems/ArmSubsystem.java index 61750f7..2316257 100644 --- a/src/main/java/frc/robot/subsystems/ArmSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ArmSubsystem.java @@ -29,8 +29,8 @@ public class ArmSubsystem extends SubsystemBase { private final TorqueCurrentFOC m_torqueRequest = new TorqueCurrentFOC(0.0); public ArmSubsystem() { - armMotor = new TalonFX(Constants.Arm.ARM_MOTOR_ID); - rollerMotor = new TalonFX(Constants.Arm.ROLLER_MOTOR_ID); + armMotor = new TalonFX(Constants.Intake.Arm.ARM_MOTOR_ID); + rollerMotor = new TalonFX(Constants.Intake.Rollers.ROLLER_MOTOR_ID); CurrentLimitsConfigs rollerClc = new CurrentLimitsConfigs() diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index e035771..7223687 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -1,6 +1,7 @@ package frc.robot.subsystems; import static edu.wpi.first.units.Units.Rotations; + import com.ctre.phoenix6.CANBus; import com.ctre.phoenix6.configs.CANcoderConfiguration; import com.ctre.phoenix6.configs.CurrentLimitsConfigs; @@ -19,87 +20,148 @@ import com.ctre.phoenix6.signals.NeutralModeValue; import com.ctre.phoenix6.signals.SensorDirectionValue; +import edu.wpi.first.math.MathUtil; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; import frc.robot.util.LoggedTalonFX; - public class ShooterSubsystem extends SubsystemBase { + + private final LoggedTalonFX warmup1; + private final LoggedTalonFX warmup2; + private final LoggedTalonFX warmup3; + private final LoggedTalonFX shooter; + private final LoggedTalonFX hood; + private final CANcoder hoodEncoder; + + private final VelocityVoltage velocityVoltage = new VelocityVoltage(0.0); + private final PositionVoltage positionVoltage = new PositionVoltage(0.0); + private double targetShooterSpeed = 0.0; + private double targetHoodAngle = 0.0; + + public void setHoodAngle(double degrees) { + targetHoodAngle = degrees; + hood.setControl( + positionVoltage.withPosition( + MathUtil.clamp( + degrees, + Constants.Shooter.Hood.MIN_HOOD_ANGLE, + Constants.Shooter.Hood.MAX_HOOD_ANGLE + ) / 360.0 + ) + ); + } + + public void setShooterSpeed(double velocityRps) { + targetShooterSpeed = velocityRps; + shooter.setControl( + velocityVoltage.withVelocity( + velocityRps * Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT + ) + ); + } + + public void stopShooter() { + targetShooterSpeed = 0.0; + shooter.stopMotor(); + } + + public boolean isShooterAtSpeed() { + double currentWheelSpeed = shooter.getCachedVelocityRps() / Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT; + return MathUtil.isNear(targetShooterSpeed, currentWheelSpeed, 1.0); + } + + public Command shootWithHood(double shooterSpeedRps, double hoodAngle) { + return runEnd( + () -> { + setShooterSpeed(shooterSpeedRps); + setHoodAngle(hoodAngle); + }, + this::stopShooter + ); + } + + public ShooterSubsystem() { + CANBus canbus = Constants.Swerve.CAN_BUS; + + warmup1 = new LoggedTalonFX("ShooterWarmup1", Constants.Shooter.Rollers.WARMUP_1_ID, canbus); + warmup2 = new LoggedTalonFX("ShooterWarmup2", Constants.Shooter.Rollers.WARMUP_2_ID, canbus); + warmup3 = new LoggedTalonFX("ShooterWarmup3", Constants.Shooter.Rollers.WARMUP_3_ID, canbus); + + shooter = warmup3; + hood = new LoggedTalonFX("Hood", Constants.Shooter.Hood.HOOD_ID, canbus); + + Follower follower = new Follower(Constants.Shooter.Rollers.WARMUP_3_ID, MotorAlignmentValue.Aligned); + warmup1.setControl(follower); + warmup2.setControl(follower); + + hoodEncoder = new CANcoder(Constants.Shooter.Hood.ENCODER_PORT, canbus); + + // Rollers Configuration + Slot0Configs rollersSlot0Configs = new Slot0Configs(); + rollersSlot0Configs.kP = Constants.Shooter.Rollers.KP; + rollersSlot0Configs.kI = Constants.Shooter.Rollers.KI; + rollersSlot0Configs.kD = Constants.Shooter.Rollers.KD; + rollersSlot0Configs.kV = Constants.Shooter.Rollers.KV; + rollersSlot0Configs.kS = Constants.Shooter.Rollers.KS; + + CurrentLimitsConfigs rollersCLConfigs = new CurrentLimitsConfigs(); + rollersCLConfigs.StatorCurrentLimit = Constants.Shooter.Rollers.STATOR_CURRENT_LIMIT; + rollersCLConfigs.StatorCurrentLimitEnable = true; + rollersCLConfigs.SupplyCurrentLimit = Constants.Shooter.Rollers.SUPPLY_CURRENT_LIMIT; + rollersCLConfigs.SupplyCurrentLimitEnable = true; - private final LoggedTalonFX warmup1, warmup2, warmup3, shooter, hood; - private final CANcoder hoodEncoder; - - VelocityVoltage mVelocityVoltage = new VelocityVoltage(0.0); - PositionVoltage mPositionVoltage = new PositionVoltage(0.0); - - double targetRoller; - double targetAngle; - - public ShooterSubsystem() { - // The canbus is a communication system that can connect devices like the roboRIO, pdh, and motors. - CANBus canbus = Constants.Swerve.CAN_BUS; - - // LoggedTalonFX is our version of the existing TalonFX class, which automatically logs some motor information - warmup1 = new LoggedTalonFX("ShooterWarmup1", Constants.Shooter.Rollers.WARMUP_1_ID, canbus); - warmup2 = new LoggedTalonFX("ShooterWarmup2", Constants.Shooter.Rollers.WARMUP_2_ID, canbus); - warmup3 = new LoggedTalonFX("ShooterWarmup3", Constants.Shooter.Rollers.WARMUP_3_ID, canbus); - - shooter = warmup3; // warmup1 and warmup2 will be set as "followers" of the "lead" warmup3, so later we can just reference the `shooter` variable - - hood = new LoggedTalonFX("Hood", Constants.Shooter.Hood.HOOD_ID, canbus); - - - Follower follower = new Follower(Constants.Shooter.Rollers.WARMUP_3_ID, MotorAlignmentValue.Aligned); - warmup1.setControl(follower); - warmup2.setControl(follower); - - - hoodEncoder = new CANcoder(Constants.Shooter.Hood.ENCODER_PORT, Constants.Swerve.CAN_BUS); - - Slot0Configs rollersSlot0Configs = new Slot0Configs(); - rollersSlot0Configs.kP = Constants.Shooter.Rollers.KP; - rollersSlot0Configs.kI = Constants.Shooter.Rollers.KI; - rollersSlot0Configs.kD = Constants.Shooter.Rollers.KD; - rollersSlot0Configs.kV = Constants.Shooter.Rollers.KV; - rollersSlot0Configs.kS = Constants.Shooter.Rollers.KS; - - CurrentLimitsConfigs rollersCLConfigs = new CurrentLimitsConfigs(); - rollersCLConfigs.StatorCurrentLimit = Constants.Shooter.Rollers.STATOR_CURRENT_LIMIT; - rollersCLConfigs.StatorCurrentLimitEnable = true; - rollersCLConfigs.SupplyCurrentLimit = Constants.Shooter.Rollers.SUPPLY_CURRENT_LIMIT; - rollersCLConfigs.SupplyCurrentLimitEnable = true; - - MotorOutputConfigs rollersOutputConfigs = new MotorOutputConfigs(); - rollersOutputConfigs.Inverted = InvertedValue.Clockwise_Positive; - rollersOutputConfigs.NeutralMode = NeutralModeValue.Coast; - - FeedbackConfigs hoodFeedbackConfigs = - new FeedbackConfigs() - .withFeedbackRemoteSensorID(hoodEncoder.getDeviceID()) - .withFeedbackSensorSource(FeedbackSensorSourceValue.FusedCANcoder) - .withSensorToMechanismRatio(Constants.Shooter.Hood.ENCODER_ROTS_PER_HOOD_ROT) - .withRotorToSensorRatio(Constants.Shooter.Hood.MOTOR_ROTS_PER_ENCODER_ROT); - - TalonFXConfiguration rollersConfig = new TalonFXConfiguration(); - TalonFXConfiguration hoodConfig = new TalonFXConfiguration(); - hoodConfig.Slot0 = hoodSlot0Configs; - hoodConfig.CurrentLimits = hoodClConfigs; - hoodConfig.MotorOutput = hoodOutputConfigs; - - rollersConfig.Slot0 = rollersSlot0Configs; - rollersConfig.CurrentLimits = rollersCLConfigs; - rollersConfig.MotorOutput = rollersOutputConfigs; - - warmup1.getConfigurator().apply(rollersConfig); - warmup2.getConfigurator().apply(rollersConfig); - warmup3.getConfigurator().apply(rollersConfig); - - MagnetSensorConfigs hoodCANcoderConfig = - new CANcoderConfiguration() - .MagnetSensor.withAbsoluteSensorDiscontinuityPoint(Rotations.of(1)) - .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive) - .withMagnetOffset(Rotations.of(Constants.Shooter.Hood.ENCODER_OFFSET)); - - hoodEncoder.getConfigurator().apply(hoodCANcoderConfig); - } -} + MotorOutputConfigs rollersOutputConfigs = new MotorOutputConfigs(); + rollersOutputConfigs.Inverted = InvertedValue.Clockwise_Positive; + rollersOutputConfigs.NeutralMode = NeutralModeValue.Coast; + + TalonFXConfiguration rollersConfig = new TalonFXConfiguration(); + rollersConfig.Slot0 = rollersSlot0Configs; + rollersConfig.CurrentLimits = rollersCLConfigs; + rollersConfig.MotorOutput = rollersOutputConfigs; + + warmup1.getConfigurator().apply(rollersConfig); + warmup2.getConfigurator().apply(rollersConfig); + warmup3.getConfigurator().apply(rollersConfig); + + // Hood Configuration + Slot0Configs hoodSlot0Configs = new Slot0Configs(); + hoodSlot0Configs.kP = Constants.Shooter.Hood.KP; + hoodSlot0Configs.kI = Constants.Shooter.Hood.KI; + hoodSlot0Configs.kD = Constants.Shooter.Hood.KD; + hoodSlot0Configs.kV = Constants.Shooter.Hood.KV; + hoodSlot0Configs.kS = Constants.Shooter.Hood.KS; + + CurrentLimitsConfigs hoodClConfigs = new CurrentLimitsConfigs(); + hoodClConfigs.StatorCurrentLimit = Constants.Shooter.Hood.STATOR_CURRENT_LIMIT; + hoodClConfigs.StatorCurrentLimitEnable = true; + hoodClConfigs.SupplyCurrentLimit = Constants.Shooter.Hood.SUPPLY_CURRENT_LIMIT; + hoodClConfigs.SupplyCurrentLimitEnable = true; + + MotorOutputConfigs hoodOutputConfigs = new MotorOutputConfigs(); + hoodOutputConfigs.Inverted = InvertedValue.CounterClockwise_Positive; + hoodOutputConfigs.NeutralMode = NeutralModeValue.Coast; + + FeedbackConfigs hoodFeedbackConfigs = new FeedbackConfigs() + .withFeedbackRemoteSensorID(hoodEncoder.getDeviceID()) + .withFeedbackSensorSource(FeedbackSensorSourceValue.FusedCANcoder) + .withSensorToMechanismRatio(Constants.Shooter.Hood.ENCODER_ROTS_PER_HOOD_ROT) + .withRotorToSensorRatio(Constants.Shooter.Hood.MOTOR_ROTS_PER_ENCODER_ROT); + + TalonFXConfiguration hoodConfig = new TalonFXConfiguration(); + hoodConfig.Slot0 = hoodSlot0Configs; + hoodConfig.CurrentLimits = hoodClConfigs; + hoodConfig.MotorOutput = hoodOutputConfigs; + hoodConfig.Feedback = hoodFeedbackConfigs; + + hood.getConfigurator().apply(hoodConfig); + + MagnetSensorConfigs hoodCANcoderConfig = new CANcoderConfiguration() + .MagnetSensor.withAbsoluteSensorDiscontinuityPoint(Rotations.of(1)) + .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive) + .withMagnetOffset(Rotations.of(Constants.Shooter.Hood.ENCODER_OFFSET)); + + hoodEncoder.getConfigurator().apply(hoodCANcoderConfig); + } +} \ No newline at end of file From 0400c26589e1b1e6f5347c5fb9341addc7d417c2 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Mon, 24 Aug 2026 19:41:30 -0700 Subject: [PATCH 4/8] fixed merge conflict --- src/main/java/frc/robot/Constants.java | 2 + .../frc/robot/subsystems/ArmSubsystem.java | 100 ------------------ 2 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 src/main/java/frc/robot/subsystems/ArmSubsystem.java diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 6ebf09e..b2507dd 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -759,6 +759,8 @@ public static final class Rollers { public static final double STATOR_CURRENT_LIMIT = 120.0; public static final double SUPPLY_CURRENT_LIMIT = 40.0; + + public static final double MOTOR_ROTS_PER_WHEEL_ROT = 0; } } diff --git a/src/main/java/frc/robot/subsystems/ArmSubsystem.java b/src/main/java/frc/robot/subsystems/ArmSubsystem.java deleted file mode 100644 index 2316257..0000000 --- a/src/main/java/frc/robot/subsystems/ArmSubsystem.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package frc.robot.subsystems; - -import com.ctre.phoenix6.configs.CurrentLimitsConfigs; -import com.ctre.phoenix6.configs.MotorOutputConfigs; -import com.ctre.phoenix6.configs.TalonFXConfiguration; -import com.ctre.phoenix6.configs.TalonFXConfigurator; -import com.ctre.phoenix6.controls.DutyCycleOut; -import com.ctre.phoenix6.controls.TorqueCurrentFOC; -import com.ctre.phoenix6.controls.VoltageOut; -import com.ctre.phoenix6.hardware.TalonFX; -import com.ctre.phoenix6.signals.InvertedValue; -import com.ctre.phoenix6.signals.NeutralModeValue; - -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc.robot.Constants; - - - -public class ArmSubsystem extends SubsystemBase { - private TalonFX armMotor, rollerMotor; - - - private final DutyCycleOut m_dutyCycleRequest = new DutyCycleOut(0.0); - private final VoltageOut m_voltageRequest = new VoltageOut(0.0); - private final TorqueCurrentFOC m_torqueRequest = new TorqueCurrentFOC(0.0); - - public ArmSubsystem() { - armMotor = new TalonFX(Constants.Intake.Arm.ARM_MOTOR_ID); - rollerMotor = new TalonFX(Constants.Intake.Rollers.ROLLER_MOTOR_ID); - - CurrentLimitsConfigs rollerClc = - new CurrentLimitsConfigs() - .withStatorCurrentLimit(50) - .withStatorCurrentLimitEnable(true) - .withSupplyCurrentLimit(30) - .withSupplyCurrentLimitEnable(true); - - CurrentLimitsConfigs armClc = - new CurrentLimitsConfigs() - .withStatorCurrentLimit(100) - .withStatorCurrentLimitEnable(true) - .withSupplyCurrentLimit(50) - .withSupplyCurrentLimitEnable(true); - - MotorOutputConfigs rollerMotorOutputConfigs = - new MotorOutputConfigs() - .withInverted(InvertedValue.CounterClockwise_Positive) - .withNeutralMode(NeutralModeValue.Coast); - - MotorOutputConfigs armMotorOutputConfigs = - new MotorOutputConfigs() - .withInverted(InvertedValue.CounterClockwise_Positive) - .withNeutralMode(NeutralModeValue.Brake); - - TalonFXConfiguration rollerConfig = - new TalonFXConfiguration() - .withCurrentLimits(rollerClc) - .withMotorOutput(rollerMotorOutputConfigs); - - TalonFXConfiguration armConfig = - new TalonFXConfiguration() - .withCurrentLimits(armClc) - .withMotorOutput(armMotorOutputConfigs); - - TalonFXConfigurator rollerConfigurator = rollerMotor.getConfigurator(); - TalonFXConfigurator armConfigurator = armMotor.getConfigurator(); - - rollerConfigurator.apply(rollerConfig); - armConfigurator.apply(armConfig); - - } - - - - public void setRollerDutyCycle(double output) { - rollerMotor.setControl(m_dutyCycleRequest.withOutput(output)); - } - - public void setRollerVoltage(double volts) { - rollerMotor.setControl(m_voltageRequest.withOutput(volts)); - } - - public void setArmTorqueCurrent(double currentAmps) { - armMotor.setControl(m_torqueRequest.withOutput(currentAmps)); - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } - - @Override - public void simulationPeriodic() { - // This method will be called once per scheduler run during simulation - } -} \ No newline at end of file From 0ddf28d9582961f6811021717cd7a74c2932a324 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Mon, 24 Aug 2026 20:00:19 -0700 Subject: [PATCH 5/8] merged --- src/main/java/frc/robot/RobotContainer.java | 10 ++-- .../ShootCommandGroups/ShootBasicHood.java | 23 ++++----- .../robot/subsystems/ShooterSubsystem.java | 50 +++++++++---------- 3 files changed, 39 insertions(+), 44 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 61726f6..d4d6073 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -45,8 +45,8 @@ public class RobotContainer { Constants.intakeOnRobot ? new IntakeSubsystem() : null; public final ShooterSubsystem shooterSubsystem = new ShooterSubsystem(); -// private final AutoRoutines autoRoutines; -// private final AutoChooser autoChooser; + // private final AutoRoutines autoRoutines; + // private final AutoChooser autoChooser; public final VisionSubsystem visionFrontRight = Constants.visionOnRobot @@ -146,13 +146,13 @@ private void configureBindings() { .rightBumper() .whileTrue( new ShootBasicHood( - 44.2, Constants.Shooter.Hood.MIN_HOOD_ANGLE, shooterSubsystem)); + 44.2, Constants.Shooter.Hood.MIN_HOOD_ANGLE, shooterSubsystem, hopperSubsystem)); joystick .rightTrigger() .whileTrue( new ShootBasicHood( - 58.2, Constants.Shooter.Hood.MAX_HOOD_ANGLE, shooterSubsystem)); + 58.2, Constants.Shooter.Hood.MAX_HOOD_ANGLE, shooterSubsystem, hopperSubsystem)); secondController.intakeOverride().whileTrue(intakeSubsystem.retractIntakeCommand()); @@ -190,4 +190,4 @@ public boolean inAllianceSide() { // public Command getAutonomousCommand() { // return autoChooser.selectedCommand(); // } -} \ No newline at end of file +} diff --git a/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java b/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java index e1a9217..c05cd1e 100644 --- a/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java +++ b/src/main/java/frc/robot/commandGroups/ShootCommandGroups/ShootBasicHood.java @@ -1,19 +1,16 @@ package frc.robot.commandGroups.ShootCommandGroups; +import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; - +import frc.robot.subsystems.HopperSubsystem; import frc.robot.subsystems.ShooterSubsystem; public class ShootBasicHood extends ParallelCommandGroup { - - public ShootBasicHood( - double speed, - double hoodAngle, - ShooterSubsystem shooterSubsystem - ) { - addCommands( - shooterSubsystem.shootWithHood(speed, hoodAngle) - // shootWithHood runs continuously and updates speed and angle - ); - } -} \ No newline at end of file + public ShootBasicHood( + double speed, double angle, ShooterSubsystem shooter, HopperSubsystem hopper) { + addCommands( + shooter.shootWithHood(speed, angle), + Commands.waitUntil(shooter::isShooterAtSpeed) + .andThen(hopper.runHopperUntilInterruptedCommand())); + } +} diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index 7223687..2544fc3 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -19,7 +19,6 @@ import com.ctre.phoenix6.signals.MotorAlignmentValue; import com.ctre.phoenix6.signals.NeutralModeValue; import com.ctre.phoenix6.signals.SensorDirectionValue; - import edu.wpi.first.math.MathUtil; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -45,21 +44,17 @@ public void setHoodAngle(double degrees) { hood.setControl( positionVoltage.withPosition( MathUtil.clamp( - degrees, - Constants.Shooter.Hood.MIN_HOOD_ANGLE, - Constants.Shooter.Hood.MAX_HOOD_ANGLE - ) / 360.0 - ) - ); + degrees, + Constants.Shooter.Hood.MIN_HOOD_ANGLE, + Constants.Shooter.Hood.MAX_HOOD_ANGLE) + / 360.0)); } public void setShooterSpeed(double velocityRps) { targetShooterSpeed = velocityRps; shooter.setControl( velocityVoltage.withVelocity( - velocityRps * Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT - ) - ); + velocityRps * Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT)); } public void stopShooter() { @@ -68,7 +63,8 @@ public void stopShooter() { } public boolean isShooterAtSpeed() { - double currentWheelSpeed = shooter.getCachedVelocityRps() / Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT; + double currentWheelSpeed = + shooter.getCachedVelocityRps() / Constants.Shooter.Rollers.MOTOR_ROTS_PER_WHEEL_ROT; return MathUtil.isNear(targetShooterSpeed, currentWheelSpeed, 1.0); } @@ -78,13 +74,12 @@ public Command shootWithHood(double shooterSpeedRps, double hoodAngle) { setShooterSpeed(shooterSpeedRps); setHoodAngle(hoodAngle); }, - this::stopShooter - ); + this::stopShooter); } public ShooterSubsystem() { CANBus canbus = Constants.Swerve.CAN_BUS; - + warmup1 = new LoggedTalonFX("ShooterWarmup1", Constants.Shooter.Rollers.WARMUP_1_ID, canbus); warmup2 = new LoggedTalonFX("ShooterWarmup2", Constants.Shooter.Rollers.WARMUP_2_ID, canbus); warmup3 = new LoggedTalonFX("ShooterWarmup3", Constants.Shooter.Rollers.WARMUP_3_ID, canbus); @@ -92,7 +87,8 @@ public ShooterSubsystem() { shooter = warmup3; hood = new LoggedTalonFX("Hood", Constants.Shooter.Hood.HOOD_ID, canbus); - Follower follower = new Follower(Constants.Shooter.Rollers.WARMUP_3_ID, MotorAlignmentValue.Aligned); + Follower follower = + new Follower(Constants.Shooter.Rollers.WARMUP_3_ID, MotorAlignmentValue.Aligned); warmup1.setControl(follower); warmup2.setControl(follower); @@ -111,7 +107,7 @@ public ShooterSubsystem() { rollersCLConfigs.StatorCurrentLimitEnable = true; rollersCLConfigs.SupplyCurrentLimit = Constants.Shooter.Rollers.SUPPLY_CURRENT_LIMIT; rollersCLConfigs.SupplyCurrentLimitEnable = true; - + MotorOutputConfigs rollersOutputConfigs = new MotorOutputConfigs(); rollersOutputConfigs.Inverted = InvertedValue.Clockwise_Positive; rollersOutputConfigs.NeutralMode = NeutralModeValue.Coast; @@ -143,11 +139,12 @@ public ShooterSubsystem() { hoodOutputConfigs.Inverted = InvertedValue.CounterClockwise_Positive; hoodOutputConfigs.NeutralMode = NeutralModeValue.Coast; - FeedbackConfigs hoodFeedbackConfigs = new FeedbackConfigs() - .withFeedbackRemoteSensorID(hoodEncoder.getDeviceID()) - .withFeedbackSensorSource(FeedbackSensorSourceValue.FusedCANcoder) - .withSensorToMechanismRatio(Constants.Shooter.Hood.ENCODER_ROTS_PER_HOOD_ROT) - .withRotorToSensorRatio(Constants.Shooter.Hood.MOTOR_ROTS_PER_ENCODER_ROT); + FeedbackConfigs hoodFeedbackConfigs = + new FeedbackConfigs() + .withFeedbackRemoteSensorID(hoodEncoder.getDeviceID()) + .withFeedbackSensorSource(FeedbackSensorSourceValue.FusedCANcoder) + .withSensorToMechanismRatio(Constants.Shooter.Hood.ENCODER_ROTS_PER_HOOD_ROT) + .withRotorToSensorRatio(Constants.Shooter.Hood.MOTOR_ROTS_PER_ENCODER_ROT); TalonFXConfiguration hoodConfig = new TalonFXConfiguration(); hoodConfig.Slot0 = hoodSlot0Configs; @@ -157,11 +154,12 @@ public ShooterSubsystem() { hood.getConfigurator().apply(hoodConfig); - MagnetSensorConfigs hoodCANcoderConfig = new CANcoderConfiguration() - .MagnetSensor.withAbsoluteSensorDiscontinuityPoint(Rotations.of(1)) - .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive) - .withMagnetOffset(Rotations.of(Constants.Shooter.Hood.ENCODER_OFFSET)); + MagnetSensorConfigs hoodCANcoderConfig = + new CANcoderConfiguration() + .MagnetSensor.withAbsoluteSensorDiscontinuityPoint(Rotations.of(1)) + .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive) + .withMagnetOffset(Rotations.of(Constants.Shooter.Hood.ENCODER_OFFSET)); hoodEncoder.getConfigurator().apply(hoodCANcoderConfig); } -} \ No newline at end of file +} From a30455197d2bed4f1d90e412113335b132d287e6 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Mon, 24 Aug 2026 20:33:06 -0700 Subject: [PATCH 6/8] merge --- src/main/java/frc/robot/Constants.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index b2507dd..4d000b0 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -751,16 +751,16 @@ public static final class Rollers { public static final int WARMUP_2_ID = 9; public static final int WARMUP_3_ID = 11; - public static final double KP = 0.0; + public static final double KP = 0.85; public static final double KI = 0.0; public static final double KD = 0.0; - public static final double KV = 0.0; + public static final double KV = 0.124; public static final double KS = 0.0; public static final double STATOR_CURRENT_LIMIT = 120.0; public static final double SUPPLY_CURRENT_LIMIT = 40.0; - public static final double MOTOR_ROTS_PER_WHEEL_ROT = 0; + public static final double MOTOR_ROTS_PER_WHEEL_ROT = 5.0 / 12.0;; } } From 0dd971839d06a27dc521509e5cee1f318a4d6c85 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Wed, 2 Sep 2026 20:19:09 -0700 Subject: [PATCH 7/8] one line --- src/main/java/frc/robot/RobotContainer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index d4d6073..7a38bfb 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -10,6 +10,7 @@ // import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; +import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.commandGroups.ShootCommandGroups.ShootBasicHood; // * KEEP FOR WIN COMMAND TESTING @@ -145,14 +146,16 @@ private void configureBindings() { joystick .rightBumper() .whileTrue( - new ShootBasicHood( - 44.2, Constants.Shooter.Hood.MIN_HOOD_ANGLE, shooterSubsystem, hopperSubsystem)); + shooterSubsystem.shootWithHood(44.2, Constants.Shooter.Hood.MIN_HOOD_POSITION).alongWith( + Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) + .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); joystick .rightTrigger() .whileTrue( - new ShootBasicHood( - 58.2, Constants.Shooter.Hood.MAX_HOOD_ANGLE, shooterSubsystem, hopperSubsystem)); + shooterSubsystem.shootWithHood(58.2, Constants.Shooter.Hood.MAX_HOOD_POSITION).alongWith( + Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) + .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); secondController.intakeOverride().whileTrue(intakeSubsystem.retractIntakeCommand()); From 4cf4be4bc56b27957dd66d349f6e1a54c7117539 Mon Sep 17 00:00:00 2001 From: Dia-Dharamshi Date: Wed, 2 Sep 2026 20:34:21 -0700 Subject: [PATCH 8/8] oneline --- src/main/java/frc/robot/Constants.java | 3 ++- src/main/java/frc/robot/RobotContainer.java | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4d000b0..f7d65ed 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -760,7 +760,8 @@ public static final class Rollers { public static final double STATOR_CURRENT_LIMIT = 120.0; public static final double SUPPLY_CURRENT_LIMIT = 40.0; - public static final double MOTOR_ROTS_PER_WHEEL_ROT = 5.0 / 12.0;; + public static final double MOTOR_ROTS_PER_WHEEL_ROT = 5.0 / 12.0; + ; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 7a38bfb..5d969cd 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -12,7 +12,6 @@ import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; -import frc.robot.commandGroups.ShootCommandGroups.ShootBasicHood; // * KEEP FOR WIN COMMAND TESTING import frc.robot.commands.SwerveCommands.SwerveJoystickCommand; import frc.robot.generated.TunerConstants; @@ -146,16 +145,20 @@ private void configureBindings() { joystick .rightBumper() .whileTrue( - shooterSubsystem.shootWithHood(44.2, Constants.Shooter.Hood.MIN_HOOD_POSITION).alongWith( - Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) - .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); + shooterSubsystem + .shootWithHood(44.2, Constants.Shooter.Hood.MIN_HOOD_POSITION) + .alongWith( + Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) + .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); joystick .rightTrigger() .whileTrue( - shooterSubsystem.shootWithHood(58.2, Constants.Shooter.Hood.MAX_HOOD_POSITION).alongWith( - Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) - .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); + shooterSubsystem + .shootWithHood(58.2, Constants.Shooter.Hood.MAX_HOOD_POSITION) + .alongWith( + Commands.waitUntil(shooterSubsystem::isShooterAtSpeed) + .andThen(hopperSubsystem.runHopperUntilInterruptedCommand()))); secondController.intakeOverride().whileTrue(intakeSubsystem.retractIntakeCommand());