Skip to content

Commit

Permalink
prep
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticthegreat committed Nov 6, 2024
1 parent 85d3888 commit d983f4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
28 changes: 14 additions & 14 deletions src/main/java/frc/robot/subsystems/climb/ClimbConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ public final class ClimbConstants {
.withStatorCurrentLimitEnable(true)
.withStatorCurrentLimit(60));
public static final TalonFXConfiguration righClimbConfig =
new TalonFXConfiguration()
.withSlot0(new Slot0Configs().withKS(0).withKV(0).withKP(1).withKI(0).withKD(0))
.withMotorOutput(
new MotorOutputConfigs()
.withNeutralMode(NeutralModeValue.Brake)
.withInverted(InvertedValue.Clockwise_Positive))
.withMotionMagic(
new MotionMagicConfigs()
.withMotionMagicAcceleration(400)
.withMotionMagicCruiseVelocity(100))
.withCurrentLimits(
new CurrentLimitsConfigs()
.withStatorCurrentLimitEnable(true)
.withStatorCurrentLimit(60));
new TalonFXConfiguration()
.withSlot0(new Slot0Configs().withKS(0).withKV(0).withKP(1).withKI(0).withKD(0))
.withMotorOutput(
new MotorOutputConfigs()
.withNeutralMode(NeutralModeValue.Brake)
.withInverted(InvertedValue.Clockwise_Positive))
.withMotionMagic(
new MotionMagicConfigs()
.withMotionMagicAcceleration(400)
.withMotionMagicCruiseVelocity(100))
.withCurrentLimits(
new CurrentLimitsConfigs()
.withStatorCurrentLimitEnable(true)
.withStatorCurrentLimit(60));
}
5 changes: 2 additions & 3 deletions src/main/java/frc/robot/subsystems/climb/ClimbIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class ClimbIOTalonFX implements ClimbIO {
private final StatusSignal<Double> climbMotorReferenceSlope =
leftClimbMotor.getClosedLoopReferenceSlope();



private final TalonFX rightClimbMotor = new TalonFX(ClimbConstants.kRightClimbMotorID);

private final Follower rightClimbFollowReq = new Follower(leftClimbMotor.getDeviceID(), false);
Expand All @@ -42,7 +40,8 @@ public ClimbIOTalonFX() {
TalonUtil.applyAndCheckConfiguration(leftClimbMotor, leftClimbConfig);

var rightClimbConfig = ClimbConstants.righClimbConfig;
PhoenixUtil.checkErrorAndRetry(() -> rightClimbMotor.getConfigurator().refresh(rightClimbConfig));
PhoenixUtil.checkErrorAndRetry(
() -> rightClimbMotor.getConfigurator().refresh(rightClimbConfig));
TalonUtil.applyAndCheckConfiguration(rightClimbMotor, rightClimbConfig);

BaseStatusSignal.setUpdateFrequencyForAll(
Expand Down

0 comments on commit d983f4c

Please sign in to comment.