Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static class ErrorSettings {
public static final int TURRET_OFFSET_DECIMAL_PLACE = 1;
public static final double HOOD_OFFSET_INCREASE = 0.1;
public static final int HOOD_OFFSET_DECIMAL_PLACE = 1;
public static final double SHOOTER_PERCENT_INCREASE = 0.2; // Percent to increase per tick
public static final double SHOOTER_PERCENT_INCREASE = .5; // Percent to increase per tick
public static final int SHOOTER_PERCENT_DECIMAL_PLACE = 1;

public static final double SHOOTER_PERCENT_DEFAULT = 100.0;
Expand Down
32 changes: 26 additions & 6 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ public void configureBindings() {

Trigger reverseTransferTrigger = new Trigger(() -> driverController.getXButton());

// Driver X button: hold to lock robot pose (X-lock)
Trigger xLockTrigger = new Trigger(() -> operatorController.getXButton());
// Driver Y button: hold to lock robot pose (X-lock)
Trigger xLockTrigger = new Trigger(() -> driverController.getYButton());
xLockTrigger.whileTrue(driveSubsystem.getLockPoseCommand());

/* Shooter runs while button held */
Expand Down Expand Up @@ -388,6 +388,26 @@ public void configureBindings() {
shooterPercent.getHeldIntervalCommand(Constants.Operator.ErrorSettings.SHOOTER_PERCENT_INCREASE,
Constants.Operator.ErrorSettings.SETTINGS_DELAY_TIME));

// ==============================
// Turret / Hood Offset Reset (Left Stick Click / Right Stick Click)
// ==============================

// Left Stick Click : Reset turret offset to zero
new Trigger(() -> operatorController.getLeftStickButton())
.onTrue(new InstantCommand(() -> turretOffsetDegrees.set(0.0)));

// Right Stick Click : Reset hood offset to zero
new Trigger(() -> operatorController.getRightStickButton())
.onTrue(new InstantCommand(() -> hoodOffsetDegrees.set(0.0)));

// ==============================
// Shooter Percent Reset (Left Trigger / Right Trigger)
// ==============================

// Either Trigger : Reset shooter percent to default
new Trigger(() -> operatorController.getLeftTriggerAxis() > 0.5
|| operatorController.getRightTriggerAxis() > 0.5)
.onTrue(new InstantCommand(() -> shooterPercent.set(Constants.Operator.ErrorSettings.SHOOTER_PERCENT_DEFAULT)));
new Trigger(
() -> operatorController.getAButton()).onTrue(
new InstantCommand(() -> selectedFixedTarget = FixedTarget.A));
Expand Down Expand Up @@ -587,8 +607,8 @@ private Command getIntakeStrategyCommand() {
turretSubsystem,
transferSubsystem,
() -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),
Constants.Operator.Auto.DEPOT_READY_INTAKE_POSE,
Constants.Operator.Auto.DEPOT_INTAKE_POSE,
FieldUtil.flipIfRed(Constants.Operator.Auto.DEPOT_READY_INTAKE_POSE),
FieldUtil.flipIfRed(Constants.Operator.Auto.DEPOT_INTAKE_POSE),
false,
Constants.Operator.Auto.AUTO_INTAKE_MAX_SPEED,
SmartDashboard.getNumber("Auto/IntakeShootTime", Constants.Operator.Auto.DEFAULT_INTAKE_SHOOT_TIME));
Expand All @@ -602,8 +622,8 @@ private Command getIntakeStrategyCommand() {
turretSubsystem,
transferSubsystem,
() -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),
Constants.Operator.Auto.OUTPOST_READY_INTAKE_POSE,
Constants.Operator.Auto.OUTPOST_INTAKE_POSE,
FieldUtil.flipIfRed(Constants.Operator.Auto.OUTPOST_READY_INTAKE_POSE),
FieldUtil.flipIfRed(Constants.Operator.Auto.OUTPOST_INTAKE_POSE),
false,
Constants.Operator.Auto.AUTO_INTAKE_MAX_SPEED,
SmartDashboard.getNumber("Auto/IntakeShootTime", Constants.Operator.Auto.DEFAULT_INTAKE_SHOOT_TIME));
Expand Down
21 changes: 13 additions & 8 deletions src/main/java/frc/robot/commands/ShootPreloadCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Translation3d;
import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.Constants;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import frc.robot.subsystems.IntakePivotSubsystem;
import frc.robot.subsystems.IntakeRollerSubsystem;
import frc.robot.subsystems.ShooterSubsystem;
Expand All @@ -32,12 +32,17 @@ public ShootPreloadCommand(
addCommands(

Commands.deadline(
Commands.waitSeconds(shootPreloadTime),
turret.getTargetCommand(targetSupplier, robotPoseSupplier, robotVelocitySupplier),
shooter.getTargetCommand(targetSupplier, robotPoseSupplier, robotVelocitySupplier),
transfer.getLoadCommand(),
intakePivot.deployIntakeCommand(),
intakeRoller.getIntakeCommand()
Commands.waitSeconds(shootPreloadTime + 2),
new SequentialCommandGroup(
Comment on lines +35 to +36
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shootPreloadTime is now effectively treated as “time after the extra 2s delay” due to waitSeconds(shootPreloadTime + 2) plus a hard-coded WaitCommand(2). This changes behavior when shootPreloadTime is 0 (autonomous default): the command will still wait 2 seconds before continuing, and the parameter name no longer matches total runtime. If the intent is a fixed spin-up delay, consider making it a separate named constant/dashboard setting (or incorporate the delay into the shootPreloadTime value directly) to avoid surprising timing changes.

Copilot uses AI. Check for mistakes.
new ParallelCommandGroup(
turret.getTargetCommand(targetSupplier, robotPoseSupplier, robotVelocitySupplier),
shooter.getTargetCommand(targetSupplier, robotPoseSupplier, robotVelocitySupplier),
intakeRoller.getIntakeCommand(),
intakePivot.deployIntakeCommand()
),
new WaitCommand(2),
transfer.getLoadCommand()
)
),

Commands.parallel(
Expand Down
Loading