Skip to content

Commit 9059304

Browse files
Use driveMotorType var instead of recomputing
Co-authored-by: CoolSpy3 <55305038+CoolSpy3@users.noreply.github.com>
1 parent f05de7c commit 9059304

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/carlmontrobotics/lib199/swerve/SwerveModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public SwerveModule(SwerveConfig config, ModuleType type, SparkBase drive, Spark
106106
final double vortexFreeCurrentAmps = 3.6; //theoretical?
107107
final double vortexStallCurrentAmps = 211; //theoretical?
108108

109-
double currentLimitAmps = MotorControllerType.getMotorControllerType(drive) == MotorControllerType.SPARK_FLEX ? //Assumes that drive motor is either a NEO or NEO Vortex, will need a code struture change when we start using NEO 2.0 potentially for drive
109+
double currentLimitAmps = driveMotorType == MotorControllerType.SPARK_FLEX ? //Assumes that drive motor is either a NEO or NEO Vortex, will need a code struture change when we start using NEO 2.0 potentially for drive
110110
vortexFreeCurrentAmps + 2*motorTorqueLimitNewtonMeters / vortexStallTorqueNewtonMeters * (vortexStallCurrentAmps-vortexFreeCurrentAmps) :
111111
neoFreeCurrentAmps + 2*motorTorqueLimitNewtonMeters / neoStallTorqueNewtonMeters * (neoStallCurrentAmps-neoFreeCurrentAmps);
112112

0 commit comments

Comments
 (0)