From 46c187d8b41b8f01b3d5b59f21d246c21e370e3a Mon Sep 17 00:00:00 2001 From: CrumblzTheEgg Date: Fri, 10 Apr 2026 20:47:08 -0500 Subject: [PATCH 1/6] feat: add passing config (needs to be modeled) --- src/main/java/frc/robot/Constants.java | 58 +++++++++---------- src/main/java/frc/robot/RobotContainer.java | 28 ++++----- .../commands/IntakeAndShootWhileDriving.java | 3 +- .../robot/commands/ShootPreloadCommand.java | 3 +- .../robot/subsystems/ShooterSubsystem.java | 7 ++- .../frc/robot/subsystems/TurretSubsystem.java | 11 ++-- .../frc/robot/util/turret/TargetingData.java | 7 +++ .../robot/util/turret/TargetingStrategy.java | 18 ++++++ 8 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 src/main/java/frc/robot/util/turret/TargetingData.java create mode 100644 src/main/java/frc/robot/util/turret/TargetingStrategy.java diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4808b90..19aa372 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -448,23 +448,23 @@ public static class Turret { 0.537 //537!!! ); - public static final InterpolatingDoubleTreeMap HOOD_ANGLE_MAP = new InterpolatingDoubleTreeMap(); + public static final InterpolatingDoubleTreeMap SHOOTING_HOOD_ANGLE_MAP = new InterpolatingDoubleTreeMap(); static { - HOOD_ANGLE_MAP.put(3.23,14.8); - HOOD_ANGLE_MAP.put(4.19,16.8); - HOOD_ANGLE_MAP.put(4.72,18.8); - HOOD_ANGLE_MAP.put(5.38,19.5); - HOOD_ANGLE_MAP.put(4.44,16.7); - HOOD_ANGLE_MAP.put(2.71,12.7); - HOOD_ANGLE_MAP.put(1.71,10.3); + SHOOTING_HOOD_ANGLE_MAP.put(3.23,14.8); + SHOOTING_HOOD_ANGLE_MAP.put(4.19,16.8); + SHOOTING_HOOD_ANGLE_MAP.put(4.72,18.8); + SHOOTING_HOOD_ANGLE_MAP.put(5.38,19.5); + SHOOTING_HOOD_ANGLE_MAP.put(4.44,16.7); + SHOOTING_HOOD_ANGLE_MAP.put(2.71,12.7); + SHOOTING_HOOD_ANGLE_MAP.put(1.71,10.3); } - public static final TurretSolver.Config SOLVER_CONFIG = new TurretSolver.Config( + public static final TurretSolver.Config SHOOTING_SOLVER_CONFIG = new TurretSolver.Config( 0.0, TURRET_TRANSLATION, - HOOD_ANGLE_MAP, - Shooter.SHOOTER_VELOCITY_MAP, - Shooter.TIME_MAP, + SHOOTING_HOOD_ANGLE_MAP, + Shooter.SHOOTING_SHOOTER_VELOCITY_MAP, + Shooter.SHOOTING_TIME_MAP, 1.829 ); @@ -494,25 +494,25 @@ public static final class Shooter { public static final boolean MOTOR_INVERTED = true; - public static final InterpolatingDoubleTreeMap SHOOTER_VELOCITY_MAP = new InterpolatingDoubleTreeMap(); - public static final InterpolatingDoubleTreeMap TIME_MAP = new InterpolatingDoubleTreeMap(); + public static final InterpolatingDoubleTreeMap SHOOTING_SHOOTER_VELOCITY_MAP = new InterpolatingDoubleTreeMap(); + public static final InterpolatingDoubleTreeMap SHOOTING_TIME_MAP = new InterpolatingDoubleTreeMap(); static { - SHOOTER_VELOCITY_MAP.put(3.23,23.0); - SHOOTER_VELOCITY_MAP.put(4.19,25.0); - SHOOTER_VELOCITY_MAP.put(4.72,26.0); - SHOOTER_VELOCITY_MAP.put(5.38,27.0); - SHOOTER_VELOCITY_MAP.put(4.44,25.0); - SHOOTER_VELOCITY_MAP.put(2.71,21.0); - SHOOTER_VELOCITY_MAP.put(1.71,19.0); - - TIME_MAP.put(3.23,1.41); - TIME_MAP.put(4.19,1.47); - TIME_MAP.put(4.72,1.57); - TIME_MAP.put(5.38,1.61); - TIME_MAP.put(4.44,1.45); - TIME_MAP.put(2.71,1.30); - TIME_MAP.put(1.71,1.23); + SHOOTING_SHOOTER_VELOCITY_MAP.put(3.23,23.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(4.19,25.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(4.72,26.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(5.38,27.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(4.44,25.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(2.71,21.0); + SHOOTING_SHOOTER_VELOCITY_MAP.put(1.71,19.0); + + SHOOTING_TIME_MAP.put(3.23,1.41); + SHOOTING_TIME_MAP.put(4.19,1.47); + SHOOTING_TIME_MAP.put(4.72,1.57); + SHOOTING_TIME_MAP.put(5.38,1.61); + SHOOTING_TIME_MAP.put(4.44,1.45); + SHOOTING_TIME_MAP.put(2.71,1.30); + SHOOTING_TIME_MAP.put(1.71,1.23); } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 201aa90..b3bc16a 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -50,6 +50,8 @@ import frc.robot.util.swerve.requests.RotationRequest; import frc.robot.util.swerve.requests.TranslationDirective; import frc.robot.util.swerve.requests.TranslationRequest; +import frc.robot.util.turret.TargetingData; +import frc.robot.util.turret.TargetingStrategy; import frc.robot.util.turret.TurretSolver; import frc.robot.util.vision.detections.RobotDetection; @@ -85,7 +87,7 @@ private static enum FixedTarget { boolean xHeld = false; boolean yHeld = false; - Supplier targetingSupplier = () -> Translation3d.kZero; + Supplier targetingSupplier = () -> new TargetingData(Translation3d.kZero,TargetingStrategy.SHOOTING); SendableChooser intakeStrategyChooser = new SendableChooser<>(); @@ -261,7 +263,7 @@ public void updateFieldObjects() { } robotField.setRobotPose(driveSubsystem.getPose()); - robotField.getObject("Target").setPose(new Pose2d(targetingSupplier.get().toTranslation2d(), Rotation2d.kZero)); + robotField.getObject("Target").setPose(new Pose2d(targetingSupplier.get().translation().toTranslation2d(), Rotation2d.kZero)); } @@ -294,7 +296,7 @@ public void configureBindings() { Optional alliance = FieldUtil.getAlliance(); if (alliance.isPresent()) { if (FieldUtil.flipIfRed(Constants.Field.BLUE_ALLIANCE_ZONE).contains(robotPosition)) { - return FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION); + return new TargetingData(FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),TargetingStrategy.SHOOTING); } } @@ -331,10 +333,10 @@ public void configureBindings() { double targetHeight = SmartDashboard.getNumber(basePath + "TargetHeight", 0.25); if (detectedRobot.isPresent()) { - return detectedRobot.get().getPoseTranslation3d(); + return new TargetingData(detectedRobot.get().getPoseTranslation3d(),TargetingStrategy.PASSING); } else if (useFallback) { Translation3d fallbackTarget = new Translation3d(fallbackX, fallbackY, targetHeight); - return FieldUtil.flipIfRed(fallbackTarget); + return new TargetingData(FieldUtil.flipIfRed(fallbackTarget),TargetingStrategy.PASSING); } } @@ -347,7 +349,7 @@ public void configureBindings() { double x = SmartDashboard.getNumber(basePath + "X", 0.0); double y = SmartDashboard.getNumber(basePath + "Y", 0.0); double z = SmartDashboard.getNumber(basePath + "Z", 0.0); - return FieldUtil.flipIfRed(new Translation3d(x, y, z)); + return new TargetingData(FieldUtil.flipIfRed(new Translation3d(x, y, z)),TargetingStrategy.PASSING); } case B: { @@ -357,7 +359,7 @@ public void configureBindings() { double y = SmartDashboard.getNumber(basePath + "Y", 0.0); double z = SmartDashboard.getNumber(basePath + "Z", 0.0); - return FieldUtil.flipIfRed(new Translation3d(x, y, z)); + return new TargetingData(FieldUtil.flipIfRed(new Translation3d(x, y, z)),TargetingStrategy.PASSING); } default: { @@ -368,7 +370,7 @@ public void configureBindings() { double y = SmartDashboard.getNumber(basePath + "Y", 0.0); double z = SmartDashboard.getNumber(basePath + "Z", 0.0); - return FieldUtil.flipIfRed(new Translation3d(x, y, z)); + return new TargetingData(FieldUtil.flipIfRed(new Translation3d(x, y, z)),TargetingStrategy.PASSING); } } @@ -578,7 +580,7 @@ public void scheduleAutonomous() { Commands .waitSeconds(SmartDashboard.getNumber("Auto/StartDelay", Constants.Operator.Auto.DEFAULT_START_DELAY)), intakePivot.raiseIntakeCommand(), - turretSubsystem.getTargetCommand(() -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION), + turretSubsystem.getTargetCommand(() -> new TargetingData(FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),TargetingStrategy.SHOOTING), driveSubsystem::getPose, driveSubsystem::getVelocity)), new ShootPreloadCommand( @@ -587,7 +589,7 @@ public void scheduleAutonomous() { transferSubsystem, intakePivot, intakeRoller, - () -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION), + () -> new TargetingData(FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),TargetingStrategy.SHOOTING), driveSubsystem::getPose, driveSubsystem::getVelocity, SmartDashboard.getNumber("Auto/PreloadShootTime", Constants.Operator.Auto.DEFAULT_PRELOAD_SHOOT_TIME)), @@ -619,7 +621,7 @@ private Command getIntakeStrategyCommand() { shooterSubsystem, turretSubsystem, transferSubsystem, - () -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION), + () -> new TargetingData(FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),TargetingStrategy.SHOOTING), FieldUtil.flipIfRed(Constants.Operator.Auto.DEPOT_READY_INTAKE_POSE), FieldUtil.flipIfRed(Constants.Operator.Auto.DEPOT_INTAKE_POSE), false, @@ -634,7 +636,7 @@ private Command getIntakeStrategyCommand() { shooterSubsystem, turretSubsystem, transferSubsystem, - () -> FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION), + () -> new TargetingData(FieldUtil.flipIfRed(Constants.Field.BLUE_HUB_TRANSLATION),TargetingStrategy.SHOOTING), FieldUtil.flipIfRed(Constants.Operator.Auto.OUTPOST_READY_INTAKE_POSE), FieldUtil.flipIfRed(Constants.Operator.Auto.OUTPOST_INTAKE_POSE), false, @@ -720,7 +722,7 @@ private Command getIntakeStrategyCommand() { shooterSubsystem, turretSubsystem, transferSubsystem, - () -> FieldUtil.flipIfRed(target), + () -> new TargetingData(FieldUtil.flipIfRed(target),TargetingStrategy.PASSING), FieldUtil.flipIfRed(ready), FieldUtil.flipIfRed(intake), stow, diff --git a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java index 08e9bac..61fd185 100644 --- a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java +++ b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java @@ -9,6 +9,7 @@ import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import frc.robot.Constants; import frc.robot.subsystems.*; +import frc.robot.util.turret.TargetingData; public class IntakeAndShootWhileDriving extends SequentialCommandGroup { @@ -19,7 +20,7 @@ public IntakeAndShootWhileDriving( ShooterSubsystem shooter, TurretSubsystem turret, TransferSubsystem transfer, - Supplier targetingSupplier, + Supplier targetingSupplier, Pose2d readyPose, Pose2d intakePose, boolean stowTurret, diff --git a/src/main/java/frc/robot/commands/ShootPreloadCommand.java b/src/main/java/frc/robot/commands/ShootPreloadCommand.java index ac24416..14971b4 100644 --- a/src/main/java/frc/robot/commands/ShootPreloadCommand.java +++ b/src/main/java/frc/robot/commands/ShootPreloadCommand.java @@ -14,6 +14,7 @@ import frc.robot.subsystems.ShooterSubsystem; import frc.robot.subsystems.TransferSubsystem; import frc.robot.subsystems.TurretSubsystem; +import frc.robot.util.turret.TargetingData; public class ShootPreloadCommand extends SequentialCommandGroup { @@ -23,7 +24,7 @@ public ShootPreloadCommand( TransferSubsystem transfer, IntakePivotSubsystem intakePivot, IntakeRollerSubsystem intakeRoller, - Supplier targetSupplier, + Supplier targetSupplier, Supplier robotPoseSupplier, Supplier robotVelocitySupplier, double shootPreloadTime diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index 9d93cfd..e4287ae 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -20,6 +20,7 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Configs; import frc.robot.Constants; +import frc.robot.util.turret.TargetingData; import frc.robot.util.turret.TurretSolver; import frc.robot.util.turret.TurretUtil; @@ -177,7 +178,7 @@ public Command getStopCommand() { * @return a shooter velocity command driven by the ballistic solver */ public Command getTargetCommand( - Supplier targetTranslationSupplier, + Supplier targetingDataSupplier, Supplier robotPoseSupplier, Supplier robotVelocitySupplier ) { @@ -186,8 +187,8 @@ public Command getTargetCommand( TurretSolver.solve( robotPoseSupplier.get(), robotVelocitySupplier.get(), - targetTranslationSupplier.get(), - Constants.Turret.SOLVER_CONFIG + targetingDataSupplier.get().translation(), + targetingDataSupplier.get().strategy().getConfig() ); SmartDashboard.putNumber("Target Velocity", solution.getLaunchVelocity()); diff --git a/src/main/java/frc/robot/subsystems/TurretSubsystem.java b/src/main/java/frc/robot/subsystems/TurretSubsystem.java index b62c619..0522eb3 100644 --- a/src/main/java/frc/robot/subsystems/TurretSubsystem.java +++ b/src/main/java/frc/robot/subsystems/TurretSubsystem.java @@ -32,6 +32,7 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Configs; import frc.robot.Constants; +import frc.robot.util.turret.TargetingData; import frc.robot.util.turret.TurretSolver; import frc.robot.util.turret.TurretUtil; @@ -400,7 +401,7 @@ public Command getStowCommand() { * @return a turret-aiming command driven by the solver */ public Command getTargetCommand( - Supplier targetTranslationSupplier, + Supplier targetingDataSupplier, Supplier robotPoseSupplier, Supplier robotVelocitySupplier) { return getAngleCommand( @@ -408,16 +409,16 @@ public Command getTargetCommand( TurretSolver.State solution = TurretSolver.solve( robotPoseSupplier.get(), robotVelocitySupplier.get(), - targetTranslationSupplier.get(), - Constants.Turret.SOLVER_CONFIG); + targetingDataSupplier.get().translation(), + targetingDataSupplier.get().strategy().getConfig()); return solution.getYaw(); }, () -> { TurretSolver.State solution = TurretSolver.solve( robotPoseSupplier.get(), robotVelocitySupplier.get(), - targetTranslationSupplier.get(), - Constants.Turret.SOLVER_CONFIG); + targetingDataSupplier.get().translation(), + targetingDataSupplier.get().strategy().getConfig()); return solution.getPitch().plus( TurretUtil.pitchOffsetFromYaw(getAngle()) ); diff --git a/src/main/java/frc/robot/util/turret/TargetingData.java b/src/main/java/frc/robot/util/turret/TargetingData.java new file mode 100644 index 0000000..af9d7ad --- /dev/null +++ b/src/main/java/frc/robot/util/turret/TargetingData.java @@ -0,0 +1,7 @@ +package frc.robot.util.turret; + +import edu.wpi.first.math.geometry.Translation3d; + +public record TargetingData(Translation3d translation, TargetingStrategy strategy) { + +} diff --git a/src/main/java/frc/robot/util/turret/TargetingStrategy.java b/src/main/java/frc/robot/util/turret/TargetingStrategy.java new file mode 100644 index 0000000..aa96d2b --- /dev/null +++ b/src/main/java/frc/robot/util/turret/TargetingStrategy.java @@ -0,0 +1,18 @@ +package frc.robot.util.turret; + +import frc.robot.Constants; + +public enum TargetingStrategy { + SHOOTING(Constants.Turret.SHOOTING_SOLVER_CONFIG), + PASSING(Constants.Turret.SHOOTING_SOLVER_CONFIG); + + private TurretSolver.Config config; + + TargetingStrategy(TurretSolver.Config config) { + this.config = config; + }; + + public TurretSolver.Config getConfig() { + return config; + } +} From 1f295e6bdb0c97361941c64ce93b6d2591061908 Mon Sep 17 00:00:00 2001 From: N/A Date: Sat, 11 Apr 2026 09:35:11 -0500 Subject: [PATCH 2/6] feat: update outpost setpoints --- src/main/java/frc/robot/Constants.java | 8 ++++---- .../robot/commands/IntakeAndShootWhileDriving.java | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4808b90..6ede9d1 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -78,8 +78,8 @@ public static class Auto { public static final Pose2d DEPOT_READY_INTAKE_POSE = new Pose2d(1.250,6.000,Rotation2d.k180deg); public static final Pose2d DEPOT_INTAKE_POSE = new Pose2d(0.650,6.000,Rotation2d.k180deg); - public static final Pose2d OUTPOST_READY_INTAKE_POSE = new Pose2d(1.375,0.661,Rotation2d.k180deg); - public static final Pose2d OUTPOST_INTAKE_POSE = new Pose2d(0.619,0.661,Rotation2d.k180deg); + public static final Pose2d OUTPOST_READY_INTAKE_POSE = new Pose2d(0.495,1.617,Rotation2d.kCW_90deg); + public static final Pose2d OUTPOST_INTAKE_POSE = new Pose2d(0.495,0.661,Rotation2d.kCW_90deg); public static final List NEUTRAL_LEFT_SEQUENCE_ONE = List.of( new Pose2d(7.730, 7.457, Rotation2d.fromDegrees(160)), @@ -418,8 +418,8 @@ public static class Turret { public static final boolean PITCH_INVERTED = true; public static final Rotation2d MAX_PITCH = Rotation2d.fromDegrees(45.0); - public static final Rotation2d MIN_PITCH = Rotation2d.fromDegrees(8.00); - public static final Rotation2d HOOD_START_POSITION = Rotation2d.fromDegrees(8.00); + public static final Rotation2d MIN_PITCH = Rotation2d.fromDegrees(7.00); + public static final Rotation2d HOOD_START_POSITION = Rotation2d.fromDegrees(7.00); public static final double HOOD_STABLE_TIME = 0.1; public static final double HOOD_STABLE = 5; diff --git a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java index 08e9bac..5773f43 100644 --- a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java +++ b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java @@ -38,6 +38,17 @@ public IntakeAndShootWhileDriving( // Drive to ready pose pathToReady, + Commands.parallel( + intakePivot.deployIntakeCommand(), + intakeRoller.getIntakeCommand(), + + shooter.getTargetCommand( + targetingSupplier, + drive::getPose, + drive::getVelocity), + turret.getTargetCommand(targetingSupplier, drive::getPose, drive::getVelocity) + ).withTimeout(1.0), + // Intake + shoot while slowly driving Commands.deadline( drive.getDriveToPoseCommand( From 84d4d8f56167106b7ca67fc9500a669185d771af Mon Sep 17 00:00:00 2001 From: CrumblzTheEgg Date: Thu, 16 Apr 2026 18:09:37 -0500 Subject: [PATCH 3/6] feat: implement passing data --- src/main/java/frc/robot/Constants.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 19aa372..f0eb7c9 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -459,6 +459,14 @@ public static class Turret { SHOOTING_HOOD_ANGLE_MAP.put(1.71,10.3); } + public static final InterpolatingDoubleTreeMap PASSING_HOOD_ANGLE_MAP = new InterpolatingDoubleTreeMap(); + static { + PASSING_HOOD_ANGLE_MAP.put(6.05,22.8); + PASSING_HOOD_ANGLE_MAP.put(8.05,24.9); + PASSING_HOOD_ANGLE_MAP.put(9.85,26.8); + PASSING_HOOD_ANGLE_MAP.put(13.85,29.8); + } + public static final TurretSolver.Config SHOOTING_SOLVER_CONFIG = new TurretSolver.Config( 0.0, TURRET_TRANSLATION, @@ -515,6 +523,20 @@ public static final class Shooter { SHOOTING_TIME_MAP.put(1.71,1.23); } + public static final InterpolatingDoubleTreeMap PASSING_SHOOTER_VELOCITY_MAP = new InterpolatingDoubleTreeMap(); + public static final InterpolatingDoubleTreeMap PASSING_TIME_MAP = new InterpolatingDoubleTreeMap(); + static { + PASSING_SHOOTER_VELOCITY_MAP.put(6.05,20.0); + PASSING_SHOOTER_VELOCITY_MAP.put(8.05,25.0); + PASSING_SHOOTER_VELOCITY_MAP.put(9.85,32.0); + PASSING_SHOOTER_VELOCITY_MAP.put(13.85,40.0); + + PASSING_TIME_MAP.put(6.05,1.46); + PASSING_TIME_MAP.put(8.05,1.61); + PASSING_TIME_MAP.put(9.85,1.65); + PASSING_TIME_MAP.put(13.85,2.06); + } + } public static class Transfer { public static final int TRANSFER_KICKER_ID = 58; From e1946a0a3b101897d7a9d9395f6f11ce1d862513 Mon Sep 17 00:00:00 2001 From: CrumblzTheEgg Date: Thu, 16 Apr 2026 18:28:59 -0500 Subject: [PATCH 4/6] fix: remove auto stowing and expand alliance zone --- src/main/java/frc/robot/Constants.java | 4 ++-- src/main/java/frc/robot/RobotContainer.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index f0eb7c9..6d4de6a 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -70,7 +70,7 @@ public static class ErrorSettings { public static class Auto { public static final double DEFAULT_START_DELAY = 0.0; - public static final double DEFAULT_PRELOAD_SHOOT_TIME = 0.0; + public static final double DEFAULT_PRELOAD_SHOOT_TIME = 4.0; public static final double DEFAULT_INTAKE_SHOOT_TIME = 4.0; public static final double AUTO_INTAKE_MAX_SPEED = 1.0; @@ -210,7 +210,7 @@ public static double flipY(double y) { 0.000); public static final Translation2d BLUE_ALLIANCE_ZONE_C2 = new Translation2d( - 4.028, + 4.647, flipY(BLUE_ALLIANCE_ZONE_C1.getY())); public static final Translation2d RED_ALLIANCE_ZONE_C1 = flipTranslation(BLUE_ALLIANCE_ZONE_C1); diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index b3bc16a..c687f85 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -379,8 +379,7 @@ public void configureBindings() { // Driver controls Trigger stowTrigger = new Trigger( - () -> driverController.getBButton() || SwerveUtil.willRobotEnterRegion(driveSubsystem.getPose(), - driveSubsystem.getVelocity(), Constants.Field.TRENCH_REGION, Constants.Drive.HOOD_STOW_LOOKAHEAD_TIME)); + () -> driverController.getBButton()); stowTrigger.and(() -> !FieldUtil.isAutonomous()).whileTrue( turretSubsystem.getStowCommand()); From 144d30aac67f82027ee45bf231d2ae185cd994fa Mon Sep 17 00:00:00 2001 From: CrumblzTheEgg Date: Thu, 16 Apr 2026 19:20:58 -0500 Subject: [PATCH 5/6] fix: config with passing --- src/main/java/frc/robot/Constants.java | 14 +++++++++++--- .../frc/robot/util/turret/TargetingStrategy.java | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 6d4de6a..757844f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -208,7 +208,6 @@ public static double flipY(double y) { public static final Translation2d BLUE_ALLIANCE_ZONE_C1 = new Translation2d( 0.000, 0.000); - public static final Translation2d BLUE_ALLIANCE_ZONE_C2 = new Translation2d( 4.647, flipY(BLUE_ALLIANCE_ZONE_C1.getY())); @@ -409,7 +408,7 @@ public static class Turret { public static final double TURN_TABLE_RATIO = 24.0 / 200.0; public static final double ENCODER_FACTOR = (TURRET_GEAR_REDUCTION) / (2.0 * Math.PI * TURN_TABLE_RATIO); - public static final double STOW_PUSH_DOWN_SPEED = 0.6; // percent of max speed + public static final double STOW_PUSH_DOWN_SPEED = 0.3; // percent of max speed public static final double STOW_PUSH_DOWN_TIME = 0.1; // seconds public static final double PITCH_GEAR_RATIO = (26.0 / 447.2); @@ -425,7 +424,7 @@ public static class Turret { public static final double HOOD_STABLE = 5; public static final double HOOD_FINISH_VELOCITY = 0.1; - public static final Rotation2d HOOD_FAR_ANGLE = Rotation2d.fromDegrees(-50.0); + public static final Rotation2d HOOD_FAR_ANGLE = Rotation2d.fromDegrees(-10.0); public static final double OUTPUT_RANGE_MAX = 1; public static final double OUTPUT_RANGE_MIN = -1; @@ -476,6 +475,15 @@ public static class Turret { 1.829 ); + public static final TurretSolver.Config PASSING_SOLVER_CONFIG = new TurretSolver.Config( + 0.0, + TURRET_TRANSLATION, + PASSING_HOOD_ANGLE_MAP, + Shooter.PASSING_SHOOTER_VELOCITY_MAP, + Shooter.PASSING_TIME_MAP, + 0.0 + ); + } public static final class Shooter { diff --git a/src/main/java/frc/robot/util/turret/TargetingStrategy.java b/src/main/java/frc/robot/util/turret/TargetingStrategy.java index aa96d2b..ba06e55 100644 --- a/src/main/java/frc/robot/util/turret/TargetingStrategy.java +++ b/src/main/java/frc/robot/util/turret/TargetingStrategy.java @@ -4,7 +4,7 @@ public enum TargetingStrategy { SHOOTING(Constants.Turret.SHOOTING_SOLVER_CONFIG), - PASSING(Constants.Turret.SHOOTING_SOLVER_CONFIG); + PASSING(Constants.Turret.PASSING_SOLVER_CONFIG); private TurretSolver.Config config; From 4b7b8fa2e73a5e29906679142c95aa0e29664e5e Mon Sep 17 00:00:00 2001 From: CrumblzTheEgg Date: Thu, 16 Apr 2026 20:07:57 -0500 Subject: [PATCH 6/6] fix: fixed pose and behavior of autos --- src/main/java/frc/robot/Constants.java | 4 ++-- .../java/frc/robot/commands/IntakeAndShootWhileDriving.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index c675335..d485253 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -78,8 +78,8 @@ public static class Auto { public static final Pose2d DEPOT_READY_INTAKE_POSE = new Pose2d(1.250,6.000,Rotation2d.k180deg); public static final Pose2d DEPOT_INTAKE_POSE = new Pose2d(0.650,6.000,Rotation2d.k180deg); - public static final Pose2d OUTPOST_READY_INTAKE_POSE = new Pose2d(0.495,1.617,Rotation2d.kCW_90deg); - public static final Pose2d OUTPOST_INTAKE_POSE = new Pose2d(0.495,0.661,Rotation2d.kCW_90deg); + public static final Pose2d OUTPOST_READY_INTAKE_POSE = new Pose2d(0.495,1.922,Rotation2d.kCW_90deg); + public static final Pose2d OUTPOST_INTAKE_POSE = new Pose2d(0.495,0.966,Rotation2d.kCW_90deg); public static final List NEUTRAL_LEFT_SEQUENCE_ONE = List.of( new Pose2d(7.730, 7.457, Rotation2d.fromDegrees(160)), diff --git a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java index ccc3170..85e507b 100644 --- a/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java +++ b/src/main/java/frc/robot/commands/IntakeAndShootWhileDriving.java @@ -75,7 +75,6 @@ public IntakeAndShootWhileDriving( // Stop driving + intake Commands.parallel( drive.getStopCommand(), - intakePivot.raiseIntakeCommand(), intakeRoller.getStopCommand() ), @@ -85,7 +84,8 @@ public IntakeAndShootWhileDriving( // Finally stop shooter + turret Commands.parallel( shooter.getStopCommand(), - transfer.getStopCommand() + transfer.getStopCommand(), + intakePivot.raiseIntakeCommand() ) ); }