diff --git a/src/main/java/com/team2813/Constants.java b/src/main/java/com/team2813/Constants.java index c86bf9d4..5e7d1783 100644 --- a/src/main/java/com/team2813/Constants.java +++ b/src/main/java/com/team2813/Constants.java @@ -20,8 +20,8 @@ public final class Constants { // CAN IDs - All directions are from when the robot is viewed from behind, unless otherwise // stated. // Roller Motors. Aliases: Feeder motors, Magazine motors - public static final int MAIN_FEEDER_MOTOR_CAN_ID = 25; // Top roller motor. - public static final int FOLLOWER_FEEDER_MOTOR_CAN_ID = 15; // Bottom roller motor. + // These force balls from the hopper into the shooter. + public static final int FEEDER_MOTOR_CAN_ID = 25; // Feeder motor. // Indexer Motors. Aliases: Vectoring motors public static final int INDEXER_MOTOR_ID = 24; diff --git a/src/main/java/com/team2813/subsystems/hopper/HopperConstants.java b/src/main/java/com/team2813/subsystems/hopper/HopperConstants.java index 58e387b6..cedfcf5f 100644 --- a/src/main/java/com/team2813/subsystems/hopper/HopperConstants.java +++ b/src/main/java/com/team2813/subsystems/hopper/HopperConstants.java @@ -5,6 +5,7 @@ import com.ctre.phoenix6.configs.CurrentLimitsConfigs; import com.ctre.phoenix6.configs.MotorOutputConfigs; +import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.TalonFXConfiguration; import com.ctre.phoenix6.signals.InvertedValue; import edu.wpi.first.units.measure.Voltage; @@ -39,24 +40,15 @@ public static Voltage getFeederOuttakeVoltage() { return Volts.of(Preferences.getDouble(FEEDER_OUTTAKE_VOLTAGE_NT, -6)); } - // TOP - public static final TalonFXConfiguration MAIN_ROLLER_MOTOR_CONFIG = + // The motor on the bottom feeders. + public static final TalonFXConfiguration FEEDER_MOTOR_CONFIG = new TalonFXConfiguration() .withMotorOutput(new MotorOutputConfigs().withInverted(InvertedValue.Clockwise_Positive)) .withCurrentLimits( new CurrentLimitsConfigs() .withSupplyCurrentLimit(Amps.of(30)) - .withStatorCurrentLimit(Amps.of(60))); - - // Bottom Motor, opposite of main motor. - public static final TalonFXConfiguration FOLLOWER_FEEDER_MOTOR_CONFIG = - new TalonFXConfiguration() - .withMotorOutput( - new MotorOutputConfigs().withInverted(InvertedValue.CounterClockwise_Positive)) - .withCurrentLimits( - new CurrentLimitsConfigs() - .withSupplyCurrentLimit(Amps.of(30)) - .withStatorCurrentLimit(Amps.of(60))); + .withStatorCurrentLimit(Amps.of(60))) + .withSlot0(new Slot0Configs().withKS(0.2).withKV(0.116)); // TODO: Change this later to the actual number. public static final double FEEDER_MOTOR_TO_ROLLER_GEARING = 1; diff --git a/src/main/java/com/team2813/subsystems/hopper/HopperIO.java b/src/main/java/com/team2813/subsystems/hopper/HopperIO.java index 93b4a50d..176e4e7a 100644 --- a/src/main/java/com/team2813/subsystems/hopper/HopperIO.java +++ b/src/main/java/com/team2813/subsystems/hopper/HopperIO.java @@ -13,10 +13,10 @@ public interface HopperIO { @AutoLog class HopperIOInputs { // Roller/Magazine - public Voltage mainFeederMotorVoltage = Volts.of(0); - public AngularVelocity mainFeederMotorRPS = RotationsPerSecond.of(0); - public Current mainFeederMotorStatorCurrent = Amps.of(0); - public Current mainFeederMotorSupplyCurrent = Amps.of(0); + public Voltage feederMotorVoltage = Volts.of(0); + public AngularVelocity feederMotorRPS = RotationsPerSecond.of(0); + public Current feederMotorStatorCurrent = Amps.of(0); + public Current feederMotorSupplyCurrent = Amps.of(0); } /** diff --git a/src/main/java/com/team2813/subsystems/hopper/HopperIOReal.java b/src/main/java/com/team2813/subsystems/hopper/HopperIOReal.java index b1333d6e..2ef2fd3b 100644 --- a/src/main/java/com/team2813/subsystems/hopper/HopperIOReal.java +++ b/src/main/java/com/team2813/subsystems/hopper/HopperIOReal.java @@ -12,45 +12,44 @@ import edu.wpi.first.units.measure.Voltage; public class HopperIOReal implements HopperIO { - private final TalonFX mainFeederMotor; // Top magazine motor. + private final TalonFX feederMotor; // Top magazine motor. // Prep the fields we will log for each motor. // By having a status signal stored, we can refresh all the motor values at once. // Before, we would refresh all the motor values just to get one value, causing a performance // issue. - StatusSignal mainFeederVoltage; - StatusSignal mainFeederRPS; - StatusSignal mainFeederStatorCurrent; // Motor Control to Stator - StatusSignal mainFeederSupplyCurrent; // Battery to Stator + StatusSignal feederVoltage; + StatusSignal feederRPS; + StatusSignal feederStatorCurrent; // Motor Control to Stator + StatusSignal feederSupplyCurrent; // Battery to Stator public HopperIOReal() { - mainFeederMotor = new TalonFX(Constants.MAIN_FEEDER_MOTOR_CAN_ID); - mainFeederMotor.getConfigurator().apply(HopperConstants.MAIN_ROLLER_MOTOR_CONFIG); + feederMotor = new TalonFX(Constants.FEEDER_MOTOR_CAN_ID); + feederMotor.getConfigurator().apply(HopperConstants.FEEDER_MOTOR_CONFIG); - mainFeederVoltage = mainFeederMotor.getMotorVoltage(); - mainFeederRPS = mainFeederMotor.getRotorVelocity(); - mainFeederStatorCurrent = mainFeederMotor.getStatorCurrent(); - mainFeederSupplyCurrent = mainFeederMotor.getSupplyCurrent(); + feederVoltage = feederMotor.getMotorVoltage(); + feederRPS = feederMotor.getRotorVelocity(); + feederStatorCurrent = feederMotor.getStatorCurrent(); + feederSupplyCurrent = feederMotor.getSupplyCurrent(); BaseStatusSignal.setUpdateFrequencyForAll( - 50, mainFeederVoltage, mainFeederRPS, mainFeederStatorCurrent, mainFeederSupplyCurrent); + 50, feederVoltage, feederRPS, feederStatorCurrent, feederSupplyCurrent); - ParentDevice.optimizeBusUtilizationForAll(mainFeederMotor); + ParentDevice.optimizeBusUtilizationForAll(feederMotor); } @Override public void updateState(HopperIOInputs inputs) { - BaseStatusSignal.refreshAll( - mainFeederVoltage, mainFeederRPS, mainFeederStatorCurrent, mainFeederSupplyCurrent); + BaseStatusSignal.refreshAll(feederVoltage, feederRPS, feederStatorCurrent, feederSupplyCurrent); - inputs.mainFeederMotorVoltage = mainFeederVoltage.getValue(); - inputs.mainFeederMotorRPS = mainFeederRPS.getValue(); - inputs.mainFeederMotorStatorCurrent = mainFeederStatorCurrent.getValue(); - inputs.mainFeederMotorSupplyCurrent = mainFeederSupplyCurrent.getValue(); + inputs.feederMotorVoltage = feederVoltage.getValue(); + inputs.feederMotorRPS = feederRPS.getValue(); + inputs.feederMotorStatorCurrent = feederStatorCurrent.getValue(); + inputs.feederMotorSupplyCurrent = feederSupplyCurrent.getValue(); } @Override public void setMotorVoltage(Voltage rollerVoltage, Voltage feederVoltage) { - mainFeederMotor.setVoltage(rollerVoltage.in(Volts)); + feederMotor.setVoltage(rollerVoltage.in(Volts)); } } diff --git a/src/main/java/com/team2813/subsystems/hopper/HopperIOSim.java b/src/main/java/com/team2813/subsystems/hopper/HopperIOSim.java index 719dbb9d..029c42f0 100644 --- a/src/main/java/com/team2813/subsystems/hopper/HopperIOSim.java +++ b/src/main/java/com/team2813/subsystems/hopper/HopperIOSim.java @@ -13,18 +13,16 @@ public class HopperIOSim implements HopperIO { // Roller Motor simulation declaration. - private final TalonFX mainFeederMotor; - private final TalonFXSimState mainFeederMotorSimState; + private final TalonFX feederMotor; + private final TalonFXSimState feederMotorSimState; private final FlywheelSim feederSim; // Used for simulating voltage of the roller. public HopperIOSim() { - mainFeederMotor = new TalonFX(Constants.MAIN_FEEDER_MOTOR_CAN_ID); - mainFeederMotor.getConfigurator().apply(HopperConstants.MAIN_ROLLER_MOTOR_CONFIG); - mainFeederMotorSimState = mainFeederMotor.getSimState(); + feederMotor = new TalonFX(Constants.FEEDER_MOTOR_CAN_ID); + feederMotor.getConfigurator().apply(HopperConstants.FEEDER_MOTOR_CONFIG); + feederMotorSimState = feederMotor.getSimState(); - // The "0.01" value is the moment of inertia, as the CAD is not complete, a more accurate value - // is unavailable. feederSim = new FlywheelSim( LinearSystemId.createFlywheelSystem( @@ -38,12 +36,12 @@ public HopperIOSim() { public void updateState(HopperIOInputs inputs) { updateSimulation(); - mainFeederMotorSimState.setSupplyVoltage(Volts.of(12)); + feederMotorSimState.setSupplyVoltage(Volts.of(12)); - inputs.mainFeederMotorVoltage = mainFeederMotor.getMotorVoltage().getValue(); - inputs.mainFeederMotorRPS = mainFeederMotor.getRotorVelocity().getValue(); - inputs.mainFeederMotorStatorCurrent = mainFeederMotor.getStatorCurrent().getValue(); - inputs.mainFeederMotorSupplyCurrent = mainFeederMotor.getSupplyCurrent().getValue(); + inputs.feederMotorVoltage = feederMotor.getMotorVoltage().getValue(); + inputs.feederMotorRPS = feederMotor.getRotorVelocity().getValue(); + inputs.feederMotorStatorCurrent = feederMotor.getStatorCurrent().getValue(); + inputs.feederMotorSupplyCurrent = feederMotor.getSupplyCurrent().getValue(); } public void updateSimulation() { @@ -51,13 +49,13 @@ public void updateSimulation() { // Feed the velocity and acceleration of the roller simulation into the simulation motors to // accurately model them. - mainFeederMotorSimState.setRotorAcceleration(feederSim.getAngularAcceleration()); - mainFeederMotorSimState.setRotorVelocity(feederSim.getAngularVelocity()); + feederMotorSimState.setRotorAcceleration(feederSim.getAngularAcceleration()); + feederMotorSimState.setRotorVelocity(feederSim.getAngularVelocity()); } @Override public void setMotorVoltage(Voltage rollerVoltage, Voltage feederVoltage) { // Rollers - mainFeederMotor.setVoltage(rollerVoltage.in(Volts)); + feederMotor.setVoltage(rollerVoltage.in(Volts)); } } diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json index 2faa4db8..469ae542 100644 --- a/vendordeps/AdvantageKit.json +++ b/vendordeps/AdvantageKit.json @@ -1,7 +1,7 @@ { "fileName": "AdvantageKit.json", "name": "AdvantageKit", - "version": "26.0.0", + "version": "26.0.2", "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", "frcYear": "2026", "mavenUrls": [ @@ -12,14 +12,14 @@ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-java", - "version": "26.0.0" + "version": "26.0.2" } ], "jniDependencies": [ { "groupId": "org.littletonrobotics.akit", "artifactId": "akit-wpilibio", - "version": "26.0.0", + "version": "26.0.2", "skipInvalidPlatforms": false, "isJar": false, "validPlatforms": [ diff --git a/vendordeps/Phoenix6-26.1.1.json b/vendordeps/Phoenix6-26.3.0.json similarity index 92% rename from vendordeps/Phoenix6-26.1.1.json rename to vendordeps/Phoenix6-26.3.0.json index c0a1c19f..e75902cf 100644 --- a/vendordeps/Phoenix6-26.1.1.json +++ b/vendordeps/Phoenix6-26.3.0.json @@ -1,7 +1,7 @@ { - "fileName": "Phoenix6-26.1.1.json", + "fileName": "Phoenix6-26.3.0.json", "name": "CTRE-Phoenix (v6)", - "version": "26.1.1", + "version": "26.3.0", "frcYear": "2026", "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ @@ -19,14 +19,14 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "26.1.1" + "version": "26.3.0" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "api-cpp", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -40,7 +40,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -54,7 +54,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "api-cpp-sim", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -68,7 +68,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -82,7 +82,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -96,7 +96,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -110,7 +110,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -124,7 +124,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -138,7 +138,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -152,7 +152,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -166,7 +166,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -180,7 +180,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -194,7 +194,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -208,7 +208,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.1.1", + "version": "26.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -224,7 +224,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -240,7 +240,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -256,7 +256,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -272,7 +272,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -288,7 +288,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -304,7 +304,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -320,7 +320,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -336,7 +336,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -352,7 +352,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFXS", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProTalonFXS", "headerClassifier": "headers", "sharedLibrary": true, @@ -368,7 +368,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -384,7 +384,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, @@ -400,7 +400,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANrange", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProCANrange", "headerClassifier": "headers", "sharedLibrary": true, @@ -416,7 +416,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdi", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProCANdi", "headerClassifier": "headers", "sharedLibrary": true, @@ -432,7 +432,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANdle", - "version": "26.1.1", + "version": "26.3.0", "libName": "CTRE_SimProCANdle", "headerClassifier": "headers", "sharedLibrary": true, diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json index 6279e58e..4280265f 100644 --- a/vendordeps/photonlib.json +++ b/vendordeps/photonlib.json @@ -1,7 +1,7 @@ { "fileName": "photonlib.json", "name": "photonlib", - "version": "v2026.2.2", + "version": "v2026.3.4", "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004", "frcYear": "2026", "mavenUrls": [ @@ -13,7 +13,7 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.2.2", + "version": "v2026.3.4", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -28,7 +28,7 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-cpp", - "version": "v2026.2.2", + "version": "v2026.3.4", "libName": "photonlib", "headerClassifier": "headers", "sharedLibrary": true, @@ -43,7 +43,7 @@ { "groupId": "org.photonvision", "artifactId": "photontargeting-cpp", - "version": "v2026.2.2", + "version": "v2026.3.4", "libName": "photontargeting", "headerClassifier": "headers", "sharedLibrary": true, @@ -60,12 +60,12 @@ { "groupId": "org.photonvision", "artifactId": "photonlib-java", - "version": "v2026.2.2" + "version": "v2026.3.4" }, { "groupId": "org.photonvision", "artifactId": "photontargeting-java", - "version": "v2026.2.2" + "version": "v2026.3.4" } ] }