Skip to content

Commit bdfbdc4

Browse files
committed
Fix stale constant references left over from merge
Constants.java's UPPER_SNAKE_CASE rename (PR #192, merged from main) landed after the motorized intake arm's CAN ports and current-limit/voltage constants were written against the old names, so they never got renamed. Update the two Spark IO files to match.
1 parent 9f331c8 commit bdfbdc4

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/main/java/frc/robot/subsystems/intake/IntakeArmIOSimSpark.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class IntakeArmIOSimSpark implements IntakeArmIO {
4040
private final SparkMaxConfig followerConfig;
4141

4242
public IntakeArmIOSimSpark() {
43-
maxRight = new SparkMax(CAN2.intakeArmRight, MotorType.kBrushless);
44-
maxLeft = new SparkMax(CAN2.intakeArmLeft, MotorType.kBrushless);
43+
maxRight = new SparkMax(CAN2.INTAKE_ARM_RIGHT, MotorType.kBrushless);
44+
maxLeft = new SparkMax(CAN2.INTAKE_ARM_LEFT, MotorType.kBrushless);
4545

4646
controller = maxRight.getClosedLoopController();
4747

@@ -50,8 +50,8 @@ public IntakeArmIOSimSpark() {
5050
armConfig
5151
.inverted(false)
5252
.idleMode(IdleMode.kBrake)
53-
.smartCurrentLimit(NEOConstants.kDefaultSupplyCurrentLimit)
54-
.voltageCompensation(RobotConstants.kNominalVoltage);
53+
.smartCurrentLimit(NEOConstants.DEFAULT_SUPPLY_CURRENT_LIMIT)
54+
.voltageCompensation(RobotConstants.NOMINAL_VOLTAGE);
5555

5656
armConfig
5757
.encoder
@@ -69,7 +69,7 @@ public IntakeArmIOSimSpark() {
6969

7070
followerConfig = new SparkMaxConfig();
7171

72-
followerConfig.apply(armConfig).follow(CAN2.intakeArmRight);
72+
followerConfig.apply(armConfig).follow(CAN2.INTAKE_ARM_RIGHT);
7373

7474
maxRight.configure(armConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
7575
maxSim = new SparkMaxSim(maxRight, gearbox);
@@ -108,13 +108,13 @@ public void updateInputs(IntakeArmIOInputs inputs) {
108108

109109
@Override
110110
public void setOpenLoop(Voltage volts) {
111-
maxSim.setAppliedOutput(volts.in(Volts) / RobotConstants.kNominalVoltage);
111+
maxSim.setAppliedOutput(volts.in(Volts) / RobotConstants.NOMINAL_VOLTAGE);
112112
}
113113

114114
@Override
115115
public void setPosition(Angle rotation, AngularVelocity velocity) {
116116
double feedforward =
117-
RobotConstants.kNominalVoltage
117+
RobotConstants.NOMINAL_VOLTAGE
118118
* velocity.in(RadiansPerSecond)
119119
/ maxAngularVelocity.in(RadiansPerSecond);
120120
controller.setSetpoint(

src/main/java/frc/robot/subsystems/intake/IntakeArmIOSpark.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public class IntakeArmIOSpark implements IntakeArmIO {
4949
private boolean relativeEncoderSeeded = false;
5050

5151
public IntakeArmIOSpark() {
52-
intakeArmLeft = new SparkMax(CAN2.intakeArmLeft, MotorType.kBrushless);
53-
intakeArmRight = new SparkMax(CAN2.intakeArmRight, MotorType.kBrushless);
52+
intakeArmLeft = new SparkMax(CAN2.INTAKE_ARM_LEFT, MotorType.kBrushless);
53+
intakeArmRight = new SparkMax(CAN2.INTAKE_ARM_RIGHT, MotorType.kBrushless);
5454
absoluteEncoder = intakeArmLeft.getAbsoluteEncoder();
5555
encoderSpark = intakeArmLeft.getEncoder();
5656
intakeArmController = intakeArmLeft.getClosedLoopController();
@@ -67,8 +67,8 @@ public IntakeArmIOSpark() {
6767
leftArmConfig
6868
.inverted(false)
6969
.idleMode(IdleMode.kBrake)
70-
.smartCurrentLimit(NEOConstants.kDefaultSupplyCurrentLimit)
71-
.voltageCompensation(RobotConstants.kNominalVoltage);
70+
.smartCurrentLimit(NEOConstants.DEFAULT_SUPPLY_CURRENT_LIMIT)
71+
.voltageCompensation(RobotConstants.NOMINAL_VOLTAGE);
7272

7373
leftArmConfig
7474
.encoder
@@ -92,7 +92,7 @@ public IntakeArmIOSpark() {
9292

9393
rightArmConfig = new SparkMaxConfig();
9494

95-
rightArmConfig.apply(leftArmConfig).follow(CAN2.intakeArmRight, true);
95+
rightArmConfig.apply(leftArmConfig).follow(CAN2.INTAKE_ARM_RIGHT, true);
9696

9797
leftArmConfig
9898
.signals
@@ -140,7 +140,7 @@ public void setOpenLoop(Voltage volts) {
140140
@Override
141141
public void setPosition(Angle rotation, AngularVelocity velocity) {
142142
double feedforward =
143-
RobotConstants.kNominalVoltage
143+
RobotConstants.NOMINAL_VOLTAGE
144144
* velocity.in(RadiansPerSecond)
145145
/ maxAngularVelocity.in(RadiansPerSecond);
146146
double setpoint = MathUtil.clamp(rotation.magnitude(), minPosRad, maxPosRad);

0 commit comments

Comments
 (0)