From 3750a97424bfa4c90fc68b8db323029cdbb55452 Mon Sep 17 00:00:00 2001 From: mimigamin Date: Thu, 2 Apr 2026 18:27:51 -0600 Subject: [PATCH] Add indexer current --- .../robot/subsystems/climber/ClimberConstants.java | 2 +- .../robot/subsystems/intake/IntakeConstants.java | 4 ++-- .../robot/subsystems/intake/IntakeReal.java | 14 +------------- .../robot/subsystems/shooter/ShooterConstants.java | 8 ++++---- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/climber/ClimberConstants.java b/src/main/java/frc4388/robot/subsystems/climber/ClimberConstants.java index fc45dba..e83b166 100644 --- a/src/main/java/frc4388/robot/subsystems/climber/ClimberConstants.java +++ b/src/main/java/frc4388/robot/subsystems/climber/ClimberConstants.java @@ -44,6 +44,6 @@ public class ClimberConstants { ).withMotorOutput( new MotorOutputConfigs() .withNeutralMode(NeutralModeValue.Brake) // Must be break because this has to be accurate - .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move ); } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/subsystems/intake/IntakeConstants.java b/src/main/java/frc4388/robot/subsystems/intake/IntakeConstants.java index a5f7c02..92c7885 100644 --- a/src/main/java/frc4388/robot/subsystems/intake/IntakeConstants.java +++ b/src/main/java/frc4388/robot/subsystems/intake/IntakeConstants.java @@ -116,7 +116,7 @@ public class IntakeConstants { // ).withMotorOutput( // new MotorOutputConfigs() // .withNeutralMode(NeutralModeValue.Brake) // Must be break because this has to be accurate - // .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + // .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move // ); public static final TalonFXConfiguration ROLLER_MOTOR_CONFIG = new TalonFXConfiguration() @@ -127,6 +127,6 @@ public class IntakeConstants { ).withMotorOutput( new MotorOutputConfigs() .withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny - .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move ); } diff --git a/src/main/java/frc4388/robot/subsystems/intake/IntakeReal.java b/src/main/java/frc4388/robot/subsystems/intake/IntakeReal.java index 4d294be..77206ba 100644 --- a/src/main/java/frc4388/robot/subsystems/intake/IntakeReal.java +++ b/src/main/java/frc4388/robot/subsystems/intake/IntakeReal.java @@ -1,27 +1,15 @@ package frc4388.robot.subsystems.intake; import static edu.wpi.first.units.Units.Amps; -import static edu.wpi.first.units.Units.Rotation; import static edu.wpi.first.units.Units.Rotations; import static edu.wpi.first.units.Units.RotationsPerSecond; -import static edu.wpi.first.units.Units.RotationsPerSecondPerSecond; -import com.ctre.phoenix6.controls.DutyCycleOut; -import com.ctre.phoenix6.controls.PositionDutyCycle; -import com.ctre.phoenix6.controls.PositionVoltage; import com.ctre.phoenix6.hardware.TalonFX; import com.revrobotics.PersistMode; import com.revrobotics.ResetMode; import com.revrobotics.spark.SparkMax; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.math.util.Units; -import edu.wpi.first.units.measure.Acceleration; import edu.wpi.first.units.measure.Angle; -import edu.wpi.first.units.measure.Velocity; -import edu.wpi.first.wpilibj.DigitalInput; -import edu.wpi.first.wpilibj.DutyCycleEncoder; -import frc4388.robot.subsystems.shooter.ShooterConstants; import frc4388.utility.compute.JankCoder; public class IntakeReal implements IntakeIO { @@ -114,7 +102,7 @@ public class IntakeReal implements IntakeIO { state.armMotorCurrent = Amps.of(m_armMotor.getOutputCurrent()); state.rollerOutput = m_rollerMotor.get(); - // state.rollerMotorCurrent = Amps.of(m_rollerMotor.getOutputCurrent()); + state.rollerMotorCurrent = m_rollerMotor.getStatorCurrent().getValue(); state.retractedSoftLimit = retractedLimit(); state.extendedSoftLimit = extendedLimit(); diff --git a/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java b/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java index fdf0af5..72d2c34 100644 --- a/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java +++ b/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java @@ -16,7 +16,7 @@ public class ShooterConstants { // Motor conversions public static final double SHOOTERMOTOR_GEAR_RATIO = 1.286; // TODO: supposed to be 9 rotations in to 7 out -- 0.77 or 1.29 - public static final double INDEXER_GEAR_RATIO = 1.72; // TODO: change it is supposed to be 18 to 31 + // public static final double INDEXER_GEAR_RATIO = 1.; public static final double T_CONSTANT = 2; public static final double SHOOTER_RADIUS = 2/39.37; public static final double INDEXER_RADIUS = 0.625/39.37; @@ -116,7 +116,7 @@ public class ShooterConstants { ).withMotorOutput( new MotorOutputConfigs() .withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny - .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move ); public static final TalonFXConfiguration SHOOTER2_MOTOR_CONFIG = new TalonFXConfiguration() .withCurrentLimits( @@ -126,7 +126,7 @@ public class ShooterConstants { ).withMotorOutput( new MotorOutputConfigs() .withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny - .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move ); public static final TalonFXConfiguration INDEXER_MOTOR_CONFIG = new TalonFXConfiguration() @@ -137,6 +137,6 @@ public class ShooterConstants { ).withMotorOutput( new MotorOutputConfigs() .withNeutralMode(NeutralModeValue.Coast) // Must be coast because this is spinny spinny - .withDutyCycleNeutralDeadband(0.04) // TODO: Figure out what this means + .withDutyCycleNeutralDeadband(0.04) // This sets the minimum output of motor so if its less than 4% it wont move ); }