From c0b14150fea4f877d94f64f4784aab66d0ce4ef6 Mon Sep 17 00:00:00 2001 From: TheRealGreydon Date: Thu, 8 Oct 2026 19:44:01 -0400 Subject: [PATCH] The thingy --- .../robot/commands/AutoTurretShootCommand.java | 16 ++-------------- .../frc/robot/subsystems/TurretSubsystem.java | 3 ++- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/frc/robot/commands/AutoTurretShootCommand.java b/src/main/java/frc/robot/commands/AutoTurretShootCommand.java index 33e9a0b..1a5ae28 100644 --- a/src/main/java/frc/robot/commands/AutoTurretShootCommand.java +++ b/src/main/java/frc/robot/commands/AutoTurretShootCommand.java @@ -1,28 +1,17 @@ package frc.robot.commands; import org.littletonrobotics.junction.Logger; - -import edu.wpi.first.math.geometry.Pose3d; -import edu.wpi.first.units.Units; -import edu.wpi.first.units.measure.Angle; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.CommandScheduler; -import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.*; import frc.robot.Constants; import frc.robot.Utils; -import frc.robot.subsystems.DriveSubsystem; -import frc.robot.subsystems.HopperSubsystem; -import frc.robot.subsystems.IntakeSubsystem; -import frc.robot.subsystems.TurretSubsystem; +import frc.robot.subsystems.*; public class AutoTurretShootCommand extends Command{ private HopperSubsystem hopperSubsystem; private TurretSubsystem turretSubsystem; - private IntakeSubsystem intakeSubsystem; private DriveSubsystem driveSubsystem; private Command waitCommand = Commands.waitSeconds(1.5); @@ -31,7 +20,6 @@ public class AutoTurretShootCommand extends Command{ public AutoTurretShootCommand(HopperSubsystem hopperSubsystem, TurretSubsystem turretSubsystem, IntakeSubsystem intakeSubsystem, DriveSubsystem driveSubsystem){ this.hopperSubsystem = hopperSubsystem; this.turretSubsystem = turretSubsystem; - this.intakeSubsystem = intakeSubsystem; this.driveSubsystem = driveSubsystem; addRequirements(hopperSubsystem, intakeSubsystem); diff --git a/src/main/java/frc/robot/subsystems/TurretSubsystem.java b/src/main/java/frc/robot/subsystems/TurretSubsystem.java index 582ca6a..728f06f 100644 --- a/src/main/java/frc/robot/subsystems/TurretSubsystem.java +++ b/src/main/java/frc/robot/subsystems/TurretSubsystem.java @@ -182,12 +182,13 @@ public class TurretSubsystem extends TestableSubsystem { int maxAngle = Constants.ShooterConstants.HOOD_ANGLE_MAX_DEG; // Confirm target is within expected range. If not, do nothing. + double pos; if ((angleDegrees <= maxAngle) && (angleDegrees >= minAngle)) { // Map so that min angle maps to "0" and max angle maps to "1." // The min angle corresponds to the hood's tallest physical position. - double pos = (double)(angleDegrees - minAngle) / (maxAngle - minAngle); + pos = (double)(angleDegrees - minAngle) / (maxAngle - minAngle); // Actuate the hood. hood.set(pos);