From d4b7f44ec2dbfed61db20c1cdb6ba40dafe19a92 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:01:56 +0800 Subject: [PATCH 01/21] finish ClimberSubsystem --- vendordeps/Phoenix5-5.36.0.json | 171 ++++++++++++ vendordeps/Phoenix6-26.1.1.json | 449 ++++++++++++++++++++++++++++++++ vendordeps/REVLib.json | 133 ++++++++++ vendordeps/Studica.json | 71 +++++ 4 files changed, 824 insertions(+) create mode 100644 vendordeps/Phoenix5-5.36.0.json create mode 100644 vendordeps/Phoenix6-26.1.1.json create mode 100644 vendordeps/REVLib.json create mode 100644 vendordeps/Studica.json diff --git a/vendordeps/Phoenix5-5.36.0.json b/vendordeps/Phoenix5-5.36.0.json new file mode 100644 index 0000000..9a27e47 --- /dev/null +++ b/vendordeps/Phoenix5-5.36.0.json @@ -0,0 +1,171 @@ +{ + "fileName": "Phoenix5-5.36.0.json", + "name": "CTRE-Phoenix (v5)", + "version": "5.36.0", + "frcYear": "2026", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-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-frc2026-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-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-frc2026-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-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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.36.0", + "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.36.0", + "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.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-26.1.1.json b/vendordeps/Phoenix6-26.1.1.json new file mode 100644 index 0000000..7a0eca0 --- /dev/null +++ b/vendordeps/Phoenix6-26.1.1.json @@ -0,0 +1,449 @@ +{ + "fileName": "Phoenix6-26.1.1.json", + "name": "CTRE-Phoenix (v6)", + "version": "26.1.1", + "frcYear": "2026", + "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-frc2026-latest.json", + "conflictsWith": [ + { + "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-replay-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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "libName": "CTRE_PhoenixTools", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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 diff --git a/vendordeps/Studica.json b/vendordeps/Studica.json new file mode 100644 index 0000000..b51bf58 --- /dev/null +++ b/vendordeps/Studica.json @@ -0,0 +1,71 @@ +{ + "fileName": "Studica.json", + "name": "Studica", + "version": "2026.0.0", + "frcYear": "2026", + "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", + "mavenUrls": [ + "https://dev.studica.com/maven/release/2026/" + ], + "jsonUrl": "https://dev.studica.com/maven/release/2026/json/Studica-2026.0.0.json", + "javaDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-java", + "version": "2026.0.0" + } + ], + "jniDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-driver", + "version": "2026.0.0", + "skipInvalidPlatforms": true, + "isJar": false, + "validPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.studica.frc", + "artifactId": "Studica-cpp", + "version": "2026.0.0", + "libName": "Studica", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + }, + { + "groupId": "com.studica.frc", + "artifactId": "Studica-driver", + "version": "2026.0.0", + "libName": "StudicaDriver", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxarm64", + "linuxx86-64", + "linuxathena", + "linuxarm32", + "osxuniversal" + ] + } + ] +} \ No newline at end of file From 2f41282e569c9f4b8cc360bf455059dffe6135c7 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:10:10 +0800 Subject: [PATCH 02/21] =?UTF-8?q?[ClimberSubsystem]=20feat:=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=9D=E7=89=88=E7=A8=8B=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../robot/subsystems/ClimberSubsystem.java | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 2a169f9..86bbf1b 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -3,31 +3,61 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.subsystems; +import com.revrobotics.spark.SparkMax; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.FeedbackSensor; +import com.revrobotics.spark.SparkBase.ControlType; +import com.revrobotics.spark.SparkClosedLoopController; +import com.revrobotics.RelativeEncoder; + +import com.revrobotics.spark.config.SparkMaxConfig; + +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; + + public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ - public ClimberSubsystem() {} + private final SparkMax climberMotor = new SparkMax(5, MotorType.kBrushless); + private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); + private static final double L1_POSITION = 0.0; + private static final double L2_POSITION = 0.0; + private static final double MANUAL_SPEED = 0.5; + public ClimberSubsystem() { + SparkMaxConfig config = new SparkMaxConfig(); + config.closedLoop + .feedbackSensor(FeedbackSensor.kPrimaryEncoder) + .p(0.0) + .i(0.0) + .d(0.0) + .outputRange(-1.0, 1.0); + config + .idleMode(com.revrobotics.spark.config.SparkBaseConfig.IdleMode.kBrake) + .smartCurrentLimit(0); + } + private void toLowRung() { - + closedLoopController.setSetpoint(L1_POSITION, ControlType.kPosition); } private void toMidRung() { - + closedLoopController.setSetpoint(L2_POSITION, ControlType.kPosition); } private void climbUp() { - + climberMotor.set(MANUAL_SPEED); } private void climbDown() { - + climberMotor.set(-MANUAL_SPEED); } private void stopClimb() { - + climberMotor.set(0); + } @Override From f8fccfa7a8f2c1b09ca2d8beb0baa52fcd6a3de3 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:28:58 +0800 Subject: [PATCH 03/21] =?UTF-8?q?[ClimberSubsystem]fix:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=92=E7=89=88=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../robot/subsystems/ClimberSubsystem.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 86bbf1b..a1dcd8a 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -3,28 +3,25 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.subsystems; + import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.RelativeEncoder; - import com.revrobotics.spark.config.SparkMaxConfig; - import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; - import edu.wpi.first.wpilibj2.command.SubsystemBase; - - public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ private final SparkMax climberMotor = new SparkMax(5, MotorType.kBrushless); private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); - private static final double L1_POSITION = 0.0; - private static final double L2_POSITION = 0.0; + private static final double L1_POSITION = 0.0; + private static final double L2_POSITION = 0.0; private static final double MANUAL_SPEED = 0.5; + public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); config.closedLoop @@ -37,27 +34,26 @@ public ClimberSubsystem() { .idleMode(com.revrobotics.spark.config.SparkBaseConfig.IdleMode.kBrake) .smartCurrentLimit(0); } - private void toLowRung() { - closedLoopController.setSetpoint(L1_POSITION, ControlType.kPosition); + closedLoopController.setSetpoint(L1_POSITION, ControlType.kPosition); } private void toMidRung() { - closedLoopController.setSetpoint(L2_POSITION, ControlType.kPosition); + closedLoopController.setSetpoint(L2_POSITION, ControlType.kPosition); } private void climbUp() { - climberMotor.set(MANUAL_SPEED); + climberMotor.set(MANUAL_SPEED); } private void climbDown() { - climberMotor.set(-MANUAL_SPEED); + climberMotor.set(-MANUAL_SPEED); } private void stopClimb() { - climberMotor.set(0); - + climberMotor.set(0); + } @Override From 17fee361aa08f5eb57002ddf8958bc7ea47ae60b Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:33:03 +0800 Subject: [PATCH 04/21] =?UTF-8?q?[ClimberSubsystem]fix:=E4=BF=AE=E6=94=B9i?= =?UTF-8?q?mport=E9=A0=86=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index a1dcd8a..ef22443 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -4,12 +4,12 @@ package frc.robot.subsystems; -import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.RelativeEncoder; +import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; From 6db4d7914189ccaea262b2b2476ec6cccb3794f3 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:36:30 +0800 Subject: [PATCH 05/21] =?UTF-8?q?[ClimberSubsysten]fix:=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index ef22443..e5128ca 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -4,11 +4,11 @@ package frc.robot.subsystems; -import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.RelativeEncoder; +import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; From 316e8de3d2b07af5a706ee3c6492c2cd8563e8e4 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:39:30 +0800 Subject: [PATCH 06/21] =?UTF-8?q?[ClimberSubsystem]fix:=E5=86=8D=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E4=BF=AE=E6=94=B9import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index e5128ca..99a4463 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -6,8 +6,8 @@ import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.RelativeEncoder; +import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; From e3ef040aadb08fdc84b10187256504ff8117f837 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 16:41:18 +0800 Subject: [PATCH 07/21] =?UTF-8?q?[ClimberSubsystem]fix:3=E5=BA=A6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9import.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 99a4463..100e6be 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -4,9 +4,9 @@ package frc.robot.subsystems; +import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.RelativeEncoder; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; From 5d96323605eab4257bf632320aad2c9677352416 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 18:51:31 +0800 Subject: [PATCH 08/21] =?UTF-8?q?[ClimberSubsystem]feat:=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?constants=E5=90=8C=E6=99=82=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/Constants.java | 12 +++++++++ .../robot/subsystems/ClimberSubsystem.java | 27 ++++++++++--------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index e5fbceb..a817476 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -7,4 +7,16 @@ /** Add your docs here. */ public class Constants { + public static class ClimberConstants{ + public static final int motorId = 0; + public static final double kP = 0.0; + public static final double kI = 0.0; + public static final double kD = 0.0; + public static final double minOutput = -1.0; + public static final double maxOutput = 1.0; + public static final int currentLimit = 40; + public static final double L1position = 25.0; + public static final double L2position = 50.0; + public static final double speed = 0.5; + } } diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 100e6be..9abbc2b 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -13,42 +13,43 @@ import com.revrobotics.spark.config.SparkMaxConfig; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ - private final SparkMax climberMotor = new SparkMax(5, MotorType.kBrushless); + private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); - private static final double L1_POSITION = 0.0; - private static final double L2_POSITION = 0.0; - private static final double MANUAL_SPEED = 0.5; + private static final double L1position = ClimberConstants.L1position; + private static final double L2position = ClimberConstants.L2position; + private static final double speed = ClimberConstants.speed; public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); config.closedLoop .feedbackSensor(FeedbackSensor.kPrimaryEncoder) - .p(0.0) - .i(0.0) - .d(0.0) - .outputRange(-1.0, 1.0); + .p(ClimberConstants.kP) + .i(ClimberConstants.kI) + .d(ClimberConstants.kD) + .outputRange(ClimberConstants.minOutput, ClimberConstants.maxOutput); config .idleMode(com.revrobotics.spark.config.SparkBaseConfig.IdleMode.kBrake) - .smartCurrentLimit(0); + .smartCurrentLimit(ClimberConstants.currentLimit); } private void toLowRung() { - closedLoopController.setSetpoint(L1_POSITION, ControlType.kPosition); + closedLoopController.setSetpoint(ClimberConstants.L1position, ControlType.kPosition); } private void toMidRung() { - closedLoopController.setSetpoint(L2_POSITION, ControlType.kPosition); + closedLoopController.setSetpoint(ClimberConstants.L2position, ControlType.kPosition); } private void climbUp() { - climberMotor.set(MANUAL_SPEED); + climberMotor.set(ClimberConstants.speed); } private void climbDown() { - climberMotor.set(-MANUAL_SPEED); + climberMotor.set(-ClimberConstants.speed); } private void stopClimb() { From e1a2d04ec32db42a0027af6dd5a98f9a614e13d0 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 29 Jan 2026 20:09:44 +0800 Subject: [PATCH 09/21] =?UTF-8?q?[ClimberSubsystem]fix:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E6=95=B8=E5=8F=8Aconstants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/Constants.java | 22 +++++++++---------- .../robot/subsystems/ClimberSubsystem.java | 14 ++++++------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index a817476..1433234 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -7,16 +7,14 @@ /** Add your docs here. */ public class Constants { - public static class ClimberConstants{ - public static final int motorId = 0; - public static final double kP = 0.0; - public static final double kI = 0.0; - public static final double kD = 0.0; - public static final double minOutput = -1.0; - public static final double maxOutput = 1.0; - public static final int currentLimit = 40; - public static final double L1position = 25.0; - public static final double L2position = 50.0; - public static final double speed = 0.5; - } + public static class ClimberConstants { + public static final int motorId = 0; + public static final double kP = 0.0; + public static final double kI = 0.0; + public static final double kD = 0.0; + public static final double minOutput = -1.0; + public static final double maxOutput = 1.0; + public static final int currentLimit = 40; + + } } diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 9abbc2b..b56bd62 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -19,9 +19,9 @@ public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); - private static final double L1position = ClimberConstants.L1position; - private static final double L2position = ClimberConstants.L2position; - private static final double speed = ClimberConstants.speed; + private static final double L1position = 25; + private static final double L2position = 50; + private static final double motorSpeed = 0.5; public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); @@ -37,19 +37,19 @@ public ClimberSubsystem() { } private void toLowRung() { - closedLoopController.setSetpoint(ClimberConstants.L1position, ControlType.kPosition); + closedLoopController.setSetpoint(L1position, ControlType.kPosition); } private void toMidRung() { - closedLoopController.setSetpoint(ClimberConstants.L2position, ControlType.kPosition); + closedLoopController.setSetpoint(L2position, ControlType.kPosition); } private void climbUp() { - climberMotor.set(ClimberConstants.speed); + climberMotor.set(motorSpeed); } private void climbDown() { - climberMotor.set(-ClimberConstants.speed); + climberMotor.set(-motorSpeed); } private void stopClimb() { From 0b630f65a1ab9e9669dc50edbdf750a8d067f2c5 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 16:24:22 +0800 Subject: [PATCH 10/21] =?UTF-8?q?[ClimberSubsystem]feat:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=B0=A1=E6=98=93command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/RobotContainer.java | 1 + .../robot/subsystems/ClimberSubsystem.java | 10 ++-- .../java/frc/robot/subsystems/climberCMD.java | 59 +++++++++++++++++++ 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 src/main/java/frc/robot/subsystems/climberCMD.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index de2c9d0..2f88c7f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -9,6 +9,7 @@ public class RobotContainer { public RobotContainer() { + configureBindings(); } diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index b56bd62..ece9d97 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -36,23 +36,23 @@ public ClimberSubsystem() { .smartCurrentLimit(ClimberConstants.currentLimit); } - private void toLowRung() { + public void toLowRung() { closedLoopController.setSetpoint(L1position, ControlType.kPosition); } - private void toMidRung() { + public void toMidRung() { closedLoopController.setSetpoint(L2position, ControlType.kPosition); } - private void climbUp() { + public void climbUp() { climberMotor.set(motorSpeed); } - private void climbDown() { + public void climbDown() { climberMotor.set(-motorSpeed); } - private void stopClimb() { + public void stopClimb() { climberMotor.set(0); } diff --git a/src/main/java/frc/robot/subsystems/climberCMD.java b/src/main/java/frc/robot/subsystems/climberCMD.java new file mode 100644 index 0000000..fdafb2d --- /dev/null +++ b/src/main/java/frc/robot/subsystems/climberCMD.java @@ -0,0 +1,59 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.subsystems; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.ClimberSubsystem; + +/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ +public class climberCMD extends Command { + /** Creates a new climberCMD. */ + public enum ClimberAction { + L1, L2, UP, DOWN + } + ClimberSubsystem climberSubsystem; + ClimberAction action; + public climberCMD(ClimberSubsystem climberSubsystem, ClimberAction action) { + // Use addRequirements() here to declare subsystem dependencies. + this.climberSubsystem=climberSubsystem; + this.action=action; + addRequirements(climberSubsystem); + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + switch (action) { + case L1: + climberSubsystem.toLowRung(); + break; + case L2: + climberSubsystem.toMidRung(); + break; + case UP: + climberSubsystem.climbUp(); + break; + case DOWN: + climberSubsystem.climbDown(); + break; + } + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + climberSubsystem.stopClimb(); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From a97aa47682192277c6b7c1c2c908aaae82b183ef Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 16:31:13 +0800 Subject: [PATCH 11/21] =?UTF-8?q?[ClimberSubsystem]:style=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/climberCMD.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/climberCMD.java b/src/main/java/frc/robot/subsystems/climberCMD.java index fdafb2d..4295503 100644 --- a/src/main/java/frc/robot/subsystems/climberCMD.java +++ b/src/main/java/frc/robot/subsystems/climberCMD.java @@ -13,8 +13,10 @@ public class climberCMD extends Command { public enum ClimberAction { L1, L2, UP, DOWN } - ClimberSubsystem climberSubsystem; - ClimberAction action; + + ClimberSubsystem climberSubsystem; + ClimberAction action; + public climberCMD(ClimberSubsystem climberSubsystem, ClimberAction action) { // Use addRequirements() here to declare subsystem dependencies. this.climberSubsystem=climberSubsystem; @@ -30,20 +32,21 @@ public void initialize() { climberSubsystem.toLowRung(); break; case L2: - climberSubsystem.toMidRung(); + climberSubsystem.toMidRung(); break; case UP: climberSubsystem.climbUp(); break; case DOWN: - climberSubsystem.climbDown(); + climberSubsystem.climbDown(); break; } } // Called every time the scheduler runs while the command is scheduled. @Override - public void execute() {} + public void execute() { + } // Called once the command ends or is interrupted. @Override From 6939b0e8a0a7198d2a40e8bb707ddd3dc0d0459a Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 16:38:36 +0800 Subject: [PATCH 12/21] =?UTF-8?q?[ClimberSubsystem]style:=E5=86=8D?= =?UTF-8?q?=E6=AC=A1=E4=BF=AE=E6=94=B9=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{climberCMD.java => climberCommand.java} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename src/main/java/frc/robot/subsystems/{climberCMD.java => climberCommand.java} (85%) diff --git a/src/main/java/frc/robot/subsystems/climberCMD.java b/src/main/java/frc/robot/subsystems/climberCommand.java similarity index 85% rename from src/main/java/frc/robot/subsystems/climberCMD.java rename to src/main/java/frc/robot/subsystems/climberCommand.java index 4295503..8201fba 100644 --- a/src/main/java/frc/robot/subsystems/climberCMD.java +++ b/src/main/java/frc/robot/subsystems/climberCommand.java @@ -8,7 +8,7 @@ import frc.robot.subsystems.ClimberSubsystem; /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ -public class climberCMD extends Command { +public class climberCommand extends Command { /** Creates a new climberCMD. */ public enum ClimberAction { L1, L2, UP, DOWN @@ -17,10 +17,10 @@ public enum ClimberAction { ClimberSubsystem climberSubsystem; ClimberAction action; - public climberCMD(ClimberSubsystem climberSubsystem, ClimberAction action) { + public climberCommand(ClimberSubsystem climberSubsystem, ClimberAction action) { // Use addRequirements() here to declare subsystem dependencies. - this.climberSubsystem=climberSubsystem; - this.action=action; + this.climberSubsystem = climberSubsystem; + this.action = action; addRequirements(climberSubsystem); } @@ -40,6 +40,9 @@ public void initialize() { case DOWN: climberSubsystem.climbDown(); break; + default: + climberSubsystem.stopClimb(); + break; } } From aee521cdab65fa0fae7acc681e03d5ef48b46f7b Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 16:47:14 +0800 Subject: [PATCH 13/21] =?UTF-8?q?[ClimberSubsystem]style:=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AA=94=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/climberCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/climberCommand.java b/src/main/java/frc/robot/subsystems/climberCommand.java index 8201fba..dbfb394 100644 --- a/src/main/java/frc/robot/subsystems/climberCommand.java +++ b/src/main/java/frc/robot/subsystems/climberCommand.java @@ -8,7 +8,7 @@ import frc.robot.subsystems.ClimberSubsystem; /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ -public class climberCommand extends Command { +public class ClimberCommand extends Command { /** Creates a new climberCMD. */ public enum ClimberAction { L1, L2, UP, DOWN @@ -17,7 +17,7 @@ public enum ClimberAction { ClimberSubsystem climberSubsystem; ClimberAction action; - public climberCommand(ClimberSubsystem climberSubsystem, ClimberAction action) { + public ClimberCommand(ClimberSubsystem climberSubsystem, ClimberAction action) { // Use addRequirements() here to declare subsystem dependencies. this.climberSubsystem = climberSubsystem; this.action = action; From 2ec7914ee1008f8c4a2e15460860af2cbd6588eb Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 16:54:13 +0800 Subject: [PATCH 14/21] =?UTF-8?q?[Climber]style:=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=AA=94=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 1433234..534e0dc 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -14,7 +14,7 @@ public static class ClimberConstants { public static final double kD = 0.0; public static final double minOutput = -1.0; public static final double maxOutput = 1.0; - public static final int currentLimit = 40; + public static final int currentLimit = 30; } } From cdfe1abf91c45f42294d89a7248bc78b74c21bcd Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Fri, 30 Jan 2026 20:22:05 +0800 Subject: [PATCH 15/21] =?UTF-8?q?[ClimberSubsystem]style:=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=AA=94=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../robot/subsystems/{climberCommand.java => ClimberCmd.java} | 4 ++-- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) rename src/main/java/frc/robot/subsystems/{climberCommand.java => ClimberCmd.java} (92%) diff --git a/src/main/java/frc/robot/subsystems/climberCommand.java b/src/main/java/frc/robot/subsystems/ClimberCmd.java similarity index 92% rename from src/main/java/frc/robot/subsystems/climberCommand.java rename to src/main/java/frc/robot/subsystems/ClimberCmd.java index dbfb394..fdbb1c3 100644 --- a/src/main/java/frc/robot/subsystems/climberCommand.java +++ b/src/main/java/frc/robot/subsystems/ClimberCmd.java @@ -8,7 +8,7 @@ import frc.robot.subsystems.ClimberSubsystem; /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ -public class ClimberCommand extends Command { +public class ClimberCmd extends Command { /** Creates a new climberCMD. */ public enum ClimberAction { L1, L2, UP, DOWN @@ -17,7 +17,7 @@ public enum ClimberAction { ClimberSubsystem climberSubsystem; ClimberAction action; - public ClimberCommand(ClimberSubsystem climberSubsystem, ClimberAction action) { + public ClimberCmd(ClimberSubsystem climberSubsystem, ClimberAction action) { // Use addRequirements() here to declare subsystem dependencies. this.climberSubsystem = climberSubsystem; this.action = action; diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index ece9d97..2bfc0dd 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -11,7 +11,6 @@ import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants.ClimberConstants; From 29bfb9523b74ef4f6d371ab07c210e88d81d003b Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Mon, 2 Feb 2026 11:14:35 +0800 Subject: [PATCH 16/21] =?UTF-8?q?[ClimberSubsysyem]feat:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=B0=A1=E6=98=93command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendordeps/Phoenix5-5.36.0.json | 171 ------------ vendordeps/Phoenix6-26.1.1.json | 449 ------------------------------ vendordeps/REVLib.json | 133 --------- vendordeps/Studica.json | 71 ----- vendordeps/WPILibNewCommands.json | 39 --- 5 files changed, 863 deletions(-) delete mode 100644 vendordeps/Phoenix5-5.36.0.json delete mode 100644 vendordeps/Phoenix6-26.1.1.json delete mode 100644 vendordeps/REVLib.json delete mode 100644 vendordeps/Studica.json delete mode 100644 vendordeps/WPILibNewCommands.json diff --git a/vendordeps/Phoenix5-5.36.0.json b/vendordeps/Phoenix5-5.36.0.json deleted file mode 100644 index 9a27e47..0000000 --- a/vendordeps/Phoenix5-5.36.0.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "fileName": "Phoenix5-5.36.0.json", - "name": "CTRE-Phoenix (v5)", - "version": "5.36.0", - "frcYear": "2026", - "uuid": "ab676553-b602-441f-a38d-f1296eff6537", - "mavenUrls": [ - "https://maven.ctr-electronics.com/release/" - ], - "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-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-frc2026-latest.json", - "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-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-frc2026-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-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": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "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": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix", - "artifactId": "api-cpp", - "version": "5.36.0", - "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.36.0", - "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.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-26.1.1.json b/vendordeps/Phoenix6-26.1.1.json deleted file mode 100644 index 7a0eca0..0000000 --- a/vendordeps/Phoenix6-26.1.1.json +++ /dev/null @@ -1,449 +0,0 @@ -{ - "fileName": "Phoenix6-26.1.1.json", - "name": "CTRE-Phoenix (v6)", - "version": "26.1.1", - "frcYear": "2026", - "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-frc2026-latest.json", - "conflictsWith": [ - { - "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-replay-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": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6", - "artifactId": "tools", - "version": "26.1.1", - "isJar": false, - "skipInvalidPlatforms": true, - "validPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "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": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "simMode": "hwsim" - }, - { - "groupId": "com.ctre.phoenix6", - "artifactId": "tools", - "version": "26.1.1", - "libName": "CTRE_PhoenixTools", - "headerClassifier": "headers", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxx86-64", - "linuxarm64", - "linuxathena" - ], - "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 deleted file mode 100644 index d35e593..0000000 --- a/vendordeps/REVLib.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "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 diff --git a/vendordeps/Studica.json b/vendordeps/Studica.json deleted file mode 100644 index b51bf58..0000000 --- a/vendordeps/Studica.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "fileName": "Studica.json", - "name": "Studica", - "version": "2026.0.0", - "frcYear": "2026", - "uuid": "cb311d09-36e9-4143-a032-55bb2b94443b", - "mavenUrls": [ - "https://dev.studica.com/maven/release/2026/" - ], - "jsonUrl": "https://dev.studica.com/maven/release/2026/json/Studica-2026.0.0.json", - "javaDependencies": [ - { - "groupId": "com.studica.frc", - "artifactId": "Studica-java", - "version": "2026.0.0" - } - ], - "jniDependencies": [ - { - "groupId": "com.studica.frc", - "artifactId": "Studica-driver", - "version": "2026.0.0", - "skipInvalidPlatforms": true, - "isJar": false, - "validPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - } - ], - "cppDependencies": [ - { - "groupId": "com.studica.frc", - "artifactId": "Studica-cpp", - "version": "2026.0.0", - "libName": "Studica", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - }, - { - "groupId": "com.studica.frc", - "artifactId": "Studica-driver", - "version": "2026.0.0", - "libName": "StudicaDriver", - "headerClassifier": "headers", - "sharedLibrary": false, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "windowsx86-64", - "linuxarm64", - "linuxx86-64", - "linuxathena", - "linuxarm32", - "osxuniversal" - ] - } - ] -} \ No newline at end of file diff --git a/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json deleted file mode 100644 index d90630e..0000000 --- a/vendordeps/WPILibNewCommands.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "fileName": "WPILibNewCommands.json", - "name": "WPILib-New-Commands", - "version": "1.0.0", - "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", - "frcYear": "2026", - "mavenUrls": [], - "jsonUrl": "", - "javaDependencies": [ - { - "groupId": "edu.wpi.first.wpilibNewCommands", - "artifactId": "wpilibNewCommands-java", - "version": "wpilib" - } - ], - "jniDependencies": [], - "cppDependencies": [ - { - "groupId": "edu.wpi.first.wpilibNewCommands", - "artifactId": "wpilibNewCommands-cpp", - "version": "wpilib", - "libName": "wpilibNewCommands", - "headerClassifier": "headers", - "sourcesClassifier": "sources", - "sharedLibrary": true, - "skipInvalidPlatforms": true, - "binaryPlatforms": [ - "linuxsystemcore", - "linuxathena", - "linuxarm32", - "linuxarm64", - "windowsx86-64", - "windowsx86", - "linuxx86-64", - "osxuniversal" - ] - } - ] -} From 47db31878d38cc534b6bf3006b243e46cd3d967c Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Mon, 2 Feb 2026 11:15:33 +0800 Subject: [PATCH 17/21] =?UTF-8?q?[ClimberSubsystem]feat:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=B0=A1=E6=98=93command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/Constants.java | 6 +- src/main/java/frc/robot/RobotContainer.java | 3 +- .../java/frc/robot/subsystems/ClimberCmd.java | 65 --- .../robot/subsystems/ClimberSubsystem.java | 33 +- vendordeps/Phoenix5-5.36.0.json | 171 +++++++ vendordeps/Phoenix6-26.1.1.json | 449 ++++++++++++++++++ vendordeps/REVLib.json | 133 ++++++ vendordeps/WPILibNewCommands.json | 39 ++ 8 files changed, 828 insertions(+), 71 deletions(-) delete mode 100644 src/main/java/frc/robot/subsystems/ClimberCmd.java create mode 100644 vendordeps/Phoenix5-5.36.0.json create mode 100644 vendordeps/Phoenix6-26.1.1.json create mode 100644 vendordeps/REVLib.json create mode 100644 vendordeps/WPILibNewCommands.json diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 534e0dc..d67406c 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -9,11 +9,11 @@ public class Constants { public static class ClimberConstants { public static final int motorId = 0; - public static final double kP = 0.0; + public static final double kP = 0.01; public static final double kI = 0.0; public static final double kD = 0.0; - public static final double minOutput = -1.0; - public static final double maxOutput = 1.0; + public static final double minOutput = -0.3; + public static final double maxOutput = 0.3; public static final int currentLimit = 30; } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2f88c7f..2abb01c 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -9,7 +9,6 @@ public class RobotContainer { public RobotContainer() { - configureBindings(); } @@ -18,4 +17,4 @@ private void configureBindings() {} public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); } -} +} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/ClimberCmd.java b/src/main/java/frc/robot/subsystems/ClimberCmd.java deleted file mode 100644 index fdbb1c3..0000000 --- a/src/main/java/frc/robot/subsystems/ClimberCmd.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package frc.robot.subsystems; - -import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.subsystems.ClimberSubsystem; - -/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ -public class ClimberCmd extends Command { - /** Creates a new climberCMD. */ - public enum ClimberAction { - L1, L2, UP, DOWN - } - - ClimberSubsystem climberSubsystem; - ClimberAction action; - - public ClimberCmd(ClimberSubsystem climberSubsystem, ClimberAction action) { - // Use addRequirements() here to declare subsystem dependencies. - this.climberSubsystem = climberSubsystem; - this.action = action; - addRequirements(climberSubsystem); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - switch (action) { - case L1: - climberSubsystem.toLowRung(); - break; - case L2: - climberSubsystem.toMidRung(); - break; - case UP: - climberSubsystem.climbUp(); - break; - case DOWN: - climberSubsystem.climbDown(); - break; - default: - climberSubsystem.stopClimb(); - break; - } - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - climberSubsystem.stopClimb(); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 2bfc0dd..22105f9 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -4,18 +4,22 @@ package frc.robot.subsystems; -import com.revrobotics.RelativeEncoder; +import com.revrobotics.PersistMode; + +import com.revrobotics.ResetMode; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ + public enum ClimberAction{UP,DOWN,L1,L2} private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); private static final double L1position = 25; @@ -24,6 +28,7 @@ public class ClimberSubsystem extends SubsystemBase { public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); + config.closedLoop .feedbackSensor(FeedbackSensor.kPrimaryEncoder) .p(ClimberConstants.kP) @@ -33,6 +38,9 @@ public ClimberSubsystem() { config .idleMode(com.revrobotics.spark.config.SparkBaseConfig.IdleMode.kBrake) .smartCurrentLimit(ClimberConstants.currentLimit); + + climberMotor.configure( + config, ResetMode.kResetSafeParameters, PersistMode.kNoPersistParameters); } public void toLowRung() { @@ -53,7 +61,30 @@ public void climbDown() { public void stopClimb() { climberMotor.set(0); + } + + public Command toLowRungCmd() { + Command cmd = this.runEnd(() -> toLowRung(), () -> stopClimb()); + cmd.setName("toLowRungCmd"); + return cmd; + } + + public Command toMidRungCmd() { + Command cmd = this.runEnd(() -> toMidRung(), () -> stopClimb()); + cmd.setName("toMidRungCmd"); + return cmd; + } + + public Command climbUpCmd() { + Command cmd = this.runEnd(() -> climbUp(), () -> stopClimb()); + cmd.setName("climbUpCmd"); + return cmd; + } + public Command climbDownCmd() { + Command cmd = this.runEnd(() -> climbDown(), () -> stopClimb()); + cmd.setName("climbDownCmd"); + return cmd; } @Override diff --git a/vendordeps/Phoenix5-5.36.0.json b/vendordeps/Phoenix5-5.36.0.json new file mode 100644 index 0000000..9a27e47 --- /dev/null +++ b/vendordeps/Phoenix5-5.36.0.json @@ -0,0 +1,171 @@ +{ + "fileName": "Phoenix5-5.36.0.json", + "name": "CTRE-Phoenix (v5)", + "version": "5.36.0", + "frcYear": "2026", + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix5-frc2026-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-frc2026-latest.json", + "onlineUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2026-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-frc2026-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-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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.36.0", + "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.36.0", + "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.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-26.1.1.json b/vendordeps/Phoenix6-26.1.1.json new file mode 100644 index 0000000..7a0eca0 --- /dev/null +++ b/vendordeps/Phoenix6-26.1.1.json @@ -0,0 +1,449 @@ +{ + "fileName": "Phoenix6-26.1.1.json", + "name": "CTRE-Phoenix (v6)", + "version": "26.1.1", + "frcYear": "2026", + "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-frc2026-latest.json", + "conflictsWith": [ + { + "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-replay-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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "simMode": "hwsim" + }, + { + "groupId": "com.ctre.phoenix6", + "artifactId": "tools", + "version": "26.1.1", + "libName": "CTRE_PhoenixTools", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "linuxarm64", + "linuxathena" + ], + "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 diff --git a/vendordeps/WPILibNewCommands.json b/vendordeps/WPILibNewCommands.json new file mode 100644 index 0000000..69348e4 --- /dev/null +++ b/vendordeps/WPILibNewCommands.json @@ -0,0 +1,39 @@ +{ + "fileName": "WPILibNewCommands.json", + "name": "WPILib-New-Commands", + "version": "1.0.0", + "uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266", + "frcYear": "2026", + "mavenUrls": [], + "jsonUrl": "", + "javaDependencies": [ + { + "groupId": "edu.wpi.first.wpilibNewCommands", + "artifactId": "wpilibNewCommands-java", + "version": "wpilib" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "edu.wpi.first.wpilibNewCommands", + "artifactId": "wpilibNewCommands-cpp", + "version": "wpilib", + "libName": "wpilibNewCommands", + "headerClassifier": "headers", + "sourcesClassifier": "sources", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxsystemcore", + "linuxathena", + "linuxarm32", + "linuxarm64", + "windowsx86-64", + "windowsx86", + "linuxx86-64", + "osxuniversal" + ] + } + ] +} \ No newline at end of file From 4090adf064923351c494d6ddaa50691f6634f7b6 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Mon, 2 Feb 2026 11:25:23 +0800 Subject: [PATCH 18/21] =?UTF-8?q?[ClimberSubsystem]sytle:=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/subsystems/ClimberSubsystem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 22105f9..a58b240 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -5,7 +5,6 @@ package frc.robot.subsystems; import com.revrobotics.PersistMode; - import com.revrobotics.ResetMode; import com.revrobotics.spark.FeedbackSensor; import com.revrobotics.spark.SparkBase.ControlType; @@ -19,7 +18,10 @@ public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ - public enum ClimberAction{UP,DOWN,L1,L2} + public enum ClimberAction { + UP, DOWN, L1, L2 + } + private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); private static final double L1position = 25; From fddda67e19b15f798e73bcfbf4cd861fe145b43d Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Tue, 3 Feb 2026 10:52:51 +0800 Subject: [PATCH 19/21] =?UTF-8?q?[ClimberSubsystem]feat:=E6=8F=9B=E6=88=90?= =?UTF-8?q?DutyCycleEncoder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/RobotContainer.java | 17 ++++- .../robot/subsystems/ClimberSubsystem.java | 63 ++++++++++++------- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2abb01c..702d3eb 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,13 +6,26 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; - +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import frc.robot.subsystems.ClimberSubsystem; public class RobotContainer { + private final ClimberSubsystem climber = new ClimberSubsystem(); + CommandXboxController mainController = new CommandXboxController(0); public RobotContainer() { configureBindings(); } - private void configureBindings() {} + private void configureBindings() { + mainController.a() + .onTrue(climber.climbUpCmd()); + mainController.y() + .onTrue(climber.climbDownCmd()); + mainController.x() + .onTrue(climber.toLowRungCmd()); + mainController.b() + .onTrue(climber.toMidRungCmd()); + + } public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index a58b240..2076361 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -6,12 +6,13 @@ import com.revrobotics.PersistMode; import com.revrobotics.ResetMode; -import com.revrobotics.spark.FeedbackSensor; -import com.revrobotics.spark.SparkBase.ControlType; -import com.revrobotics.spark.SparkClosedLoopController; import com.revrobotics.spark.SparkLowLevel.MotorType; import com.revrobotics.spark.SparkMax; import com.revrobotics.spark.config.SparkMaxConfig; +import edu.wpi.first.math.MathUtil; +import edu.wpi.first.math.controller.PIDController; +import edu.wpi.first.wpilibj.DutyCycleEncoder; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants.ClimberConstants; @@ -23,74 +24,92 @@ public enum ClimberAction { } private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); - private final SparkClosedLoopController closedLoopController = climberMotor.getClosedLoopController(); + private final PIDController climberPID = new PIDController( + ClimberConstants.kP, ClimberConstants.kI, ClimberConstants.kD); + private final DutyCycleEncoder climberEncoder = new DutyCycleEncoder(1, 360, 0); private static final double L1position = 25; private static final double L2position = 50; - private static final double motorSpeed = 0.5; public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); - - config.closedLoop - .feedbackSensor(FeedbackSensor.kPrimaryEncoder) - .p(ClimberConstants.kP) - .i(ClimberConstants.kI) - .d(ClimberConstants.kD) - .outputRange(ClimberConstants.minOutput, ClimberConstants.maxOutput); config .idleMode(com.revrobotics.spark.config.SparkBaseConfig.IdleMode.kBrake) .smartCurrentLimit(ClimberConstants.currentLimit); climberMotor.configure( config, ResetMode.kResetSafeParameters, PersistMode.kNoPersistParameters); + climberMotor.getEncoder().setPosition(0); } public void toLowRung() { - closedLoopController.setSetpoint(L1position, ControlType.kPosition); + climberPID.setSetpoint(L1position); } public void toMidRung() { - closedLoopController.setSetpoint(L2position, ControlType.kPosition); + climberPID.setSetpoint(L2position); } public void climbUp() { - climberMotor.set(motorSpeed); + climberPID.setSetpoint(climberEncoder.get() + 5); } public void climbDown() { - climberMotor.set(-motorSpeed); + climberPID.setSetpoint(climberEncoder.get() + 10); + } + + public void toHome() { + climberPID.setSetpoint(0); } - public void stopClimb() { - climberMotor.set(0); + public void resetEncoder() { + climberMotor.getEncoder().setPosition(0); + climberPID.reset(); + climberPID.setSetpoint(0); } public Command toLowRungCmd() { - Command cmd = this.runEnd(() -> toLowRung(), () -> stopClimb()); + Command cmd = this.runEnd(() -> toLowRung(), () -> toHome()); cmd.setName("toLowRungCmd"); return cmd; } public Command toMidRungCmd() { - Command cmd = this.runEnd(() -> toMidRung(), () -> stopClimb()); + Command cmd = this.runEnd(() -> toMidRung(), () -> toHome()); cmd.setName("toMidRungCmd"); return cmd; } public Command climbUpCmd() { - Command cmd = this.runEnd(() -> climbUp(), () -> stopClimb()); + Command cmd = this.runEnd(() -> climbUp(), () -> toHome()); cmd.setName("climbUpCmd"); return cmd; } public Command climbDownCmd() { - Command cmd = this.runEnd(() -> climbDown(), () -> stopClimb()); + Command cmd = this.runEnd(() -> climbDown(), () -> toHome()); cmd.setName("climbDownCmd"); return cmd; } + public Command stopClimbCmd() { + Command cmd = this.runOnce(() -> this.toHome()); + cmd.setName("toHomeCmd"); + return cmd; + } + + public Command resetEncoderCmd() { + Command cmd = this.runOnce(() -> this.resetEncoder()); + cmd.setName("resetEncoderCmd"); + return cmd; + } + @Override public void periodic() { // This method will be called once per scheduler run + + double measurement = MathUtil.clamp(climberEncoder.get(), -0.3, 0.3); + climberMotor.set(climberPID.calculate(measurement)); + SmartDashboard.putNumber("Climber/Position", climberEncoder.get()); + SmartDashboard.putNumber("Climber/Target", climberPID.getSetpoint()); } } From 6926fe8ba523c61d0ee00ec82d7bdca3d330f5bb Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Wed, 4 Feb 2026 20:52:33 +0800 Subject: [PATCH 20/21] =?UTF-8?q?[Climber]feat:=E4=BF=AE=E6=94=B9toHome?= =?UTF-8?q?=E9=82=8F=E8=BC=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/Constants.java | 6 ++--- src/main/java/frc/robot/RobotContainer.java | 17 ++----------- .../robot/subsystems/ClimberSubsystem.java | 25 ++++++++----------- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index d67406c..bf181f3 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -12,9 +12,9 @@ public static class ClimberConstants { public static final double kP = 0.01; public static final double kI = 0.0; public static final double kD = 0.0; - public static final double minOutput = -0.3; - public static final double maxOutput = 0.3; - public static final int currentLimit = 30; + public static final int currentLimit = 80; + public static final double L1position = 25; + public static final double L2position = 50; } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 702d3eb..2abb01c 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,26 +6,13 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.CommandXboxController; -import frc.robot.subsystems.ClimberSubsystem; + public class RobotContainer { - private final ClimberSubsystem climber = new ClimberSubsystem(); - CommandXboxController mainController = new CommandXboxController(0); public RobotContainer() { configureBindings(); } - private void configureBindings() { - mainController.a() - .onTrue(climber.climbUpCmd()); - mainController.y() - .onTrue(climber.climbDownCmd()); - mainController.x() - .onTrue(climber.toLowRungCmd()); - mainController.b() - .onTrue(climber.toMidRungCmd()); - - } + private void configureBindings() {} public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 2076361..9f94532 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -19,16 +19,11 @@ public class ClimberSubsystem extends SubsystemBase { /** Creates a new ClimberSubsystem. */ - public enum ClimberAction { - UP, DOWN, L1, L2 - } private final SparkMax climberMotor = new SparkMax(ClimberConstants.motorId, MotorType.kBrushless); private final PIDController climberPID = new PIDController( ClimberConstants.kP, ClimberConstants.kI, ClimberConstants.kD); private final DutyCycleEncoder climberEncoder = new DutyCycleEncoder(1, 360, 0); - private static final double L1position = 25; - private static final double L2position = 50; public ClimberSubsystem() { SparkMaxConfig config = new SparkMaxConfig(); @@ -42,19 +37,19 @@ public ClimberSubsystem() { } public void toLowRung() { - climberPID.setSetpoint(L1position); + climberPID.setSetpoint(ClimberConstants.L1position); } public void toMidRung() { - climberPID.setSetpoint(L2position); + climberPID.setSetpoint(ClimberConstants.L2position); } public void climbUp() { - climberPID.setSetpoint(climberEncoder.get() + 5); + climberPID.setSetpoint(climberEncoder.get() + 10); } public void climbDown() { - climberPID.setSetpoint(climberEncoder.get() + 10); + climberPID.setSetpoint(climberEncoder.get() - 10); } public void toHome() { @@ -68,31 +63,31 @@ public void resetEncoder() { } public Command toLowRungCmd() { - Command cmd = this.runEnd(() -> toLowRung(), () -> toHome()); + Command cmd = this.runEnd(() -> toLowRung(), () -> climberMotor.set(0)); cmd.setName("toLowRungCmd"); return cmd; } public Command toMidRungCmd() { - Command cmd = this.runEnd(() -> toMidRung(), () -> toHome()); + Command cmd = this.runEnd(() -> toMidRung(), () -> climberMotor.set(0)); cmd.setName("toMidRungCmd"); return cmd; } public Command climbUpCmd() { - Command cmd = this.runEnd(() -> climbUp(), () -> toHome()); + Command cmd = this.runEnd(() -> climbUp(), () -> climberMotor.set(0)); cmd.setName("climbUpCmd"); return cmd; } public Command climbDownCmd() { - Command cmd = this.runEnd(() -> climbDown(), () -> toHome()); + Command cmd = this.runEnd(() -> climbDown(), () -> climberMotor.set(0)); cmd.setName("climbDownCmd"); return cmd; } public Command stopClimbCmd() { - Command cmd = this.runOnce(() -> this.toHome()); + Command cmd = this.runOnce(() -> this.climberMotor.set(0)); cmd.setName("toHomeCmd"); return cmd; } @@ -107,7 +102,7 @@ public Command resetEncoderCmd() { public void periodic() { // This method will be called once per scheduler run - double measurement = MathUtil.clamp(climberEncoder.get(), -0.3, 0.3); + double measurement = MathUtil.clamp(climberEncoder.get(), -1.0, 1.0); climberMotor.set(climberPID.calculate(measurement)); SmartDashboard.putNumber("Climber/Position", climberEncoder.get()); SmartDashboard.putNumber("Climber/Target", climberPID.getSetpoint()); From bfff155653edcfc5423298796c9c504c527535d1 Mon Sep 17 00:00:00 2001 From: GaryLiu0317 Date: Thu, 5 Feb 2026 20:48:36 +0800 Subject: [PATCH 21/21] =?UTF-8?q?[ClimberSubsystem]feat:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9clamp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/RobotContainer.java | 3 ++- .../java/frc/robot/subsystems/ClimberSubsystem.java | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2abb01c..5d9b219 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -12,7 +12,8 @@ public RobotContainer() { configureBindings(); } - private void configureBindings() {} + private void configureBindings() { + } public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 9f94532..7a1f2f0 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -33,7 +33,6 @@ public ClimberSubsystem() { climberMotor.configure( config, ResetMode.kResetSafeParameters, PersistMode.kNoPersistParameters); - climberMotor.getEncoder().setPosition(0); } public void toLowRung() { @@ -93,7 +92,7 @@ public Command stopClimbCmd() { } public Command resetEncoderCmd() { - Command cmd = this.runOnce(() -> this.resetEncoder()); + Command cmd = this.runOnce(() -> resetEncoder()); cmd.setName("resetEncoderCmd"); return cmd; } @@ -102,9 +101,11 @@ public Command resetEncoderCmd() { public void periodic() { // This method will be called once per scheduler run - double measurement = MathUtil.clamp(climberEncoder.get(), -1.0, 1.0); - climberMotor.set(climberPID.calculate(measurement)); - SmartDashboard.putNumber("Climber/Position", climberEncoder.get()); - SmartDashboard.putNumber("Climber/Target", climberPID.getSetpoint()); + double currentPosition = climberEncoder.get(); + double pidOutput = climberPID.calculate(currentPosition); + double limitedOutput = MathUtil.clamp(pidOutput, -0.5, 0.5); + climberMotor.set(limitedOutput); + SmartDashboard.putNumber("climberPosition", climberEncoder.get()); + SmartDashboard.putNumber("climberTarget", climberPID.getSetpoint()); } }