Skip to content

Commit

Permalink
remove talonutil for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 committed Aug 20, 2024
1 parent 530330c commit 855010b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 100 deletions.
87 changes: 0 additions & 87 deletions src/main/java/frc/robot/extras/TalonUtil.java

This file was deleted.

19 changes: 6 additions & 13 deletions src/main/java/frc/robot/subsystems/shooter/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import frc.robot.Constants.HardwareConstants;
import frc.robot.Constants.ShooterConstants;
import frc.robot.extras.SmarterDashboardRegistry;
import frc.robot.extras.TalonUtil;

public class ShooterSubsystem extends SubsystemBase {
private final TalonFX leaderFlywheel;
Expand Down Expand Up @@ -59,11 +58,8 @@ public ShooterSubsystem() {

private void configureTalons() throws RuntimeException {
TalonFXConfiguration shooterConfig = new TalonFXConfiguration();
TalonUtil.checkErrorAndRetry(
() -> leaderFlywheel.getConfigurator().refresh(shooterConfig, HardwareConstants.TIMEOUT_S));
TalonUtil.checkErrorAndRetry(
() ->
followerFlywheel.getConfigurator().refresh(shooterConfig, HardwareConstants.TIMEOUT_S));
leaderFlywheel.getConfigurator().refresh(shooterConfig, HardwareConstants.TIMEOUT_S);
followerFlywheel.getConfigurator().refresh(shooterConfig, HardwareConstants.TIMEOUT_S);

shooterConfig.Slot0.kP = ShooterConstants.SHOOT_P;
shooterConfig.Slot0.kI = ShooterConstants.SHOOT_I;
Expand All @@ -80,19 +76,16 @@ private void configureTalons() throws RuntimeException {
shooterConfig.CurrentLimits.SupplyCurrentLimit = ShooterConstants.SHOOTER_SUPPLY_LIMIT;
shooterConfig.CurrentLimits.SupplyCurrentLimitEnable = ShooterConstants.SHOOTER_SUPPLY_ENABLE;

TalonUtil.applyAndCheckConfiguration(
leaderFlywheel, shooterConfig, HardwareConstants.TIMEOUT_S);
leaderFlywheel.getConfigurator().apply(shooterConfig, HardwareConstants.TIMEOUT_S);
shooterConfig.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;
TalonUtil.applyAndCheckConfiguration(
followerFlywheel, shooterConfig, HardwareConstants.TIMEOUT_S);
followerFlywheel.getConfigurator().apply(shooterConfig, HardwareConstants.TIMEOUT_S);

TalonFXConfiguration rollerConfig = new TalonFXConfiguration();
TalonUtil.checkErrorAndRetry(
() -> leaderFlywheel.getConfigurator().refresh(rollerConfig, HardwareConstants.TIMEOUT_S));
rollerMotor.getConfigurator().refresh(rollerConfig, HardwareConstants.TIMEOUT_S);

rollerConfig.MotorOutput.NeutralMode = NeutralModeValue.Brake;
rollerConfig.MotorOutput.DutyCycleNeutralDeadband = HardwareConstants.MIN_FALCON_DEADBAND;
TalonUtil.applyAndCheckConfiguration(rollerMotor, rollerConfig, HardwareConstants.TIMEOUT_S);
rollerMotor.getConfigurator().apply(rollerConfig, HardwareConstants.TIMEOUT_S);
}

/**
Expand Down

0 comments on commit 855010b

Please sign in to comment.