From 2ecdd4a400ea654f54866b54af495b04236b68fa Mon Sep 17 00:00:00 2001 From: abi-appusamy9932 Date: Wed, 9 Jul 2025 15:04:26 -0400 Subject: [PATCH 1/3] led code LedIO + CANdle and Sim implementations LedStrip for high level control --- .../java/org/team2342/lib/leds/LedIO.java | 35 +++- .../org/team2342/lib/leds/LedIOCANdle.java | 89 ++++++++- .../java/org/team2342/lib/leds/LedIOSim.java | 48 +++++ .../java/org/team2342/lib/leds/LedStrip.java | 149 +++++++++++++++ .../team2342/lib/motors/dumb/DumbMotorIO.java | 20 ++ .../lib/motors/dumb/DumbMotorIOSim.java | 17 ++ .../lib/motors/dumb/DumbMotorIOTalonFX.java | 20 ++ vendordeps/Phoenix5-5.35.1.json | 171 ++++++++++++++++++ 8 files changed, 547 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/team2342/lib/leds/LedIOSim.java create mode 100644 src/main/java/org/team2342/lib/leds/LedStrip.java create mode 100644 vendordeps/Phoenix5-5.35.1.json diff --git a/src/main/java/org/team2342/lib/leds/LedIO.java b/src/main/java/org/team2342/lib/leds/LedIO.java index 3252197..b5b329c 100644 --- a/src/main/java/org/team2342/lib/leds/LedIO.java +++ b/src/main/java/org/team2342/lib/leds/LedIO.java @@ -6,4 +6,37 @@ package org.team2342.lib.leds; -public interface LedIO {} +import com.ctre.phoenix.led.Animation; +import edu.wpi.first.wpilibj.util.Color; + +/** + * Interface for LED input/output Allows for different LED implementations to use the same structure + */ +public interface LedIO { + /** Container class for LED inputs - used for logging and data updates. */ + public static class LedIOInputs { + public Color firstHalfColor = Color.kWhite; + public Color secondHalfColor = Color.kWhite; + } + + /** + * Called periodically to update the LED input data. + * + * @param inputs The object that stores LED readings to be logged or used somewhere else. + */ + public default void updateInputs(LedIOInputs inputs) {} + /** + * Sets the color for the first or second half of the LED strip. + * + * @param color The color to set for the half + */ + public default void setFirstHalfColor(Color color) {} + + public default void setSecondHalfColor(Color color) {} + /** + * Sets the animation for the LED strip. + * + * @param animation The animation to apply to the LED strip. + */ + public default void setAnimation(Animation animation) {} +} diff --git a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java index e3e27c8..d69dddb 100644 --- a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java +++ b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java @@ -6,4 +6,91 @@ package org.team2342.lib.leds; -public class LedIOCANdle implements LedIO {} +import com.ctre.phoenix.led.Animation; +import com.ctre.phoenix.led.CANdle; +import com.ctre.phoenix.led.CANdle.LEDStripType; +import com.ctre.phoenix.led.CANdleConfiguration; +import edu.wpi.first.wpilibj.util.Color; + +/** + * Implementation of LedIO using a CANdle device. This class manages the LED strip by controlling + * the colors and animations. + */ +public class LedIOCANdle implements LedIO { + private final CANdle candle; + private final int totalLeds; + private final int halfLength; + + private Color firstHalfColor = Color.kWhite; + private Color secondHalfColor = Color.kWhite; + + /** + * Constructor for LedIOCANdle. Initializes the CANdle with the specified CAN ID and LED count. + * + * @param canId The CAN ID of the CANdle device. + * @param LedCount The total number of LEDs in the strip. + */ + public LedIOCANdle(int canId, int LedCount) { + candle = new CANdle(canId); + totalLeds = LedCount; + halfLength = LedCount / 2; + + CANdleConfiguration config = new CANdleConfiguration(); + config.stripType = LEDStripType.RGB; + config.brightnessScalar = 1.0; + candle.configAllSettings(config); + } + + /** + * Called periodically to update the LED input data. + * @param inputs The LedIOInputs object to update + */ + @Override + public void updateInputs(LedIOInputs inputs) { + inputs.firstHalfColor = firstHalfColor; + inputs.secondHalfColor = secondHalfColor; + } + + /** + * Sets the color for the first half and second half of the LED strip. + * + * @param color The color to set for the half + */ + @Override + public void setFirstHalfColor(Color color) { + firstHalfColor = color; + candle.clearAnimation(0); + candle.setLEDs( + (int) (color.red * 255), + (int) (color.green * 255), + (int) (color.blue * 255), + 0, + 0, + halfLength); + } + + @Override + public void setSecondHalfColor(Color color) { + secondHalfColor = color; + candle.clearAnimation(0); + candle.setLEDs( + (int) (color.red * 255), + (int) (color.green * 255), + (int) (color.blue * 255), + 0, + halfLength, + halfLength); + } + + /** + * Sets the animation for the LED strip. + * + * @param animation The animation to apply to the LED strip. + */ + @Override + public void setAnimation(Animation animation) { + candle.clearAnimation(0); + animation.setNumLed(totalLeds); + candle.animate(animation); + } +} diff --git a/src/main/java/org/team2342/lib/leds/LedIOSim.java b/src/main/java/org/team2342/lib/leds/LedIOSim.java new file mode 100644 index 0000000..8717985 --- /dev/null +++ b/src/main/java/org/team2342/lib/leds/LedIOSim.java @@ -0,0 +1,48 @@ +package org.team2342.lib.leds; + +import org.littletonrobotics.junction.Logger; +import edu.wpi.first.wpilibj.util.Color; + +/** + * Simulation implementation of LedIO + * Logs RGB values + * + */ +public class LedIOSim implements LedIO { + private Color firstHalfColor = Color.kWhite; + private Color secondHalfColor = Color.kWhite; + + /** + * Sets the color for the first or second half of the LED strip + * + * @param color The color to set for the half + */ + @Override + public void setFirstHalfColor(Color color) { + firstHalfColor = color; + } + + @Override + public void setSecondHalfColor(Color color) { + secondHalfColor = color; + } + + /** + * Called periodically to update the LED input data + * + * @param inputs The LedIOInputs object to update + */ + @Override + public void updateInputs(LedIOInputs inputs) { + inputs.firstHalfColor = firstHalfColor; + inputs.secondHalfColor = secondHalfColor; + + Logger.recordOutput("LED/FirstHalf/Red", firstHalfColor.red); + Logger.recordOutput("LED/FirstHalf/Green", firstHalfColor.green); + Logger.recordOutput("LED/FirstHalf/Blue", firstHalfColor.blue); + + Logger.recordOutput("LED/SecondHalf/Red", secondHalfColor.red); + Logger.recordOutput("LED/SecondHalf/Green", secondHalfColor.green); + Logger.recordOutput("LED/SecondHalf/Blue", secondHalfColor.blue); + } +} diff --git a/src/main/java/org/team2342/lib/leds/LedStrip.java b/src/main/java/org/team2342/lib/leds/LedStrip.java new file mode 100644 index 0000000..15e7ebc --- /dev/null +++ b/src/main/java/org/team2342/lib/leds/LedStrip.java @@ -0,0 +1,149 @@ +// Copyright (c) 2025 Team 2342 +// https://github.com/FRCTeamPhoenix +// +// This source code is licensed under the MIT License. +// See the LICENSE file in the root directory of this project. + +package org.team2342.lib.leds; + +import com.ctre.phoenix.led.*; +import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj.util.Color; +import java.util.EnumSet; + +/** + * High-level LED control that splits a strip into two halves: one for the driver and one for the + * operator. Each side can be assigned a color and an effect (solid, flashing, animations). + * + *

