]> git.taranathan.com Git - FRC2026.git/commitdiff
fixed can bus objects
authormixxlto <maxtan0626@gmail.com>
Sun, 18 Jan 2026 18:08:15 +0000 (10:08 -0800)
committermixxlto <maxtan0626@gmail.com>
Sun, 18 Jan 2026 18:08:15 +0000 (10:08 -0800)
src/main/java/frc/robot/constants/Constants.java
src/main/java/frc/robot/constants/swerve/DriveConstants.java
src/main/java/frc/robot/subsystems/LED/LED.java

index 6b99d880d9215b5551999926eca7a56082188b69..649cbc548b8c41e02a8f8636b61165ac50052054 100644 (file)
@@ -1,5 +1,7 @@
 package frc.robot.constants;
 
+import com.ctre.phoenix6.CANBus;
+
 import edu.wpi.first.wpilibj.RobotBase;
 
 public class Constants {
@@ -11,8 +13,8 @@ public class Constants {
     public static final double LOOP_TIME = 0.02;
 
     // CAN bus names
-    public static final String CANIVORE_CAN = "CANivore";
-    public static final String RIO_CAN = "rio";
+    public static final CANBus CANIVORE_CAN = new CANBus("CANivore");
+    public static final CANBus RIO_CAN = new CANBus("rio");
 
     // Logging 
     public static final boolean USE_TELEMETRY = true;
index 3e5726057400654b6f9d6c650d281e41f3922b4a..316893669cc26b8d02edb4edfe14c2fd414bb394 100644 (file)
@@ -1,5 +1,6 @@
 package frc.robot.constants.swerve;
 
+import com.ctre.phoenix6.CANBus;
 import com.ctre.phoenix6.signals.InvertedValue;
 import com.ctre.phoenix6.signals.NeutralModeValue;
 
@@ -110,10 +111,10 @@ public class DriveConstants {
     public static final double PATH_PLANNER_TRANSLATIONAL_D = 0;
 
     // CAN
-    public static String DRIVE_MOTOR_CAN = Constants.CANIVORE_CAN;
-    public static String STEER_MOTOR_CAN = Constants.CANIVORE_CAN;
-    public static String STEER_ENCODER_CAN = Constants.CANIVORE_CAN;
-    public static String PIGEON_CAN = Constants.CANIVORE_CAN;
+    public static CANBus DRIVE_MOTOR_CAN = Constants.CANIVORE_CAN;
+    public static CANBus STEER_MOTOR_CAN = Constants.CANIVORE_CAN;
+    public static CANBus STEER_ENCODER_CAN = Constants.CANIVORE_CAN;
+    public static CANBus PIGEON_CAN = Constants.CANIVORE_CAN;
 
 
     public static COTSFalconSwerveConstants MODULE_CONSTANTS = COTSFalconSwerveConstants.SDSMK4i(DRIVE_GEAR_RATIO);
index a521639facdfbd78a7bf694852479a5d142055c9..8bceb402d560d390a8f47f6fc1bb1cf0017b6b83 100644 (file)
@@ -1,6 +1,7 @@
 package frc.robot.subsystems.LED;
 
 import edu.wpi.first.wpilibj2.command.SubsystemBase;
+import frc.robot.constants.Constants;
 import frc.robot.constants.IdConstants;
 
 import com.ctre.phoenix.led.CANdle;
@@ -15,7 +16,7 @@ public class LED extends SubsystemBase {
 
     // Constructor
     public LED() {
-        this.candle = new CANdle(IdConstants.CANDLE_ID, "rio");
+        this.candle = new CANdle(IdConstants.CANDLE_ID);
 
         candle.configStatusLedState(false);
         candle.configLOSBehavior(false);