From 5dfe9a61a435929bbc0638a269041555f5619c9a Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 4 Jun 2026 19:02:27 -0700 Subject: [PATCH 1/5] Improve Driver Controls --- .../config/XBoxTeleopSwerveConstants.java | 2 +- .../java/frc/robot/auto/shoot/AutoShoot.java | 9 ++++++- .../frc/robot/controls/TeleopControls.java | 25 ++++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/team6962/lib/swerve/config/XBoxTeleopSwerveConstants.java b/src/main/java/com/team6962/lib/swerve/config/XBoxTeleopSwerveConstants.java index 2cdeec62..f1a9302e 100644 --- a/src/main/java/com/team6962/lib/swerve/config/XBoxTeleopSwerveConstants.java +++ b/src/main/java/com/team6962/lib/swerve/config/XBoxTeleopSwerveConstants.java @@ -28,7 +28,7 @@ public class XBoxTeleopSwerveConstants implements Cloneable { * facing directly away from the driver station. This constant can be set to null to make no * button zero the robot's yaw. */ - public Button ZeroYawButton = Button.kLeftBumper; + public Button ZeroYawButton = Button.kY; /** When held, this button will enable the boost speeds for translation and rotation. */ public Trigger BoostAxis = Trigger.RightTrigger; diff --git a/src/main/java/frc/robot/auto/shoot/AutoShoot.java b/src/main/java/frc/robot/auto/shoot/AutoShoot.java index 03da676e..a8429369 100644 --- a/src/main/java/frc/robot/auto/shoot/AutoShoot.java +++ b/src/main/java/frc/robot/auto/shoot/AutoShoot.java @@ -103,6 +103,7 @@ public class AutoShoot extends Command { private Angle hoodOffset = Degrees.of(0); private Angle turretOffset = Degrees.of(0); + private AngularVelocity flywheelSpeedOffset = RotationsPerSecond.of(0); /** * Creates a new AutoShoot command, which automatically aims and spins up the shooter rollers to @@ -251,6 +252,11 @@ public Angle setTurretOffset(Angle offset) { return turretOffset; } + public AngularVelocity setFlywheelSpeedOffset(AngularVelocity offset) { + this.flywheelSpeedOffset = offset; + return flywheelSpeedOffset; + } + @Override public void initialize() { readyToShoot = false; @@ -478,6 +484,7 @@ public void execute() { DogLog.log("AutoShoot/HoodOffset", hoodOffset.in(Degrees), Degrees); DogLog.log("AutoShoot/TurretOffset", turretOffset.in(Degrees), Degrees); + DogLog.log("AutoShoot/FlywheelSpeedOffset", flywheelSpeedOffset.in(RotationsPerSecond), RotationsPerSecond); // Calculate the ideal shooting angles and roller speed to hit the target ShootingParameters appliedShootingParameters = calculate(Seconds.of(predictionTime)); @@ -492,7 +499,7 @@ public void execute() { // Set the target angles and roller speed turretAngleTarget = appliedShootingParameters.turretAngle.plus(turretOffset); hoodAngleTarget = appliedShootingParameters.hoodAngle.plus(hoodOffset); - rollerSpeedTarget = appliedShootingParameters.rollerSpeed; + rollerSpeedTarget = appliedShootingParameters.rollerSpeed.plus(flywheelSpeedOffset); if (previousTurretAngleTarget != null && previousHoodAngleTarget != null) { double timeSinceLastPeriodic = Timer.getFPGATimestamp() - previousPeriodicTimestamp; diff --git a/src/main/java/frc/robot/controls/TeleopControls.java b/src/main/java/frc/robot/controls/TeleopControls.java index d33c2942..d3f01c33 100644 --- a/src/main/java/frc/robot/controls/TeleopControls.java +++ b/src/main/java/frc/robot/controls/TeleopControls.java @@ -174,10 +174,7 @@ public void configureBindings() { Commands.parallel( this.robot.getIntakeRollers().outtake(), this.robot.getHopper().dump())); - // Intake and drive to fuel clump - // driver.start().whileTrue(driveToClump.driveToClump()); - - // Intake without driving - WORKS + // Intake - WORKS driver .rightStick() .and(RobotState::isEnabled) @@ -205,7 +202,7 @@ public void configureBindings() { robot.getShooterRollers().shoot(RotationsPerSecond.of(22.5)))); // Unjam hopper - WORKS - operator.leftBumper().whileTrue(robot.getHopper().unjam()); + operator.leftBumper().or(driver.leftBumper()).whileTrue(robot.getHopper().unjam()); // Backup shoot operator.leftTrigger().and(RobotState::isEnabled).whileTrue(robot.getHopper().feed()); @@ -296,7 +293,7 @@ public void configureBindings() { .moveAtVoltage(IntakeExtensionConstants.FINE_CONTROL_VOLTAGE.unaryMinus()))); // Intake extension and retraction - WORKS - Trigger intakeRetract = operator.rightStick(); + Trigger intakeRetract = operator.rightStick().and(driver.start()); Trigger intakeExtend = intakeRetract.negate().and(RobotState::isTeleop).and(RobotState::isEnabled); @@ -456,9 +453,11 @@ public void periodic() { if (!fineControl) { autoShoot.setHoodOffset(mapOffset(operator.getLeftY(), Degrees.of(5))); autoShoot.setTurretOffset(mapOffset(-operator.getLeftX(), Degrees.of(10))); + autoShoot.setFlywheelSpeedOffset(mapOffset(-operator.getRightY(), RotationsPerSecond.of(1))); } else { autoShoot.setHoodOffset(Degrees.of(0)); autoShoot.setTurretOffset(Degrees.of(0)); + autoShoot.setFlywheelSpeedOffset(RotationsPerSecond.of(0)); } ControllerLogging.logInputs(driver.getHID()); @@ -481,4 +480,18 @@ private Angle mapOffset(double joystickInput, Angle maxOffset) { * maxOffset.in(Degrees)); } } + + private AngularVelocity mapOffset(double joystickInput, AngularVelocity maxOffset) { + if (Math.abs(joystickInput) < 0.1) { + return RotationsPerSecond.of(0); + } else { + joystickInput -= Math.signum(joystickInput) * 0.1; + joystickInput /= 0.9; + + return RotationsPerSecond.of( + Math.signum(joystickInput) + * Math.pow(Math.abs(joystickInput), 2) + * maxOffset.in(RotationsPerSecond)); + } + } } From b9941c597e65ee6ca881b1a6e162fdc1d8e43b35 Mon Sep 17 00:00:00 2001 From: scotch-tape <156549340+scotch-tape@users.noreply.github.com> Date: Fri, 5 Jun 2026 02:05:21 +0000 Subject: [PATCH 2/5] style: Apply Spotless fixes --- src/main/java/frc/robot/auto/shoot/AutoShoot.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/auto/shoot/AutoShoot.java b/src/main/java/frc/robot/auto/shoot/AutoShoot.java index a8429369..a1245fe0 100644 --- a/src/main/java/frc/robot/auto/shoot/AutoShoot.java +++ b/src/main/java/frc/robot/auto/shoot/AutoShoot.java @@ -484,7 +484,10 @@ public void execute() { DogLog.log("AutoShoot/HoodOffset", hoodOffset.in(Degrees), Degrees); DogLog.log("AutoShoot/TurretOffset", turretOffset.in(Degrees), Degrees); - DogLog.log("AutoShoot/FlywheelSpeedOffset", flywheelSpeedOffset.in(RotationsPerSecond), RotationsPerSecond); + DogLog.log( + "AutoShoot/FlywheelSpeedOffset", + flywheelSpeedOffset.in(RotationsPerSecond), + RotationsPerSecond); // Calculate the ideal shooting angles and roller speed to hit the target ShootingParameters appliedShootingParameters = calculate(Seconds.of(predictionTime)); From cc810338666194a58082915c5c67672bdc6b920d Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 4 Jun 2026 20:46:46 -0700 Subject: [PATCH 3/5] fixed small bug --- src/main/java/frc/robot/controls/TeleopControls.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/controls/TeleopControls.java b/src/main/java/frc/robot/controls/TeleopControls.java index d3f01c33..9e437172 100644 --- a/src/main/java/frc/robot/controls/TeleopControls.java +++ b/src/main/java/frc/robot/controls/TeleopControls.java @@ -293,7 +293,7 @@ public void configureBindings() { .moveAtVoltage(IntakeExtensionConstants.FINE_CONTROL_VOLTAGE.unaryMinus()))); // Intake extension and retraction - WORKS - Trigger intakeRetract = operator.rightStick().and(driver.start()); + Trigger intakeRetract = operator.rightStick().or(driver.start()); Trigger intakeExtend = intakeRetract.negate().and(RobotState::isTeleop).and(RobotState::isEnabled); From 0ae1582613b231efe3f1946b70b616c3aa3f4f01 Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 4 Jun 2026 21:40:26 -0700 Subject: [PATCH 4/5] Update TeleopControls.java --- src/main/java/frc/robot/controls/TeleopControls.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/controls/TeleopControls.java b/src/main/java/frc/robot/controls/TeleopControls.java index 9e437172..00acec00 100644 --- a/src/main/java/frc/robot/controls/TeleopControls.java +++ b/src/main/java/frc/robot/controls/TeleopControls.java @@ -476,7 +476,7 @@ private Angle mapOffset(double joystickInput, Angle maxOffset) { return Degrees.of( Math.signum(joystickInput) - * Math.pow(Math.abs(joystickInput), 2) + * (joystickInput * joystickInput) * maxOffset.in(Degrees)); } } @@ -490,7 +490,7 @@ private AngularVelocity mapOffset(double joystickInput, AngularVelocity maxOffse return RotationsPerSecond.of( Math.signum(joystickInput) - * Math.pow(Math.abs(joystickInput), 2) + * (joystickInput * joystickInput) * maxOffset.in(RotationsPerSecond)); } } From 6fac877d671f13e6dcb099dcf60b9fd985f0df52 Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 4 Jun 2026 21:40:49 -0700 Subject: [PATCH 5/5] Update TeleopControls.java --- src/main/java/frc/robot/controls/TeleopControls.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/controls/TeleopControls.java b/src/main/java/frc/robot/controls/TeleopControls.java index 00acec00..8ba1bbc2 100644 --- a/src/main/java/frc/robot/controls/TeleopControls.java +++ b/src/main/java/frc/robot/controls/TeleopControls.java @@ -475,9 +475,7 @@ private Angle mapOffset(double joystickInput, Angle maxOffset) { joystickInput /= 0.9; return Degrees.of( - Math.signum(joystickInput) - * (joystickInput * joystickInput) - * maxOffset.in(Degrees)); + Math.signum(joystickInput) * (joystickInput * joystickInput) * maxOffset.in(Degrees)); } }