From ac3a5a3a843bcf00d322b113946d925e22385a26 Mon Sep 17 00:00:00 2001 From: Gael Date: Mon, 22 Jan 2024 17:03:58 -0600 Subject: [PATCH 1/3] finished --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3c786bd..8fa63ce 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2024.1.1" + id "edu.wpi.first.GradleRIO" version "2024.2.1" } java { From f863c7fb9272b39a5442f21f60f1dda3927a8f46 Mon Sep 17 00:00:00 2001 From: Gael Date: Wed, 24 Jan 2024 17:23:32 -0600 Subject: [PATCH 2/3] finished --- src/main/java/frc/lib/util/swerve/SwerveModule.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/lib/util/swerve/SwerveModule.java b/src/main/java/frc/lib/util/swerve/SwerveModule.java index a1fa103..546acf1 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); + angleEncoder = new CANcoder(cancoderID, "canivore"); 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); + mAngleMotor = new TalonFX(angleMotorID, "canivore"); 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); + mDriveMotor = new TalonFX(driveMotorID, "canivore"); mDriveMotor.getConfigurator().apply(swerveDriveFXConfig); mDriveMotor.getConfigurator().setPosition(0.0); } From c0b3d5a2632a06a4862863b6c696bc28cac37132 Mon Sep 17 00:00:00 2001 From: Gael Date: Wed, 24 Jan 2024 17:26:57 -0600 Subject: [PATCH 3/3] even more finished --- src/main/java/frc/lib/util/swerve/SwerveModule.java | 6 +++--- src/main/java/frc/robot/Constants.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) 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);