From 3826e040c09d7ffb9771a46b076479e6cd41cf60 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 29 Jan 2026 16:54:19 +0800 Subject: [PATCH 01/17] intake subsystem final --- .../frc/robot/subsystems/IntakeSubsystem.java | 39 +- vendordeps/AdvantageKit.json | 35 ++ vendordeps/AmLib-2026.0.1.json | 34 ++ vendordeps/ChoreoLib2026.json | 44 ++ vendordeps/Phoenix5-replay-5.36.0.json | 221 ++++++++ vendordeps/Phoenix6-replay-26.1.1.json | 497 ++++++++++++++++++ vendordeps/REVLib.json | 133 +++++ 7 files changed, 996 insertions(+), 7 deletions(-) create mode 100644 vendordeps/AdvantageKit.json create mode 100644 vendordeps/AmLib-2026.0.1.json create mode 100644 vendordeps/ChoreoLib2026.json create mode 100644 vendordeps/Phoenix5-replay-5.36.0.json create mode 100644 vendordeps/Phoenix6-replay-26.1.1.json create mode 100644 vendordeps/REVLib.json diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index ac5939c..2b8cde7 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -5,38 +5,63 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import edu.wpi.first.wpilibj.Joystick; +import com.revrobotics.spark.SparkMax; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.config.SparkMaxConfig; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; +import com.revrobotics.spark.SparkBase.PersistMode; +import com.revrobotics.spark.SparkBase.ResetMode; public class IntakeSubsystem extends SubsystemBase { - /** Creates a new IntakeSubsystem. */ + SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); + SparkMaxConfig config = new SparkMaxConfig(); + Joystick driverJoystick = new Joystick(0); + public IntakeSubsystem() { + config.inverted(false) + .smartCurrentLimit(30) + .idleMode(IdleMode.kBrake); + intakeMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); } private void intake() { - + } private void reverseIntake() { - + intakeMotor.set(-0.5); } private void stopIntake() { - + intakeMotor.set(0); } private void rotateUp() { - + intakeMotor.set(0.5); } private void rotateDown() { - + intakeMotor.set(-0.5); } private void stopRotate() { - + intakeMotor.set(0); } @Override public void periodic() { // This method will be called once per scheduler run + if (driverJoystick.getRawButton(2)) { + rotateUp(); + } + else if (driverJoystick.getRawButton(3)) { + rotateDown(); + } + else { + stopRotate(); + + } + } } diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json new file mode 100644 index 0000000..162ad66 --- /dev/null +++ b/vendordeps/AdvantageKit.json @@ -0,0 +1,35 @@ +{ + "fileName": "AdvantageKit.json", + "name": "AdvantageKit", + "version": "26.0.0", + "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", + "frcYear": "2026", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" + ], + "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", + "javaDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-java", + "version": "26.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "org.littletonrobotics.akit", + "artifactId": "akit-wpilibio", + "version": "26.0.0", + "skipInvalidPlatforms": false, + "isJar": false, + "validPlatforms": [ + "linuxathena", + "linuxx86-64", + "linuxarm64", + "osxuniversal", + "windowsx86-64" + ] + } + ], + "cppDependencies": [] +} \ No newline at end of file diff --git a/vendordeps/AmLib-2026.0.1.json b/vendordeps/AmLib-2026.0.1.json new file mode 100644 index 0000000..90df51e --- /dev/null +++ b/vendordeps/AmLib-2026.0.1.json @@ -0,0 +1,34 @@ +{ + "fileName": "AmLib-2026.0.1.json", + "name": "AndyMark AM Library", + "version": "2026.0.1", + "frcYear": "2026", + "uuid": "f463c495-f27c-4102-9dde-af4e65a3eb2d", + "mavenUrls": [ + "https://andymarkproductsoftware.github.io/amlib-vendordep/repo/2026/" + ], + "jsonUrl": "https://andymarkproductsoftware.github.io/amlib-vendordep/vendordeps/2026/AmLib-2026.0.1.json", + "jniDependencies": [], + "javaDependencies": [ + { + "groupId": "com.andymark.frc", + "artifactId": "AmLib-java", + "version": "2026.0.1" + } + ], + "cppDependencies": [ + { + "groupId": "com.andymark.frc", + "artifactId": "AmLib-cpp", + "version": "2026.0.1", + "libName": "AmLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxathena" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/ChoreoLib2026.json b/vendordeps/ChoreoLib2026.json new file mode 100644 index 0000000..322c9e2 --- /dev/null +++ b/vendordeps/ChoreoLib2026.json @@ -0,0 +1,44 @@ +{ + "fileName": "ChoreoLib2026.json", + "name": "ChoreoLib", + "version": "2026.0.1", + "uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca", + "frcYear": "2026", + "mavenUrls": [ + "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/", + "https://repo1.maven.org/maven2" + ], + "jsonUrl": "https://choreo.autos/lib/ChoreoLib2026.json", + "javaDependencies": [ + { + "groupId": "choreo", + "artifactId": "ChoreoLib-java", + "version": "2026.0.1" + }, + { + "groupId": "com.google.code.gson", + "artifactId": "gson", + "version": "2.11.0" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "choreo", + "artifactId": "ChoreoLib-cpp", + "version": "2026.0.1", + "libName": "ChoreoLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxathena", + "linuxarm32", + "linuxarm64" + ] + } + ] +} \ No newline at end of file diff --git a/vendordeps/Phoenix5-replay-5.36.0.json b/vendordeps/Phoenix5-replay-5.36.0.json new file mode 100644 index 0000000..0e799ed --- /dev/null +++ b/vendordeps/Phoenix5-replay-5.36.0.json @@ -0,0 +1,221 @@ +{ + "fileName": "Phoenix5-replay-5.36.0.json", + "name": "CTRE-Phoenix (v5)", + "version": "5.36.0", + "frcYear": "2026", + "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-replay-frc2026-latest.json", + "requires": [ + { + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", + "offlineFileName": "Phoenix6-replay-frc2026-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json" + } + ], + "conflictsWith": [ + { + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "errorMessage": "Users must use the regular Phoenix 5 vendordep when using the regular Phoenix 6 vendordep.", + "offlineFileName": "Phoenix6-frc2026-latest.json" + }, + { + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", + "offlineFileName": "Phoenix5-frc2026-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.36.0" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.36.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "cci-replay", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.36.0", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.36.0", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.36.0", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.36.0", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "wpiapi-cpp-replay", + "version": "5.36.0", + "libName": "CTRE_Phoenix_WPIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "api-cpp-replay", + "version": "5.36.0", + "libName": "CTRE_PhoenixReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.replay", + "artifactId": "cci-replay", + "version": "5.36.0", + "libName": "CTRE_PhoenixCCIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.36.0", + "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.36.0", + "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.36.0", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} \ No newline at end of file diff --git a/vendordeps/Phoenix6-replay-26.1.1.json b/vendordeps/Phoenix6-replay-26.1.1.json new file mode 100644 index 0000000..b25b7e6 --- /dev/null +++ b/vendordeps/Phoenix6-replay-26.1.1.json @@ -0,0 +1,497 @@ +{ + "fileName": "Phoenix6-replay-26.1.1.json", + "name": "CTRE-Phoenix (v6) Replay", + "version": "26.1.1", + "frcYear": "2026", + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json", + "conflictsWith": [ + { + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", + "offlineFileName": "Phoenix6-frc2026-latest.json" + } + ], + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-java", + "version": "26.1.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "api-cpp", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "api-cpp-replay", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "tools-replay", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "api-cpp-sim", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix6", + "artifactId": "wpiapi-cpp", + "version": "26.1.1", + "libName": "CTRE_Phoenix6_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "libName": "CTRE_PhoenixTools", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "wpiapi-cpp-replay", + "version": "26.1.1", + "libName": "CTRE_Phoenix6_WPIReplay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.replay", + "artifactId": "tools-replay", + "version": "26.1.1", + "libName": "CTRE_PhoenixTools_Replay", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "26.1.1", + "libName": "CTRE_Phoenix6_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "tools-sim", + "version": "26.1.1", + "libName": "CTRE_PhoenixTools_Sim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simTalonSRX", + "version": "26.1.1", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simVictorSPX", + "version": "26.1.1", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simPigeonIMU", + "version": "26.1.1", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFX", + "version": "26.1.1", + "libName": "CTRE_SimProTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProTalonFXS", + "version": "26.1.1", + "libName": "CTRE_SimProTalonFXS", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANcoder", + "version": "26.1.1", + "libName": "CTRE_SimProCANcoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProPigeon2", + "version": "26.1.1", + "libName": "CTRE_SimProPigeon2", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANrange", + "version": "26.1.1", + "libName": "CTRE_SimProCANrange", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdi", + "version": "26.1.1", + "libName": "CTRE_SimProCANdi", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + }, + { + "groupId": "com.ctre.phoenix6.sim", + "artifactId": "simProCANdle", + "version": "26.1.1", + "libName": "CTRE_SimProCANdle", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "osxuniversal" + ], + "simMode": "swsim" + } + ] +} \ No newline at end of file diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json new file mode 100644 index 0000000..d35e593 --- /dev/null +++ b/vendordeps/REVLib.json @@ -0,0 +1,133 @@ +{ + "fileName": "REVLib.json", + "name": "REVLib", + "version": "2026.0.1", + "frcYear": "2026", + "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", + "mavenUrls": [ + "https://maven.revrobotics.com/" + ], + "jsonUrl": "https://software-metadata.revrobotics.com/REVLib-2026.json", + "javaDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-java", + "version": "2026.0.1" + } + ], + "jniDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2026.0.1", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-cpp", + "version": "2026.0.1", + "libName": "REVLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "REVLib-driver", + "version": "2026.0.1", + "libName": "REVLibDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibBackendDriver", + "version": "2026.0.1", + "libName": "BackendDriver", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.revrobotics.frc", + "artifactId": "RevLibWpiBackendDriver", + "version": "2026.0.1", + "libName": "REVLibWpi", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file From 99d6da2648b7f215cc27ce0c770f4156402a8bc1 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 29 Jan 2026 16:56:27 +0800 Subject: [PATCH 02/17] ewddfref From 7f5902c025e36012577120206c6a1c5f554e42f3 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 09:24:19 +0800 Subject: [PATCH 03/17] intake --- .../frc/robot/subsystems/IntakeSubsystem.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 2b8cde7..45ff64c 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -51,7 +51,7 @@ private void stopRotate() { @Override public void periodic() { - // This method will be called once per scheduler run + if (driverJoystick.getRawButton(2)) { rotateUp(); } @@ -60,8 +60,18 @@ else if (driverJoystick.getRawButton(3)) { } else { stopRotate(); - + + // + if (driverJoystick.getRawButton(4)) { + intake(); + } + else if (driverJoystick.getRawButton(5)) { + reverseIntake(); + } + else { + stopIntake(); + } } } -} +} \ No newline at end of file From 9caa3a477a492e1bad448563c53b28706450b453 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 13:22:20 +0800 Subject: [PATCH 04/17] IntakeRevise --- .../frc/robot/subsystems/IntakeSubsystem.java | 55 +---- vendordeps/AdvantageKit.json | 35 --- vendordeps/ChoreoLib2026.json | 44 ---- vendordeps/Phoenix5-replay-5.36.0.json | 221 ------------------ ....1.1.json => Phoenix6-frc2026-latest.json} | 76 ++---- 5 files changed, 24 insertions(+), 407 deletions(-) delete mode 100644 vendordeps/AdvantageKit.json delete mode 100644 vendordeps/ChoreoLib2026.json delete mode 100644 vendordeps/Phoenix5-replay-5.36.0.json rename vendordeps/{Phoenix6-replay-26.1.1.json => Phoenix6-frc2026-latest.json} (88%) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 45ff64c..0ee5754 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -5,73 +5,38 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; -import edu.wpi.first.wpilibj.Joystick; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.config.SparkMaxConfig; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; public class IntakeSubsystem extends SubsystemBase { - SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); - SparkMaxConfig config = new SparkMaxConfig(); - Joystick driverJoystick = new Joystick(0); + private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); + private final SparkMaxConfig config = new SparkMaxConfig(); public IntakeSubsystem() { config.inverted(false) .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); - intakeMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); - } - - private void intake() { - - } - - private void reverseIntake() { - intakeMotor.set(-0.5); - } - private void stopIntake() { - intakeMotor.set(0); + + intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); } - private void rotateUp() { - intakeMotor.set(0.5); + public void intake() { + intakeMotor.set(0.5); } - private void rotateDown() { - intakeMotor.set(-0.5); + public void reverseIntake() { + intakeMotor.set(-0.5); } - private void stopRotate() { + public void stopIntake() { intakeMotor.set(0); } @Override public void periodic() { - - if (driverJoystick.getRawButton(2)) { - rotateUp(); - } - else if (driverJoystick.getRawButton(3)) { - rotateDown(); - } - else { - stopRotate(); - - // - if (driverJoystick.getRawButton(4)) { - intake(); - } - else if (driverJoystick.getRawButton(5)) { - reverseIntake(); - } - else { - stopIntake(); - } - } - + // 這裡維持空白,或僅放 Sensor 數據更新 } } \ No newline at end of file diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json deleted file mode 100644 index 162ad66..0000000 --- a/vendordeps/AdvantageKit.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "fileName": "AdvantageKit.json", - "name": "AdvantageKit", - "version": "26.0.0", - "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "frcYear": "2026", - "mavenUrls": [ - "https://frcmaven.wpi.edu/artifactory/littletonrobotics-mvn-release/" - ], - "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", - "javaDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-java", - "version": "26.0.0" - } - ], - "jniDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-wpilibio", - "version": "26.0.0", - "skipInvalidPlatforms": false, - "isJar": false, - "validPlatforms": [ - "linuxathena", - "linuxx86-64", - "linuxarm64", - "osxuniversal", - "windowsx86-64" - ] - } - ], - "cppDependencies": [] -} \ No newline at end of file diff --git a/vendordeps/ChoreoLib2026.json b/vendordeps/ChoreoLib2026.json deleted file mode 100644 index 322c9e2..0000000 --- a/vendordeps/ChoreoLib2026.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "fileName": "ChoreoLib2026.json", - "name": "ChoreoLib", - "version": "2026.0.1", - "uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca", - "frcYear": "2026", - "mavenUrls": [ - "https://frcmaven.wpi.edu/artifactory/sleipnirgroup-mvn-release/", - "https://repo1.maven.org/maven2" - ], - "jsonUrl": "https://choreo.autos/lib/ChoreoLib2026.json", - "javaDependencies": [ - { - "groupId": "choreo", - "artifactId": "ChoreoLib-java", - "version": "2026.0.1" - }, - { - "groupId": "com.google.code.gson", - "artifactId": "gson", - "version": "2.11.0" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "choreo", - "artifactId": "ChoreoLib-cpp", - "version": "2026.0.1", - "libName": "ChoreoLib", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "osxuniversal", - "linuxathena", - "linuxarm32", - "linuxarm64" - ] - } - ] -} \ No newline at end of file diff --git a/vendordeps/Phoenix5-replay-5.36.0.json b/vendordeps/Phoenix5-replay-5.36.0.json deleted file mode 100644 index 0e799ed..0000000 --- a/vendordeps/Phoenix5-replay-5.36.0.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "fileName": "Phoenix5-replay-5.36.0.json", - "name": "CTRE-Phoenix (v5)", - "version": "5.36.0", - "frcYear": "2026", - "uuid": "fbc886a4-2cec-40c0-9835-71086a8cc3df", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-replay-frc2026-latest.json", - "requires": [ - { - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", - "errorMessage": "Phoenix 5 requires low-level libraries from Phoenix 6. Please add the Phoenix 6 vendordep before adding Phoenix 5.", - "offlineFileName": "Phoenix6-replay-frc2026-latest.json", - "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json" - } - ], - "conflictsWith": [ - { - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", - "errorMessage": "Users must use the regular Phoenix 5 vendordep when using the regular Phoenix 6 vendordep.", - "offlineFileName": "Phoenix6-frc2026-latest.json" - }, - { - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", - "errorMessage": "Users cannot have both the replay and regular Phoenix 5 vendordeps in their robot program.", - "offlineFileName": "Phoenix5-frc2026-latest.json" - } - ], - "javaDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-java", - "version": "5.36.0" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-java", - "version": "5.36.0" - } - ], - "jniDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.36.0", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.replay", - "artifactId": "cci-replay", - "version": "5.36.0", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "cci-sim", - "version": "5.36.0", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ], - "cppDependencies": [ - { - "groupId": "com.ctre.phoenix", - "artifactId": "wpiapi-cpp", - "version": "5.36.0", - "libName": "CTRE_Phoenix_WPI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.36.0", - "libName": "CTRE_Phoenix", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "cci", - "version": "5.36.0", - "libName": "CTRE_PhoenixCCI", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.replay", - "artifactId": "wpiapi-cpp-replay", - "version": "5.36.0", - "libName": "CTRE_Phoenix_WPIReplay", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.replay", - "artifactId": "api-cpp-replay", - "version": "5.36.0", - "libName": "CTRE_PhoenixReplay", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.replay", - "artifactId": "cci-replay", - "version": "5.36.0", - "libName": "CTRE_PhoenixCCIReplay", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix.sim", - "artifactId": "wpiapi-cpp-sim", - "version": "5.36.0", - "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.36.0", - "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.36.0", - "libName": "CTRE_PhoenixCCISim", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" - ], - "simMode": "swsim" - } - ] -} \ No newline at end of file diff --git a/vendordeps/Phoenix6-replay-26.1.1.json b/vendordeps/Phoenix6-frc2026-latest.json similarity index 88% rename from vendordeps/Phoenix6-replay-26.1.1.json rename to vendordeps/Phoenix6-frc2026-latest.json index b25b7e6..d6cf160 100644 --- a/vendordeps/Phoenix6-replay-26.1.1.json +++ b/vendordeps/Phoenix6-frc2026-latest.json @@ -1,18 +1,18 @@ { - "fileName": "Phoenix6-replay-26.1.1.json", - "name": "CTRE-Phoenix (v6) Replay", + "fileName": "Phoenix6-frc2026-latest.json", + "name": "CTRE-Phoenix (v6)", "version": "26.1.1", "frcYear": "2026", - "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", + "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ "https://maven.ctr-electronics.com/release/" ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-replay-frc2026-latest.json", + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-latest.json", "conflictsWith": [ { - "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", + "uuid": "e7900d8d-826f-4dca-a1ff-182f658e98af", "errorMessage": "Users can not have both the replay and regular Phoenix 6 vendordeps in their robot program.", - "offlineFileName": "Phoenix6-frc2026-latest.json" + "offlineFileName": "Phoenix6-replay-frc2026-latest.json" } ], "javaDependencies": [ @@ -29,39 +29,17 @@ "version": "26.1.1", "isJar": false, "skipInvalidPlatforms": true, - "validPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6", - "artifactId": "tools", - "version": "26.1.1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6.replay", - "artifactId": "api-cpp-replay", - "version": "26.1.1", - "isJar": false, - "skipInvalidPlatforms": true, "validPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "osxuniversal" + "linuxathena" ], "simMode": "hwsim" }, { - "groupId": "com.ctre.phoenix6.replay", - "artifactId": "tools-replay", + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", "version": "26.1.1", "isJar": false, "skipInvalidPlatforms": true, @@ -69,7 +47,7 @@ "windowsx86-64", "linuxx86-64", "linuxarm64", - "osxuniversal" + "linuxathena" ], "simMode": "hwsim" }, @@ -252,6 +230,9 @@ "sharedLibrary": true, "skipInvalidPlatforms": true, "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", "linuxathena" ], "simMode": "hwsim" @@ -264,40 +245,11 @@ "headerClassifier": "headers", "sharedLibrary": true, "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6.replay", - "artifactId": "wpiapi-cpp-replay", - "version": "26.1.1", - "libName": "CTRE_Phoenix6_WPIReplay", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, "binaryPlatforms": [ "windowsx86-64", "linuxx86-64", "linuxarm64", - "osxuniversal" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6.replay", - "artifactId": "tools-replay", - "version": "26.1.1", - "libName": "CTRE_PhoenixTools_Replay", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "osxuniversal" + "linuxathena" ], "simMode": "hwsim" }, From dac998c26f93a3a2e9c19c131c5944e9def11a93 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 13:43:43 +0800 Subject: [PATCH 05/17] Revise Intake 2 --- .../frc/robot/subsystems/IntakeSubsystem.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 0ee5754..19186d5 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -4,11 +4,11 @@ package frc.robot.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType; -import com.revrobotics.spark.config.SparkMaxConfig; +import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; +import com.revrobotics.spark.config.SparkMaxConfig; +import edu.wpi.first.wpilibj2.command.SubsystemBase; public class IntakeSubsystem extends SubsystemBase { private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); @@ -16,10 +16,9 @@ public class IntakeSubsystem extends SubsystemBase { public IntakeSubsystem() { config.inverted(false) - .smartCurrentLimit(30) - .idleMode(IdleMode.kBrake); + .smartCurrentLimit(30) + .idleMode(IdleMode.kBrake); - intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); } @@ -27,14 +26,26 @@ public void intake() { intakeMotor.set(0.5); } - public void reverseIntake() { + private void reverseIntake() { intakeMotor.set(-0.5); } - public void stopIntake() { + private void stopIntake() { intakeMotor.set(0); } + private void rotateUp() { + // Placeholder for rotate up logic + } + + private void rotateDown() { + // Placeholder for rotate down logic + } + + private void stopRotate() { + // Placeholder for stop rotate logic + } + @Override public void periodic() { // 這裡維持空白,或僅放 Sensor 數據更新 From c7ee353d71a3de0a42f1c1eb80b0532b0aaed874 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 13:57:42 +0800 Subject: [PATCH 06/17] Revise Intake 3 --- .../frc/robot/subsystems/IntakeSubsystem.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 19186d5..36f9aae 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -4,50 +4,59 @@ package frc.robot.subsystems; +import com.revrobotics.spark.SparkBase.PersistMode; +import com.revrobotics.spark.SparkBase.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; import edu.wpi.first.wpilibj2.command.SubsystemBase; + public class IntakeSubsystem extends SubsystemBase { private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); private final SparkMaxConfig config = new SparkMaxConfig(); + public IntakeSubsystem() { config.inverted(false) .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); - intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); + intakeMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); } + public void intake() { intakeMotor.set(0.5); } - private void reverseIntake() { + + public void reverseIntake() { intakeMotor.set(-0.5); } - private void stopIntake() { + + public void stopIntake() { intakeMotor.set(0); } - private void rotateUp() { - // Placeholder for rotate up logic + public void rotateUp() { + intakeMotor.set(0.2); } - private void rotateDown() { - // Placeholder for rotate down logic + + public void rotateDown() { + intakeMotor.set(-0.2); } - private void stopRotate() { - // Placeholder for stop rotate logic + + public void stopRotate() { + intakeMotor.set(0); } @Override public void periodic() { - // 這裡維持空白,或僅放 Sensor 數據更新 + } } \ No newline at end of file From 6d84acb6e1357f9f3bd6e388d2c601f648f3c3fe Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 15:23:22 +0800 Subject: [PATCH 07/17] three motor --- .../frc/robot/subsystems/IntakeSubsystem.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 36f9aae..bf6c5db 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -15,44 +15,46 @@ public class IntakeSubsystem extends SubsystemBase { private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); + private final SparkMax pivotLeft = new SparkMax(11, MotorType.kBrushless); + private final SparkMax pivotRight = new SparkMax(12, MotorType.kBrushless); + private final SparkMaxConfig config = new SparkMaxConfig(); - public IntakeSubsystem() { config.inverted(false) .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); intakeMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + pivotLeft.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + pivotRight.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); } - public void intake() { intakeMotor.set(0.5); } - public void reverseIntake() { intakeMotor.set(-0.5); } - public void stopIntake() { intakeMotor.set(0); } public void rotateUp() { - intakeMotor.set(0.2); + pivotLeft.set(0.2); + pivotRight.set(-0.2); } - public void rotateDown() { - intakeMotor.set(-0.2); + pivotLeft.set(-0.2); + pivotRight.set(0.2); } - public void stopRotate() { - intakeMotor.set(0); + pivotLeft.set(0); + pivotRight.set(0); } @Override From c907f865ac962ee7343232ec654db3bb8e7218e3 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 17:10:01 +0800 Subject: [PATCH 08/17] [Intake] feat: add encoder and smartdashboard --- src/main/java/frc/robot/subsystems/IntakeSubsystem.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index bf6c5db..497fb7c 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -4,8 +4,6 @@ package frc.robot.subsystems; -import com.revrobotics.spark.SparkBase.PersistMode; -import com.revrobotics.spark.SparkBase.ResetMode; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; From 62407895aaa8541cadcadc09826433070390eb77 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 17:11:37 +0800 Subject: [PATCH 09/17] [Intake] feat : add encoder and SmartDashboard --- .../java/frc/robot/subsystems/IntakeSubsystem.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 497fb7c..a3bee3b 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -4,10 +4,13 @@ package frc.robot.subsystems; + import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; +import edu.wpi.first.wpilibj.Encoder; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -15,7 +18,7 @@ public class IntakeSubsystem extends SubsystemBase { private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); private final SparkMax pivotLeft = new SparkMax(11, MotorType.kBrushless); private final SparkMax pivotRight = new SparkMax(12, MotorType.kBrushless); - + private final Encoder pivotEncoder = new Encoder(4, 5); private final SparkMaxConfig config = new SparkMaxConfig(); public IntakeSubsystem() { @@ -23,9 +26,10 @@ public IntakeSubsystem() { .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); - intakeMotor.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); - pivotLeft.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); - pivotRight.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters); + // 使用簡化後的 configure 方法,移除過時的參數 + intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); + pivotLeft.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); + pivotRight.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); } public void intake() { @@ -57,6 +61,6 @@ public void stopRotate() { @Override public void periodic() { - + SmartDashboard.putNumber("Pivot Position", pivotEncoder.getDistance()); } } \ No newline at end of file From 1bcae63b8be2718c34bfc949ece567200c4e3936 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 22:05:26 +0800 Subject: [PATCH 10/17] [intake] feat : Modify encoder category --- src/main/java/frc/robot/subsystems/IntakeSubsystem.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index a3bee3b..3abdb89 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -26,7 +26,6 @@ public IntakeSubsystem() { .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); - // 使用簡化後的 configure 方法,移除過時的參數 intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotLeft.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotRight.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); From 4d161571b61ee70e4cec8ad5712d29d63c9b90ef Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Jan 2026 22:06:37 +0800 Subject: [PATCH 11/17] [Intake]feat : modify encoder type --- .../frc/robot/subsystems/IntakeSubsystem.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 3abdb89..f694748 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -9,7 +9,7 @@ import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.wpilibj.Encoder; +import edu.wpi.first.wpilibj.DutyCycleEncoder; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -18,7 +18,7 @@ public class IntakeSubsystem extends SubsystemBase { private final SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless); private final SparkMax pivotLeft = new SparkMax(11, MotorType.kBrushless); private final SparkMax pivotRight = new SparkMax(12, MotorType.kBrushless); - private final Encoder pivotEncoder = new Encoder(4, 5); + private final DutyCycleEncoder pivotEncoder = new DutyCycleEncoder(4); private final SparkMaxConfig config = new SparkMaxConfig(); public IntakeSubsystem() { @@ -26,6 +26,7 @@ public IntakeSubsystem() { .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); + intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotLeft.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotRight.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); @@ -58,8 +59,21 @@ public void stopRotate() { pivotRight.set(0); } + public void deployIntake() { + rotateDown(); + } + + public void retractIntake() { + rotateUp(); + } + + public double getPivotAbsolutePosition() { + return pivotEncoder.get(); + } + @Override public void periodic() { - SmartDashboard.putNumber("Pivot Position", pivotEncoder.getDistance()); + SmartDashboard.putNumber("Pivot Absolute Pos", getPivotAbsolutePosition()); + SmartDashboard.putBoolean("Pivot Encoder Connected", pivotEncoder.isConnected()); } } \ No newline at end of file From 39870de5e809ee573b431350633af61b754ddbf0 Mon Sep 17 00:00:00 2001 From: Alan Date: Sat, 31 Jan 2026 23:16:59 +0800 Subject: [PATCH 12/17] [intake]feat : Move config to constructor --- src/main/java/frc/robot/subsystems/IntakeSubsystem.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index f694748..c0443a7 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -19,15 +19,16 @@ public class IntakeSubsystem extends SubsystemBase { private final SparkMax pivotLeft = new SparkMax(11, MotorType.kBrushless); private final SparkMax pivotRight = new SparkMax(12, MotorType.kBrushless); private final DutyCycleEncoder pivotEncoder = new DutyCycleEncoder(4); - private final SparkMaxConfig config = new SparkMaxConfig(); + public IntakeSubsystem() { + SparkMaxConfig config = new SparkMaxConfig(); config.inverted(false) .smartCurrentLimit(30) .idleMode(IdleMode.kBrake); - - intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); + + intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotLeft.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); pivotRight.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters); } From b4cdb8afd7e353417a486dfd9849bce696cdd68b Mon Sep 17 00:00:00 2001 From: Alan Date: Sun, 1 Feb 2026 15:17:31 +0800 Subject: [PATCH 13/17] [intake]feat : remove vendor --- vendordeps/AmLib-2026.0.1.json | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 vendordeps/AmLib-2026.0.1.json diff --git a/vendordeps/AmLib-2026.0.1.json b/vendordeps/AmLib-2026.0.1.json deleted file mode 100644 index 90df51e..0000000 --- a/vendordeps/AmLib-2026.0.1.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "fileName": "AmLib-2026.0.1.json", - "name": "AndyMark AM Library", - "version": "2026.0.1", - "frcYear": "2026", - "uuid": "f463c495-f27c-4102-9dde-af4e65a3eb2d", - "mavenUrls": [ - "https://andymarkproductsoftware.github.io/amlib-vendordep/repo/2026/" - ], - "jsonUrl": "https://andymarkproductsoftware.github.io/amlib-vendordep/vendordeps/2026/AmLib-2026.0.1.json", - "jniDependencies": [], - "javaDependencies": [ - { - "groupId": "com.andymark.frc", - "artifactId": "AmLib-java", - "version": "2026.0.1" - } - ], - "cppDependencies": [ - { - "groupId": "com.andymark.frc", - "artifactId": "AmLib-cpp", - "version": "2026.0.1", - "libName": "AmLib", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxathena" - ] - } - ] -} \ No newline at end of file From edbdb303c15566e79b100959a16dad60b6247962 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 2 Feb 2026 14:30:27 +0800 Subject: [PATCH 14/17] [intake] feat : add RobotContainer --- src/main/java/frc/robot/Constants.java | 14 ++++++++- src/main/java/frc/robot/RobotContainer.java | 35 +++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index e5fbceb..37cc802 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -6,5 +6,17 @@ /** Add your docs here. */ public class Constants { - + public class IntakeConstants { + public static final int intakeMotorId = 10; + public static final int pivotLeftId = 11; + public static final int pivotRightId = 12; + public static final int pivotEncoderId = 4; +// ---------------------------------- Intake Motor Speeds ---------------------------------- + public static final double intakeSpeed = 0.5; + public static final double reverseIntakeSpeed = -0.5; + public static final double stopIntakeSpeed = 0.0; + public static final double pivotSpeed = 0.2; + public static final double reversePivotSpeed = -0.2; + public static final double stopPivotSpeed = 0.0; + } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index de2c9d0..52764c8 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -5,16 +5,45 @@ package frc.robot; import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.InstantCommand; +import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import frc.robot.subsystems.IntakeSubsystem; public class RobotContainer { + private final IntakeSubsystem intakeSubsystem = new IntakeSubsystem(); + private final CommandXboxController driverController = new CommandXboxController(0); + public RobotContainer() { configureBindings(); } - private void configureBindings() {} + private void configureBindings() { + + // 按住A鍵吸球放開停止 + driverController.a().whileTrue( + new RunCommand(() -> intakeSubsystem.intake(), intakeSubsystem) + ).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem)); + + // 按住B鍵反轉放開停止 + driverController.b().whileTrue( + new RunCommand(() -> intakeSubsystem.reverseIntake(), intakeSubsystem) + ).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem)); + + // ------------------- Pivot 角度控制 ------------------- + + // 按住 Y 鍵抬起放開停止 + driverController.y().whileTrue( + new RunCommand(() -> intakeSubsystem.rotateUp(), intakeSubsystem) + ).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem)); + + // 按住 X鍵放下放開停止 + driverController.x().whileTrue( + new RunCommand(() -> intakeSubsystem.rotateDown(), intakeSubsystem) + ).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem)); + } public Command getAutonomousCommand() { - return Commands.print("No autonomous command configured"); + return null; } } From 1a6f1435c098aa1db78492a7a5fbe709da9d573a Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 2 Feb 2026 14:50:49 +0800 Subject: [PATCH 15/17] [Intake] feat : add RobotContainer --- src/main/java/frc/robot/Constants.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 37cc802..ec97312 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,13 +5,16 @@ package frc.robot; /** Add your docs here. */ -public class Constants { - public class IntakeConstants { + public final class Constants { + + public class IntakeConstants { + public static final int intakeMotorId = 10; public static final int pivotLeftId = 11; public static final int pivotRightId = 12; public static final int pivotEncoderId = 4; -// ---------------------------------- Intake Motor Speeds ---------------------------------- + // ---------------------------------- Intake Motor Speeds + // ---------------------------------- public static final double intakeSpeed = 0.5; public static final double reverseIntakeSpeed = -0.5; public static final double stopIntakeSpeed = 0.0; From 7f51f74032c033d8baa2ce03f4d0937b3f43406d Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 2 Feb 2026 15:02:40 +0800 Subject: [PATCH 16/17] [Intake] fix : fix some bug --- src/main/java/frc/robot/Constants.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index ec97312..80a0819 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,16 +5,14 @@ package frc.robot; /** Add your docs here. */ - public final class Constants { - - public class IntakeConstants { +public final class Constants { + public static final class IntakeConstants { public static final int intakeMotorId = 10; public static final int pivotLeftId = 11; public static final int pivotRightId = 12; public static final int pivotEncoderId = 4; - // ---------------------------------- Intake Motor Speeds - // ---------------------------------- + // ---------------------------------- Intake Motor Speeds ---------------------------------- public static final double intakeSpeed = 0.5; public static final double reverseIntakeSpeed = -0.5; public static final double stopIntakeSpeed = 0.0; From 5a3340f8e3426318e20d18af1312d093cedea597 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 2 Feb 2026 15:13:18 +0800 Subject: [PATCH 17/17] [Intake] fix : fix RobotContainer --- src/main/java/frc/robot/RobotContainer.java | 36 +++------------------ 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 52764c8..6b718a9 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -5,45 +5,17 @@ package frc.robot; import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.InstantCommand; -import edu.wpi.first.wpilibj2.command.RunCommand; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; -import frc.robot.subsystems.IntakeSubsystem; +import edu.wpi.first.wpilibj2.command.Commands; public class RobotContainer { - private final IntakeSubsystem intakeSubsystem = new IntakeSubsystem(); - private final CommandXboxController driverController = new CommandXboxController(0); - + public RobotContainer() { configureBindings(); } - private void configureBindings() { - - // 按住A鍵吸球放開停止 - driverController.a().whileTrue( - new RunCommand(() -> intakeSubsystem.intake(), intakeSubsystem) - ).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem)); - - // 按住B鍵反轉放開停止 - driverController.b().whileTrue( - new RunCommand(() -> intakeSubsystem.reverseIntake(), intakeSubsystem) - ).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem)); - - // ------------------- Pivot 角度控制 ------------------- - - // 按住 Y 鍵抬起放開停止 - driverController.y().whileTrue( - new RunCommand(() -> intakeSubsystem.rotateUp(), intakeSubsystem) - ).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem)); - - // 按住 X鍵放下放開停止 - driverController.x().whileTrue( - new RunCommand(() -> intakeSubsystem.rotateDown(), intakeSubsystem) - ).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem)); - } + private void configureBindings() {} public Command getAutonomousCommand() { - return null; + return Commands.print("No autonomous command configured"); } }