Refactoring PositionableMotor to PositionTrackingMotor

This commit is contained in:
Bradley committed 2026-10-18 22:27:01 -04:00
1 parent eee0faedec
commit 57770c8106
3 files changed
+5 -5

No files matched your search

@@ -1,6 +1,6 @@
package first.robot.coreio.abstracts; package first.robot.coreio.abstracts;
public abstract class PositionableMotor extends SimpleMotor { public abstract class PositionTrackingMotor extends SimpleMotor {
/** /**
* Returns the current position based on the internal motor config. * Returns the current position based on the internal motor config.
@@ -1,6 +1,6 @@
package first.robot.coreio.abstracts; package first.robot.coreio.abstracts;
public abstract class VelocityTrackingMotor extends PositionableMotor { public abstract class VelocityTrackingMotor extends PositionTrackingMotor {
/** /**
* Returns the current velocity based on the internal motor config. Up to the user * Returns the current velocity based on the internal motor config. Up to the user
@@ -2,7 +2,7 @@ package first.robot.coreio.utilities;
import org.wpilib.math.kinematics.SwerveModuleVelocity; import org.wpilib.math.kinematics.SwerveModuleVelocity;
import first.robot.coreio.abstracts.PositionableMotor; import first.robot.coreio.abstracts.PositionTrackingMotor;
import first.robot.coreio.abstracts.VelocityTrackingMotor; import first.robot.coreio.abstracts.VelocityTrackingMotor;
import first.robot.coreio.enums.SwerveModuleName; import first.robot.coreio.enums.SwerveModuleName;
@@ -10,12 +10,12 @@ public class SwerveModule {
private SwerveModuleName moduleName; private SwerveModuleName moduleName;
private VelocityTrackingMotor drive; private VelocityTrackingMotor drive;
private PositionableMotor turning; private PositionTrackingMotor turning;
private SwerveModuleVelocity lastTargetState; private SwerveModuleVelocity lastTargetState;
private SwerveModuleVelocity lastTargetStateOptimized; private SwerveModuleVelocity lastTargetStateOptimized;
public SwerveModule(SwerveModuleName moduleName, VelocityTrackingMotor drive, PositionableMotor turning) { public SwerveModule(SwerveModuleName moduleName, VelocityTrackingMotor drive, PositionTrackingMotor turning) {
this.moduleName = moduleName; this.moduleName = moduleName;
this.drive = drive; this.drive = drive;
this.turning = turning; this.turning = turning;