Use `setDriver()` and `setOperator()` to configure each side. Call `periodic()` each loop to + * update animations or effects. Example usage in robot code: + * + *

{@code
+ * ledStrip.setDriver(Color.kRed, LedStrip.Effect.FIRE);
+ * ledStrip.setOperator(Color.kBlue, LedStrip.Effect.FLASHING);
+ * ledStrip.periodic(); // must be called regularly
+ * }
+ */ +public class LedStrip { + // LED options to choose from + public enum Effect { + SOLID, + FLASHING, + RAINBOW, + FIRE, + LARSON, + OFF + } + + private final LedIO io; + private final int totalLeds; + + private Color driverColor = Color.kWhite; + private Effect driverEffect = Effect.SOLID; + + private Color operatorColor = Color.kWhite; + private Effect operatorEffect = Effect.SOLID; + + private boolean flashing = true; + private double lastFlashTime = 0.0; + + // Set of effects that use animations + private static final EnumSet animations = + EnumSet.of(Effect.RAINBOW, Effect.FIRE, Effect.LARSON); + + /** + * Constructor for LedStrip. + * + * @param io The LedIO interface to control the LEDs. + * @param totalLeds The total number of LEDs in the strip. + */ + public LedStrip(LedIO io, int totalLeds) { + this.io = io; + this.totalLeds = totalLeds; + } + + /** + * Sets the color and effect for the driver side of the LED strip. + * + * @param color The color to set for the driver side. + * @param effect The effect to apply to the driver side. + */ + public void setDriverColor(Color color, Effect effect) { + driverColor = color; + driverEffect = effect; + } + + // Same as above, but for the operator side + public void setOperatorColor(Color color, Effect effect) { + operatorColor = color; + operatorEffect = effect; + } + + /** + * Updates the LED strip each cycle. Must be called regularly to keep flashing and animation + * effects in sync. + */ + public void periodic() { + double now = Timer.getFPGATimestamp(); + + if ((now - lastFlashTime) > 0.5) { + flashing = !flashing; + lastFlashTime = now; + } + + // Driver + if (animations.contains(driverEffect)) { + io.setAnimation(createAnimation(driverColor, driverEffect)); + } else { + io.setFirstHalfColor(resolve(driverColor, driverEffect)); + } + + // Operator + if (animations.contains(operatorEffect)) { + io.setAnimation(createAnimation(operatorColor, operatorEffect)); + } else { + io.setSecondHalfColor(resolve(operatorColor, operatorEffect)); + } + } + + /** + * Converts an effect and color into a real color value Used for SOLID, FLASHING, and OFF effects. + * + * @param color The base color to resolve + * @param effect The effect to apply + * @return The resolved color based on the effect. + */ + private Color resolve(Color color, Effect effect) { + return switch (effect) { + case SOLID -> color; + case FLASHING -> flashing ? color : Color.kBlack; + case OFF -> Color.kBlack; + default -> color; + }; + } + + /** + * Builds an animation object (CTRE) from the given effect. Used for RAINBOW, FIRE, and LARSON + * effects. + * + * @param color The base color for the animation. + * @param effect The effect type to create. + * @return The created Animation object. + */ + private Animation createAnimation(Color color, Effect effect) { + return switch (effect) { + case RAINBOW -> new RainbowAnimation(1.0, 0.5, totalLeds, false, 0); + case FIRE -> new FireAnimation(1.0, 0.5, totalLeds, 0.6, 0.1); + case LARSON -> new LarsonAnimation( + (int) (color.red * 255), + (int) (color.green * 255), + (int) (color.blue * 255), + 0, + 0.5, + totalLeds, + LarsonAnimation.BounceMode.Front, + (totalLeds / 5)); + default -> null; + }; + } +} diff --git a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIO.java b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIO.java index d5e8531..6fac1e8 100644 --- a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIO.java +++ b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIO.java @@ -8,7 +8,16 @@ import org.littletonrobotics.junction.AutoLog; +/* + * Interface for dumb motor input/output + * Lets simulation, real hardware, and different motor types to use same structure + */ + public interface DumbMotorIO { + /** + * Container class for motor inputs - used for logging and data updates. The @AutoLog annotation + * automatically generates code for logging with the AdvantageKit framework. + */ @AutoLog public static class DumbMotorIOInputs { public boolean connected = false; @@ -16,7 +25,18 @@ public static class DumbMotorIOInputs { public double currentAmps = 0.0; } + /** + * Called periodically to update the motor input data. + * + * @param inputs The object that stores motor readings to be logged or used somewhere else. + */ public default void updateInputs(DumbMotorIOInputs inputs) {} + /** + * Runs the motor at a specified voltage. This method is intended to be overridden by + * implementations to control the motor. + * + * @param voltage The voltage to apply to the motor. + */ public default void runVoltage(double voltage) {} } diff --git a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOSim.java b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOSim.java index 574b99c..37191d5 100644 --- a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOSim.java +++ b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOSim.java @@ -11,15 +11,27 @@ import edu.wpi.first.math.system.plant.DCMotor; import edu.wpi.first.wpilibj.simulation.LinearSystemSim; +/** Simulation implementation of DumbMotorIO Uses a LinearSystemSim to simulate */ public class DumbMotorIOSim implements DumbMotorIO { private final LinearSystemSim sim; private final DCMotor motor; + /** + * Constructs a new DumbMotorIOSim instance. + * + * @param motor The DC motor model to simulate + * @param sim The linear system simulation representing the motor's behavior + */ public DumbMotorIOSim(DCMotor motor, LinearSystemSim sim) { this.motor = motor; this.sim = sim; } + /** + * Updates the inputs for the motor controller + * + * @param inputs The inputs object to update with current values + */ @Override public void updateInputs(DumbMotorIOInputs inputs) { sim.update(0.02); @@ -31,6 +43,11 @@ public void updateInputs(DumbMotorIOInputs inputs) { inputs.currentAmps = current; } + /** + * Sets the motor to run at the specified voltage + * + * @param voltage The desired voltage to apply to the motor + */ @Override public void runVoltage(double voltage) { sim.setInput(voltage); diff --git a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOTalonFX.java b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOTalonFX.java index 269446c..3d6b4f1 100644 --- a/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOTalonFX.java +++ b/src/main/java/org/team2342/lib/motors/dumb/DumbMotorIOTalonFX.java @@ -19,6 +19,10 @@ import edu.wpi.first.units.measure.Voltage; import org.team2342.frc.util.PhoenixUtils; +/** + * Implementation of DumbMotorIO for a TalonFX motor controller Handles configuration, input + * updates, and voltage control for the motor + */ public class DumbMotorIOTalonFX implements DumbMotorIO { private final TalonFX talon; @@ -28,6 +32,12 @@ public class DumbMotorIOTalonFX implements DumbMotorIO { private final VoltageOut voltageRequest = new VoltageOut(0); private final Debouncer connectedDebouncer = new Debouncer(0.5); + /** + * Constructor to configure the TalonFX motor controller + * + * @param canID The CAN ID of the TalonFX motor controller + * @param config The configuration settings for the motor + */ public DumbMotorIOTalonFX(int canID, DumbMotorConfig config) { talon = new TalonFX(canID); @@ -57,6 +67,11 @@ public DumbMotorIOTalonFX(int canID, DumbMotorConfig config) { PhoenixUtils.tryUntilOk(5, () -> ParentDevice.optimizeBusUtilizationForAll(talon)); } + /** + * Updates the inputs for the motor controller + * + * @param inputs The inputs object to update with current values + */ @Override public void updateInputs(DumbMotorIOInputs inputs) { inputs.connected = @@ -65,6 +80,11 @@ public void updateInputs(DumbMotorIOInputs inputs) { inputs.currentAmps = current.getValueAsDouble(); } + /** + * Sets the motor to run at the specified voltage + * + * @param voltage The desired voltage to apply to the motor + */ @Override public void runVoltage(double voltage) { talon.setControl(voltageRequest.withOutput(voltage)); diff --git a/vendordeps/Phoenix5-5.35.1.json b/vendordeps/Phoenix5-5.35.1.json new file mode 100644 index 0000000..2190f40 --- /dev/null +++ b/vendordeps/Phoenix5-5.35.1.json @@ -0,0 +1,171 @@ +{ + "fileName": "Phoenix5-5.35.1.json", + "name": "CTRE-Phoenix (v5)", + "version": "5.35.1", + "frcYear": "2025", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2025-latest.json", + "requires": [ + { + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", + "offlineFileName": "Phoenix6-frc2025-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json" + } + ], + "conflictsWith": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.", + "offlineFileName": "Phoenix6-replay-frc2025-latest.json" + }, + { + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", + "offlineFileName": "Phoenix5-replay-frc2025-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.35.1" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.35.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.35.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.35.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.35.1", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.35.1", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.35.1", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.35.1", + "libName": "CTRE_Phoenix_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "api-cpp-sim", + "version": "5.35.1", + "libName": "CTRE_PhoenixSim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.35.1", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} From 950ed5e745627335243ac0e62c1a2ec6a7c6e27b Mon Sep 17 00:00:00 2001 From: Phoenix2342-Bot Date: Wed, 9 Jul 2025 19:24:38 +0000 Subject: [PATCH 2/3] Auto-format code --- .../org/team2342/lib/leds/LedIOCANdle.java | 3 +- .../java/org/team2342/lib/leds/LedIOSim.java | 86 ++++++++++--------- 2 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java index d69dddb..c1b4772 100644 --- a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java +++ b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java @@ -43,7 +43,8 @@ public LedIOCANdle(int canId, int LedCount) { /** * Called periodically to update the LED input data. - * @param inputs The LedIOInputs object to update + * + * @param inputs The LedIOInputs object to update */ @Override public void updateInputs(LedIOInputs inputs) { diff --git a/src/main/java/org/team2342/lib/leds/LedIOSim.java b/src/main/java/org/team2342/lib/leds/LedIOSim.java index 8717985..62facb8 100644 --- a/src/main/java/org/team2342/lib/leds/LedIOSim.java +++ b/src/main/java/org/team2342/lib/leds/LedIOSim.java @@ -1,48 +1,50 @@ +// Copyright (c) 2025 Team 2342 +// https://github.com/FRCTeamPhoenix +// +// This source code is licensed under the MIT License. +// See the LICENSE file in the root directory of this project. + package org.team2342.lib.leds; -import org.littletonrobotics.junction.Logger; import edu.wpi.first.wpilibj.util.Color; +import org.littletonrobotics.junction.Logger; -/** - * Simulation implementation of LedIO - * Logs RGB values - * - */ +/** Simulation implementation of LedIO Logs RGB values */ public class LedIOSim implements LedIO { - private Color firstHalfColor = Color.kWhite; - private Color secondHalfColor = Color.kWhite; - - /** - * Sets the color for the first or second half of the LED strip - * - * @param color The color to set for the half - */ - @Override - public void setFirstHalfColor(Color color) { - firstHalfColor = color; - } - - @Override - public void setSecondHalfColor(Color color) { - secondHalfColor = color; - } - - /** - * Called periodically to update the LED input data - * - * @param inputs The LedIOInputs object to update - */ - @Override - public void updateInputs(LedIOInputs inputs) { - inputs.firstHalfColor = firstHalfColor; - inputs.secondHalfColor = secondHalfColor; - - Logger.recordOutput("LED/FirstHalf/Red", firstHalfColor.red); - Logger.recordOutput("LED/FirstHalf/Green", firstHalfColor.green); - Logger.recordOutput("LED/FirstHalf/Blue", firstHalfColor.blue); - - Logger.recordOutput("LED/SecondHalf/Red", secondHalfColor.red); - Logger.recordOutput("LED/SecondHalf/Green", secondHalfColor.green); - Logger.recordOutput("LED/SecondHalf/Blue", secondHalfColor.blue); - } + private Color firstHalfColor = Color.kWhite; + private Color secondHalfColor = Color.kWhite; + + /** + * Sets the color for the first or second half of the LED strip + * + * @param color The color to set for the half + */ + @Override + public void setFirstHalfColor(Color color) { + firstHalfColor = color; + } + + @Override + public void setSecondHalfColor(Color color) { + secondHalfColor = color; + } + + /** + * Called periodically to update the LED input data + * + * @param inputs The LedIOInputs object to update + */ + @Override + public void updateInputs(LedIOInputs inputs) { + inputs.firstHalfColor = firstHalfColor; + inputs.secondHalfColor = secondHalfColor; + + Logger.recordOutput("LED/FirstHalf/Red", firstHalfColor.red); + Logger.recordOutput("LED/FirstHalf/Green", firstHalfColor.green); + Logger.recordOutput("LED/FirstHalf/Blue", firstHalfColor.blue); + + Logger.recordOutput("LED/SecondHalf/Red", secondHalfColor.red); + Logger.recordOutput("LED/SecondHalf/Green", secondHalfColor.green); + Logger.recordOutput("LED/SecondHalf/Blue", secondHalfColor.blue); + } } From 0a72ed6eed87fa3af9f6ba80b961a140a74985f0 Mon Sep 17 00:00:00 2001 From: abi-appusamy9932 Date: Sun, 4 Jan 2026 17:47:42 -0500 Subject: [PATCH 3/3] finishing led code --- .../java/org/team2342/lib/leds/LedIO.java | 77 +++++--- .../org/team2342/lib/leds/LedIOCANdle.java | 181 +++++++++++------- .../java/org/team2342/lib/leds/LedIOSim.java | 90 ++++++--- .../java/org/team2342/lib/leds/LedStrip.java | 159 ++++----------- vendordeps/Phoenix5-5.35.1.json | 171 ----------------- ....3.2.json => Phoenix6-frc2025-latest.json} | 92 ++++++--- 6 files changed, 318 insertions(+), 452 deletions(-) delete mode 100644 vendordeps/Phoenix5-5.35.1.json rename vendordeps/{Phoenix6-25.3.2.json => Phoenix6-frc2025-latest.json} (86%) diff --git a/src/main/java/org/team2342/lib/leds/LedIO.java b/src/main/java/org/team2342/lib/leds/LedIO.java index b5b329c..af8f0ba 100644 --- a/src/main/java/org/team2342/lib/leds/LedIO.java +++ b/src/main/java/org/team2342/lib/leds/LedIO.java @@ -6,37 +6,58 @@ package org.team2342.lib.leds; -import com.ctre.phoenix.led.Animation; -import edu.wpi.first.wpilibj.util.Color; - -/** - * Interface for LED input/output Allows for different LED implementations to use the same structure - */ public interface LedIO { - /** Container class for LED inputs - used for logging and data updates. */ + + public enum Half { + FIRST, + SECOND, + ALL + } + + + public enum LedEffect { + SOLID, + FLASHING, + RAINBOW, + OFF + } + + public static class LedColor { + public int red; + public int green; + public int blue; + + public LedColor(int red, int green, int blue) { + this.red = red; + this.green = green; + this.blue = blue; + } + + public static LedColor off() { + return new LedColor(0, 0, 0); + } + } + public static class LedIOInputs { - public Color firstHalfColor = Color.kWhite; - public Color secondHalfColor = Color.kWhite; + public LedColor firstHalfColor = LedColor.off(); + public LedColor secondHalfColor = LedColor.off(); + public LedEffect firstHalfEffect = LedEffect.OFF; + public LedEffect secondHalfEffect = LedEffect.OFF; } - /** - * Called periodically to update the LED input data. - * - * @param inputs The object that stores LED readings to be logged or used somewhere else. - */ public default void updateInputs(LedIOInputs inputs) {} - /** - * Sets the color for the first or second half of the LED strip. - * - * @param color The color to set for the half - */ - public default void setFirstHalfColor(Color color) {} - - public default void setSecondHalfColor(Color color) {} - /** - * Sets the animation for the LED strip. - * - * @param animation The animation to apply to the LED strip. - */ - public default void setAnimation(Animation animation) {} + + public default void setColor(Half half, LedColor color) {} + + public default void setEffect(Half half, LedEffect effect, LedColor color) {} + + public default void setAllColor(LedColor color) { + setColor(Half.FIRST, color); + setColor(Half.SECOND, color); + } + + public default void setAllEffect(LedEffect effect, LedColor color) { + setEffect(Half.FIRST, effect, color); + setEffect(Half.SECOND, effect, color); + } } diff --git a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java index c1b4772..41169fc 100644 --- a/src/main/java/org/team2342/lib/leds/LedIOCANdle.java +++ b/src/main/java/org/team2342/lib/leds/LedIOCANdle.java @@ -6,92 +6,127 @@ package org.team2342.lib.leds; -import com.ctre.phoenix.led.Animation; -import com.ctre.phoenix.led.CANdle; -import com.ctre.phoenix.led.CANdle.LEDStripType; -import com.ctre.phoenix.led.CANdleConfiguration; -import edu.wpi.first.wpilibj.util.Color; +import com.ctre.phoenix6.hardware.CANdle; +import com.ctre.phoenix6.configs.CANdleConfiguration; +import com.ctre.phoenix6.controls.SolidColor; +import com.ctre.phoenix6.controls.RainbowAnimation; +import com.ctre.phoenix6.signals.RGBWColor; +import com.ctre.phoenix6.signals.StripTypeValue; -/** - * Implementation of LedIO using a CANdle device. This class manages the LED strip by controlling - * the colors and animations. - */ -public class LedIOCANdle implements LedIO { - private final CANdle candle; - private final int totalLeds; - private final int halfLength; - private Color firstHalfColor = Color.kWhite; - private Color secondHalfColor = Color.kWhite; +public class LedIOCANdle implements LedIO { + private CANdle candle; + private int totalLeds; + private int firstHalfLength; + private int secondHalfLength; + + private LedColor lastFirstColor = LedColor.off(); + private LedColor lastSecondColor = LedColor.off(); + private LedEffect lastFirstEffect = LedEffect.OFF; + private LedEffect lastSecondEffect = LedEffect.OFF; - /** - * Constructor for LedIOCANdle. Initializes the CANdle with the specified CAN ID and LED count. - * - * @param canId The CAN ID of the CANdle device. - * @param LedCount The total number of LEDs in the strip. - */ - public LedIOCANdle(int canId, int LedCount) { - candle = new CANdle(canId); - totalLeds = LedCount; - halfLength = LedCount / 2; + public LedIOCANdle(int canID, int ledCount){ + this.candle = new CANdle(canID); + this.totalLeds = ledCount; + this.firstHalfLength = totalLeds / 2; + this.secondHalfLength = totalLeds - firstHalfLength; CANdleConfiguration config = new CANdleConfiguration(); - config.stripType = LEDStripType.RGB; - config.brightnessScalar = 1.0; - candle.configAllSettings(config); + config.LED.StripType = StripTypeValue.RGB; + candle.getConfigurator().apply(config); } - /** - * Called periodically to update the LED input data. - * - * @param inputs The LedIOInputs object to update - */ @Override - public void updateInputs(LedIOInputs inputs) { - inputs.firstHalfColor = firstHalfColor; - inputs.secondHalfColor = secondHalfColor; + public void updateInputs(LedIOInputs inputs){ + inputs.firstHalfColor = lastFirstColor; + inputs.secondHalfColor = lastSecondColor; + inputs.firstHalfEffect = lastFirstEffect; + inputs.secondHalfEffect = lastSecondEffect; } - - /** - * Sets the color for the first half and second half of the LED strip. - * - * @param color The color to set for the half - */ + @Override - public void setFirstHalfColor(Color color) { - firstHalfColor = color; - candle.clearAnimation(0); - candle.setLEDs( - (int) (color.red * 255), - (int) (color.green * 255), - (int) (color.blue * 255), - 0, - 0, - halfLength); + public void setColor(Half half, LedColor color) { + switch (half) { + case FIRST: + sendSolidColor(0, firstHalfLength, color); + lastFirstColor = color; + lastFirstEffect = LedEffect.SOLID; + break; + case SECOND: + sendSolidColor(firstHalfLength, secondHalfLength, color); + lastSecondColor = color; + lastSecondEffect = LedEffect.SOLID; + break; + case ALL: + sendSolidColor(0, totalLeds, color); + lastFirstColor = color; + lastSecondColor = color; + lastFirstEffect = LedEffect.SOLID; + lastSecondEffect = LedEffect.SOLID; + break; + } + } @Override - public void setSecondHalfColor(Color color) { - secondHalfColor = color; - candle.clearAnimation(0); - candle.setLEDs( - (int) (color.red * 255), - (int) (color.green * 255), - (int) (color.blue * 255), - 0, - halfLength, - halfLength); + public void setEffect(Half half, LedEffect effect, LedColor color) { + if (color == null){ + color = LedColor.off(); + } + + int start = 0; + int length = 0; + + switch (half) { + case FIRST: + start = 0; + length = firstHalfLength; + lastFirstColor = color; + lastFirstEffect = effect; + break; + case SECOND: + start = firstHalfLength; + length = secondHalfLength; + lastSecondColor = color; + lastSecondEffect = effect; + break; + case ALL: + start = 0; + length = totalLeds; + lastFirstEffect = effect; + lastSecondEffect = effect; + lastFirstColor = color; + lastSecondColor = color; + break; + } + + switch (effect) { + case SOLID: + sendSolidColor(start, length, color); + break; + case RAINBOW: + RainbowAnimation rainbow = new RainbowAnimation(start, length); + candle.setControl(rainbow); + break; + case FLASHING: + sendSolidColor(start, length, color); + break; + case OFF: + sendSolidColor(start, length, LedColor.off()); + break; + } } - /** - * Sets the animation for the LED strip. - * - * @param animation The animation to apply to the LED strip. - */ - @Override - public void setAnimation(Animation animation) { - candle.clearAnimation(0); - animation.setNumLed(totalLeds); - candle.animate(animation); + private RGBWColor toCTRE(LedColor c) { + if (c == null){ + return new RGBWColor(0,0,0,0); + } + return new RGBWColor(c.red, c.green, c.blue,0); + } + + private void sendSolidColor(int start, int length, LedColor color) { + SolidColor request = new SolidColor(start, length); + request.withColor(toCTRE(color)); + candle.setControl(request); } -} +} \ No newline at end of file diff --git a/src/main/java/org/team2342/lib/leds/LedIOSim.java b/src/main/java/org/team2342/lib/leds/LedIOSim.java index 62facb8..137d6b4 100644 --- a/src/main/java/org/team2342/lib/leds/LedIOSim.java +++ b/src/main/java/org/team2342/lib/leds/LedIOSim.java @@ -6,45 +6,77 @@ package org.team2342.lib.leds; -import edu.wpi.first.wpilibj.util.Color; import org.littletonrobotics.junction.Logger; -/** Simulation implementation of LedIO Logs RGB values */ public class LedIOSim implements LedIO { - private Color firstHalfColor = Color.kWhite; - private Color secondHalfColor = Color.kWhite; - - /** - * Sets the color for the first or second half of the LED strip - * - * @param color The color to set for the half - */ + private LedColor firstColor = LedColor.off(); + private LedColor secondColor = LedColor.off(); + private LedEffect firstEffect = LedEffect.OFF; + private LedEffect secondEffect = LedEffect.OFF; + @Override - public void setFirstHalfColor(Color color) { - firstHalfColor = color; + public void setColor(Half half, LedColor color) { + if (color == null) { + color = LedColor.off(); + } + + switch (half) { + case FIRST: + firstColor = color; + firstEffect = LedEffect.SOLID; + break; + case SECOND: + secondColor = color; + secondEffect = LedEffect.SOLID; + break; + case ALL: + firstColor = color; + secondColor = color; + firstEffect = LedEffect.SOLID; + secondEffect = LedEffect.SOLID; + break; + } } @Override - public void setSecondHalfColor(Color color) { - secondHalfColor = color; + public void setEffect(Half half, LedEffect effect, LedColor color){ + if (color == null) { + color = LedColor.off(); + } + + switch (half) { + case FIRST: + firstColor = color; + firstEffect = effect; + break; + case SECOND: + secondColor = color; + secondEffect = effect; + break; + case ALL: + firstColor = color; + secondColor = color; + firstEffect = effect; + secondEffect = effect; + break; + } } - /** - * Called periodically to update the LED input data - * - * @param inputs The LedIOInputs object to update - */ @Override - public void updateInputs(LedIOInputs inputs) { - inputs.firstHalfColor = firstHalfColor; - inputs.secondHalfColor = secondHalfColor; + public void updateInputs(LedIOInputs inputs){ + inputs.firstHalfColor = firstColor; + inputs.secondHalfColor = secondColor; + inputs.firstHalfEffect = firstEffect; + inputs.secondHalfEffect = secondEffect; - Logger.recordOutput("LED/FirstHalf/Red", firstHalfColor.red); - Logger.recordOutput("LED/FirstHalf/Green", firstHalfColor.green); - Logger.recordOutput("LED/FirstHalf/Blue", firstHalfColor.blue); + Logger.recordOutput("LED/FirstHalf/Red", firstColor.red); + Logger.recordOutput("LED/FirstHalf/Green", firstColor.green); + Logger.recordOutput("LED/FirstHalf/Blue", firstColor.blue); + Logger.recordOutput("LED/FirstHalf/Effect", firstEffect.toString()); - Logger.recordOutput("LED/SecondHalf/Red", secondHalfColor.red); - Logger.recordOutput("LED/SecondHalf/Green", secondHalfColor.green); - Logger.recordOutput("LED/SecondHalf/Blue", secondHalfColor.blue); + Logger.recordOutput("LED/SecondHalf/Red", secondColor.red); + Logger.recordOutput("LED/SecondHalf/Green", secondColor.green); + Logger.recordOutput("LED/SecondHalf/Blue", secondColor.blue); + Logger.recordOutput("LED/SecondHalf/Effect", secondEffect.toString()); } -} +} \ No newline at end of file diff --git a/src/main/java/org/team2342/lib/leds/LedStrip.java b/src/main/java/org/team2342/lib/leds/LedStrip.java index 15e7ebc..df971f7 100644 --- a/src/main/java/org/team2342/lib/leds/LedStrip.java +++ b/src/main/java/org/team2342/lib/leds/LedStrip.java @@ -6,144 +6,63 @@ package org.team2342.lib.leds; -import com.ctre.phoenix.led.*; import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj.util.Color; -import java.util.EnumSet; - -/** - * High-level LED control that splits a strip into two halves: one for the driver and one for the - * operator. Each side can be assigned a color and an effect (solid, flashing, animations). - * - *

Use `setDriver()` and `setOperator()` to configure each side. Call `periodic()` each loop to - * update animations or effects. Example usage in robot code: - * - *

{@code
- * ledStrip.setDriver(Color.kRed, LedStrip.Effect.FIRE);
- * ledStrip.setOperator(Color.kBlue, LedStrip.Effect.FLASHING);
- * ledStrip.periodic(); // must be called regularly
- * }
- */ -public class LedStrip { - // LED options to choose from - public enum Effect { - SOLID, - FLASHING, - RAINBOW, - FIRE, - LARSON, - OFF - } +import edu.wpi.first.wpilibj2.command.SubsystemBase; +public class LedStrip extends SubsystemBase { private final LedIO io; - private final int totalLeds; - - private Color driverColor = Color.kWhite; - private Effect driverEffect = Effect.SOLID; - - private Color operatorColor = Color.kWhite; - private Effect operatorEffect = Effect.SOLID; + private LedIO.LedColor firstColor = LedIO.LedColor.off(); + private LedIO.LedEffect firstEffect = LedIO.LedEffect.OFF; + private LedIO.LedColor secondColor = LedIO.LedColor.off(); + private LedIO.LedEffect secondEffect = LedIO.LedEffect.OFF; - private boolean flashing = true; + private boolean flashing = false; private double lastFlashTime = 0.0; + private static final double FLASH_PERIOD_SEC = 0.5; - // Set of effects that use animations - private static final EnumSet animations = - EnumSet.of(Effect.RAINBOW, Effect.FIRE, Effect.LARSON); - - /** - * Constructor for LedStrip. - * - * @param io The LedIO interface to control the LEDs. - * @param totalLeds The total number of LEDs in the strip. - */ - public LedStrip(LedIO io, int totalLeds) { + public LedStrip(LedIO io){ this.io = io; - this.totalLeds = totalLeds; } - /** - * Sets the color and effect for the driver side of the LED strip. - * - * @param color The color to set for the driver side. - * @param effect The effect to apply to the driver side. - */ - public void setDriverColor(Color color, Effect effect) { - driverColor = color; - driverEffect = effect; + public void setFirst(LedIO.LedEffect effect, LedIO.LedColor color){ + firstEffect = effect; + firstColor = color; } - // Same as above, but for the operator side - public void setOperatorColor(Color color, Effect effect) { - operatorColor = color; - operatorEffect = effect; + public void setSecond(LedIO.LedEffect effect, LedIO.LedColor color){ + secondEffect = effect; + secondColor = color; } - /** - * Updates the LED strip each cycle. Must be called regularly to keep flashing and animation - * effects in sync. - */ + @Override public void periodic() { - double now = Timer.getFPGATimestamp(); + updateFlashing(); + applyEffect(LedIO.Half.FIRST, firstEffect, firstColor); + applyEffect(LedIO.Half.SECOND, secondEffect, secondColor); + } - if ((now - lastFlashTime) > 0.5) { + private void updateFlashing() { + double now = Timer.getFPGATimestamp(); + if (now - lastFlashTime >= FLASH_PERIOD_SEC) { flashing = !flashing; lastFlashTime = now; } - - // Driver - if (animations.contains(driverEffect)) { - io.setAnimation(createAnimation(driverColor, driverEffect)); - } else { - io.setFirstHalfColor(resolve(driverColor, driverEffect)); - } - - // Operator - if (animations.contains(operatorEffect)) { - io.setAnimation(createAnimation(operatorColor, operatorEffect)); - } else { - io.setSecondHalfColor(resolve(operatorColor, operatorEffect)); - } } - /** - * Converts an effect and color into a real color value Used for SOLID, FLASHING, and OFF effects. - * - * @param color The base color to resolve - * @param effect The effect to apply - * @return The resolved color based on the effect. - */ - private Color resolve(Color color, Effect effect) { - return switch (effect) { - case SOLID -> color; - case FLASHING -> flashing ? color : Color.kBlack; - case OFF -> Color.kBlack; - default -> color; - }; - } - - /** - * Builds an animation object (CTRE) from the given effect. Used for RAINBOW, FIRE, and LARSON - * effects. - * - * @param color The base color for the animation. - * @param effect The effect type to create. - * @return The created Animation object. - */ - private Animation createAnimation(Color color, Effect effect) { - return switch (effect) { - case RAINBOW -> new RainbowAnimation(1.0, 0.5, totalLeds, false, 0); - case FIRE -> new FireAnimation(1.0, 0.5, totalLeds, 0.6, 0.1); - case LARSON -> new LarsonAnimation( - (int) (color.red * 255), - (int) (color.green * 255), - (int) (color.blue * 255), - 0, - 0.5, - totalLeds, - LarsonAnimation.BounceMode.Front, - (totalLeds / 5)); - default -> null; - }; + private void applyEffect(LedIO.Half half, LedIO.LedEffect effect, LedIO.LedColor color){ + switch (effect) { + case SOLID: + io.setColor(half, color); + break; + case FLASHING: + io.setColor(half, (flashing ? color : LedIO.LedColor.off())); + break; + case RAINBOW: + io.setEffect(half, LedIO.LedEffect.RAINBOW, color); + break; + case OFF: + io.setColor(half, LedIO.LedColor.off()); + break; + } } -} +} \ No newline at end of file diff --git a/vendordeps/Phoenix5-5.35.1.json b/vendordeps/Phoenix5-5.35.1.json deleted file mode 100644 index 2190f40..0000000 --- a/vendordeps/Phoenix5-5.35.1.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "fileName": "Phoenix5-5.35.1.json", - "name": "CTRE-Phoenix (v5)", - "version": "5.35.1", - "frcYear": "2025", - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2025-latest.json", - "requires": [ - { - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", - "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", - "offlineFileName": "Phoenix6-frc2025-latest.json", - "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2025-latest.json" - } - ], - "conflictsWith": [ - { - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", - "errorMessage": "Users must use the Phoenix 5 replay vendordep when using the Phoenix 6 replay vendordep.", - "offlineFileName": "Phoenix6-replay-frc2025-latest.json" - }, - { - "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", - "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", - "offlineFileName": "Phoenix5-replay-frc2025-latest.json" - } - ], - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.35.1" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.35.1" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.35.1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.35.1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.35.1", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.35.1", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.35.1", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "5.35.1", - "libName": "CTRE_Phoenix_WPISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "api-cpp-sim", - "version": "5.35.1", - "libName": "CTRE_PhoenixSim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.35.1", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ] -} diff --git a/vendordeps/Phoenix6-25.3.2.json b/vendordeps/Phoenix6-frc2025-latest.json similarity index 86% rename from vendordeps/Phoenix6-25.3.2.json rename to vendordeps/Phoenix6-frc2025-latest.json index 368e61c..ce44ce4 100644 --- a/vendordeps/Phoenix6-25.3.2.json +++ b/vendordeps/Phoenix6-frc2025-latest.json @@ -1,7 +1,7 @@ { - "fileName": "Phoenix6-25.3.2.json", + "fileName": "Phoenix6-frc2025-latest.json", "name": "CTRE-Phoenix (v6)", - "version": "25.3.2", + "version": "25.4.0", "frcYear": "2025", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ @@ -19,14 +19,14 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "25.3.2" + "version": "25.4.0" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "api-cpp", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -40,7 +40,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -54,7 +54,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "api-cpp-sim", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -68,7 +68,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -82,7 +82,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -96,7 +96,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -110,7 +110,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -124,7 +124,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -138,7 +138,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -152,7 +152,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -166,7 +166,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -180,7 +180,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -194,7 +194,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "25.3.2", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -208,7 +208,21 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "25.3.2", + "version": "25.4.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -224,7 +238,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -240,7 +254,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -256,7 +270,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -272,7 +286,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -288,7 +302,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -304,7 +318,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -320,7 +334,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -336,7 +350,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -352,7 +366,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -368,7 +382,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, @@ -384,7 +398,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -400,7 +414,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -416,7 +430,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProCANrange", "headerClassifier": "headers", "sharedLibrary": true, @@ -432,7 +446,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "25.3.2", + "version": "25.4.0", "libName": "CTRE_SimProCANdi", "headerClassifier": "headers", "sharedLibrary": true, @@ -444,6 +458,22 @@ "osxuniversal" ], "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "25.4.0", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" } ] }