diff --git a/src/main/java/frc/lib/util/swerve/SwerveModule.java b/src/main/java/frc/lib/util/swerve/SwerveModule.java index 546acf1..2b68194 100644 --- a/src/main/java/frc/lib/util/swerve/SwerveModule.java +++ b/src/main/java/frc/lib/util/swerve/SwerveModule.java @@ -55,7 +55,7 @@ public SwerveModule(int moduleNumber, int driveMotorID, int angleMotorID, int ca /* Angle Encoder Config */ swerveCANcoderConfig.MagnetSensor.SensorDirection = Constants.Swerve.cancoderInvert; - angleEncoder = new CANcoder(cancoderID, "canivore"); + angleEncoder = new CANcoder(cancoderID, Constants.Swerve.canbus); angleEncoder.getConfigurator().apply(swerveCANcoderConfig); /* Angle Motor Config */ @@ -80,7 +80,7 @@ public SwerveModule(int moduleNumber, int driveMotorID, int angleMotorID, int ca swerveAngleFXConfig.Slot0.kP = Constants.Swerve.angleKP; swerveAngleFXConfig.Slot0.kI = Constants.Swerve.angleKI; swerveAngleFXConfig.Slot0.kD = Constants.Swerve.angleKD; - mAngleMotor = new TalonFX(angleMotorID, "canivore"); + mAngleMotor = new TalonFX(angleMotorID, Constants.Swerve.canbus); mAngleMotor.getConfigurator().apply(swerveAngleFXConfig); resetToAbsolute(); @@ -115,7 +115,7 @@ public SwerveModule(int moduleNumber, int driveMotorID, int angleMotorID, int ca Constants.Swerve.closedLoopRamp; swerveDriveFXConfig.ClosedLoopRamps.VoltageClosedLoopRampPeriod = Constants.Swerve.closedLoopRamp; - mDriveMotor = new TalonFX(driveMotorID, "canivore"); + mDriveMotor = new TalonFX(driveMotorID, Constants.Swerve.canbus); mDriveMotor.getConfigurator().apply(swerveDriveFXConfig); mDriveMotor.getConfigurator().setPosition(0.0); } diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index f9ac7fb..3e2894f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -29,6 +29,7 @@ public static final class Swerve { public static final boolean isOpenLoop = false; /* Drivetrain Constants */ + public static final String canbus = "canivore"; public static final double trackWidth = Units.inchesToMeters(22.5); public static final double wheelBase = Units.inchesToMeters(29.0); public static final double wheelDiameter = Units.inchesToMeters(4.0);