From 34b9b956c14798b4e957711c89d0cd0f959d8303 Mon Sep 17 00:00:00 2001 From: WesleyWong-972 Date: Wed, 11 Mar 2026 15:29:28 -0700 Subject: [PATCH] ran (climb moves) only up and calibrate working + adjusted shooter mod --- src/main/java/frc/robot/RobotContainer.java | 2 +- .../frc/robot/subsystems/Climb/ClimbConstants.java | 7 ++++--- .../java/frc/robot/subsystems/Climb/LinearClimb.java | 10 +++++----- .../java/frc/robot/subsystems/shooter/Shooter.java | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 56ebb66..85ed2ed 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -226,7 +226,7 @@ public class RobotContainer { if (turret != null && drive != null && hood != null && shooter != null && spindexer != null) { Command runSpindexer = new RunSpindexer(spindexer, turret); - NamedCommands.registerCommand("Auto shoot", new Superstructure(turret, drive, hood, shooter, spindexer)); + NamedCommands.registerCommand("Auto shoot", new AutoShootCommand(turret, drive, hood, shooter, spindexer)); NamedCommands.registerCommand("Start Spindexer", new InstantCommand(() -> CommandScheduler.getInstance().schedule(runSpindexer))); NamedCommands.registerCommand("Stop Spindexer", new InstantCommand(() -> runSpindexer.cancel())); diff --git a/src/main/java/frc/robot/subsystems/Climb/ClimbConstants.java b/src/main/java/frc/robot/subsystems/Climb/ClimbConstants.java index ff626c5..9a631ff 100644 --- a/src/main/java/frc/robot/subsystems/Climb/ClimbConstants.java +++ b/src/main/java/frc/robot/subsystems/Climb/ClimbConstants.java @@ -1,5 +1,6 @@ package frc.robot.subsystems.Climb; + import edu.wpi.first.math.util.Units; public class ClimbConstants { @@ -11,11 +12,11 @@ public class ClimbConstants { /** Winch spool radius in meters */ public final static double WHEEL_RADIUS = Units.inchesToMeters(0.334); /** climber stowed ? position in meters */ - public final static double BOTTOM_POSITION = Units.inchesToMeters(-8); + public final static double BOTTOM_POSITION = Units.inchesToMeters(8); /** Calibration position: lower than BOTTOM_POSITION to reduce motor strain */ - public final static double CALIBRATION_POSITION = Units.inchesToMeters(-8.5); + public final static double CALIBRATION_POSITION = Units.inchesToMeters(8.5); /** position that should put the robot off the ground? in meters. */ - public final static double CLIMB_POSITION = Units.inchesToMeters(-6); + public final static double CLIMB_POSITION = Units.inchesToMeters(6); public final static double UP_POSITION = 0.0; // current limits (in amps) diff --git a/src/main/java/frc/robot/subsystems/Climb/LinearClimb.java b/src/main/java/frc/robot/subsystems/Climb/LinearClimb.java index 812a31d..986c093 100644 --- a/src/main/java/frc/robot/subsystems/Climb/LinearClimb.java +++ b/src/main/java/frc/robot/subsystems/Climb/LinearClimb.java @@ -50,7 +50,7 @@ public class LinearClimb extends SubsystemBase implements LinearClimbIO { motor.setNeutralMode(NeutralModeValue.Brake); TalonFXConfiguration config = new TalonFXConfiguration(); - config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive; + config.MotorOutput.Inverted = InvertedValue.CounterClockwise_Positive; motor.getConfigurator().apply(config); setCurrentLimits(ClimbConstants.CALIBRATION_CURRENT); @@ -147,11 +147,11 @@ public class LinearClimb extends SubsystemBase implements LinearClimbIO { } motor.set(power); - SmartDashboard.putNumber("Climb/PID_Setpoint_Rotations", pid.getSetpoint()); - SmartDashboard.putNumber("Climb/Motor_Actual_Rotations", motor.getPosition().getValueAsDouble()); - SmartDashboard.putNumber("Climb/Motor_Actual_Meters", inputs.positionMeters); + SmartDashboard.putNumber("Climb PID_Setpoint_Rotations", pid.getSetpoint()); + SmartDashboard.putNumber("Climb Motor_Actual_Rotations", motor.getPosition().getValueAsDouble()); + SmartDashboard.putNumber("Climb Motor_Actual_Meters", inputs.positionMeters); - Logger.recordOutput("LinearClimb/setpointMeters", Units.rotationsToRadians(pid.getSetpoint()) + Logger.recordOutput("LinearClimb setpointMeters", Units.rotationsToRadians(pid.getSetpoint()) * ClimbConstants.WHEEL_RADIUS / ClimbConstants.CLIMB_GEAR_RATIO); updateInputs(); Logger.processInputs("LinearClimb", inputs); diff --git a/src/main/java/frc/robot/subsystems/shooter/Shooter.java b/src/main/java/frc/robot/subsystems/shooter/Shooter.java index b8c0208..3009047 100644 --- a/src/main/java/frc/robot/subsystems/shooter/Shooter.java +++ b/src/main/java/frc/robot/subsystems/shooter/Shooter.java @@ -30,7 +30,7 @@ public class Shooter extends SubsystemBase implements ShooterIO { private final ShooterIOInputsAutoLogged inputs = new ShooterIOInputsAutoLogged(); - double powerModifier = 1.3; + double powerModifier = 1.25; // TESTED public Shooter(){ updateInputs(); -- 2.39.5