From 02ab1ef5aa3e39abd1b087951adfc61a2c1a948d Mon Sep 17 00:00:00 2001 From: Alex Sirota Date: Sun, 18 Aug 2024 13:32:29 -0700 Subject: [PATCH 1/5] Updated dependencies --- vendordeps/PathplannerLib.json | 6 ++--- vendordeps/Phoenix6.json | 48 +++++++++++++++++----------------- vendordeps/ReduxLib_2024.json | 8 +++--- vendordeps/yagsl.json | 4 +-- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index a019706..6dc648d 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -1,7 +1,7 @@ { "fileName": "PathplannerLib.json", "name": "PathplannerLib", - "version": "2024.2.7", + "version": "2024.2.8", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", "frcYear": "2024", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2024.2.7" + "version": "2024.2.8" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2024.2.7", + "version": "2024.2.8", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/Phoenix6.json b/vendordeps/Phoenix6.json index 2b7d172..0322385 100644 --- a/vendordeps/Phoenix6.json +++ b/vendordeps/Phoenix6.json @@ -1,7 +1,7 @@ { "fileName": "Phoenix6.json", "name": "CTRE-Phoenix (v6)", - "version": "24.2.0", + "version": "24.3.0", "frcYear": 2024, "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ @@ -19,14 +19,14 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "24.2.0" + "version": "24.3.0" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -39,7 +39,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -52,7 +52,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -65,7 +65,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -78,7 +78,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -91,7 +91,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -104,7 +104,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -117,7 +117,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -130,7 +130,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -143,7 +143,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -158,7 +158,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -173,7 +173,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -188,7 +188,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -203,7 +203,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -218,7 +218,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -233,7 +233,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -248,7 +248,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -263,7 +263,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -278,7 +278,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -293,7 +293,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -308,7 +308,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -323,7 +323,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, diff --git a/vendordeps/ReduxLib_2024.json b/vendordeps/ReduxLib_2024.json index 53bc91d..4d37a53 100644 --- a/vendordeps/ReduxLib_2024.json +++ b/vendordeps/ReduxLib_2024.json @@ -1,7 +1,7 @@ { "fileName": "ReduxLib_2024.json", "name": "ReduxLib", - "version": "2024.1.1", + "version": "2024.2.0", "frcYear": 2024, "uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd", "mavenUrls": [ @@ -12,14 +12,14 @@ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-java", - "version": "2024.1.1" + "version": "2024.2.0" } ], "jniDependencies": [ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-driver", - "version": "2024.1.1", + "version": "2024.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -36,7 +36,7 @@ { "groupId": "com.reduxrobotics.frc", "artifactId": "ReduxLib-cpp", - "version": "2024.1.1", + "version": "2024.2.0", "libName": "ReduxLib-cpp", "headerClassifier": "headers", "sourcesClassifier": "sources", diff --git a/vendordeps/yagsl.json b/vendordeps/yagsl.json index c280eee..318093a 100644 --- a/vendordeps/yagsl.json +++ b/vendordeps/yagsl.json @@ -1,7 +1,7 @@ { "fileName": "yagsl.json", "name": "YAGSL", - "version": "2024.4.8.6", + "version": "2024.5.0.2", "frcYear": "2024", "uuid": "1ccce5a4-acd2-4d18-bca3-4b8047188400", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "swervelib", "artifactId": "YAGSL-java", - "version": "2024.4.8.6" + "version": "2024.5.0.2" } ], "jniDependencies": [], From 487f0010871dfab3b77ad40e5a63cfdb8dd9ad8b Mon Sep 17 00:00:00 2001 From: Alex Sirota Date: Sun, 18 Aug 2024 13:45:11 -0700 Subject: [PATCH 2/5] sparkmax -> talonfx (kraken) & motor canbus IDs easier to use --- src/main/deploy/swerve/modules/backleft.json | 8 ++++---- src/main/deploy/swerve/modules/backright.json | 8 ++++---- src/main/deploy/swerve/modules/frontleft.json | 8 ++++---- src/main/deploy/swerve/modules/frontright.json | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/deploy/swerve/modules/backleft.json b/src/main/deploy/swerve/modules/backleft.json index c2bad8f..23c0eee 100755 --- a/src/main/deploy/swerve/modules/backleft.json +++ b/src/main/deploy/swerve/modules/backleft.json @@ -1,12 +1,12 @@ { "drive": { - "type": "sparkmax", - "id": 22, + "type": "talonfx", + "id": 31, "canbus": null }, "angle": { - "type": "sparkmax", - "id": 23, + "type": "talonfx", + "id": 32, "canbus": null }, "encoder": { diff --git a/src/main/deploy/swerve/modules/backright.json b/src/main/deploy/swerve/modules/backright.json index b2b5df0..98aa4a1 100755 --- a/src/main/deploy/swerve/modules/backright.json +++ b/src/main/deploy/swerve/modules/backright.json @@ -1,12 +1,12 @@ { "drive": { - "type": "sparkmax", - "id": 24, + "type": "talonfx", + "id": 41, "canbus": null }, "angle": { - "type": "sparkmax", - "id": 25, + "type": "talonfx", + "id": 42, "canbus": null }, "encoder": { diff --git a/src/main/deploy/swerve/modules/frontleft.json b/src/main/deploy/swerve/modules/frontleft.json index a60108c..1414ec6 100755 --- a/src/main/deploy/swerve/modules/frontleft.json +++ b/src/main/deploy/swerve/modules/frontleft.json @@ -1,12 +1,12 @@ { "drive": { - "type": "sparkmax", - "id": 20, + "type": "talonfx", + "id": 21, "canbus": null }, "angle": { - "type": "sparkmax", - "id": 21, + "type": "talonfx", + "id": 22, "canbus": null }, "encoder": { diff --git a/src/main/deploy/swerve/modules/frontright.json b/src/main/deploy/swerve/modules/frontright.json index 3c0902f..aa184ba 100755 --- a/src/main/deploy/swerve/modules/frontright.json +++ b/src/main/deploy/swerve/modules/frontright.json @@ -1,12 +1,12 @@ { "drive": { - "type": "sparkmax", - "id": 26, + "type": "talonfx", + "id": 11, "canbus": null }, "angle": { - "type": "sparkmax", - "id": 27, + "type": "talonfx", + "id": 12, "canbus": null }, "encoder": { From 4df3dcd42a426cdaa196945aadc770fa92481d65 Mon Sep 17 00:00:00 2001 From: Alex Sirota Date: Sun, 18 Aug 2024 14:06:26 -0700 Subject: [PATCH 3/5] aligned encoder IDs --- src/main/deploy/swerve/modules/backleft.json | 6 +++--- src/main/deploy/swerve/modules/backright.json | 6 +++--- src/main/deploy/swerve/modules/frontleft.json | 6 +++--- src/main/deploy/swerve/modules/frontright.json | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/deploy/swerve/modules/backleft.json b/src/main/deploy/swerve/modules/backleft.json index 23c0eee..72c5f9b 100755 --- a/src/main/deploy/swerve/modules/backleft.json +++ b/src/main/deploy/swerve/modules/backleft.json @@ -1,17 +1,17 @@ { "drive": { "type": "talonfx", - "id": 31, + "id": 21, "canbus": null }, "angle": { "type": "talonfx", - "id": 32, + "id": 22, "canbus": null }, "encoder": { "type": "ctre_mag", - "id": 1, + "id": 2, "canbus": null }, "inverted": { diff --git a/src/main/deploy/swerve/modules/backright.json b/src/main/deploy/swerve/modules/backright.json index 98aa4a1..c1b9e2a 100755 --- a/src/main/deploy/swerve/modules/backright.json +++ b/src/main/deploy/swerve/modules/backright.json @@ -1,17 +1,17 @@ { "drive": { "type": "talonfx", - "id": 41, + "id": 31, "canbus": null }, "angle": { "type": "talonfx", - "id": 42, + "id": 32, "canbus": null }, "encoder": { "type": "ctre_mag", - "id": 2, + "id": 3, "canbus": null }, "inverted": { diff --git a/src/main/deploy/swerve/modules/frontleft.json b/src/main/deploy/swerve/modules/frontleft.json index 1414ec6..9c2d084 100755 --- a/src/main/deploy/swerve/modules/frontleft.json +++ b/src/main/deploy/swerve/modules/frontleft.json @@ -1,17 +1,17 @@ { "drive": { "type": "talonfx", - "id": 21, + "id": 11, "canbus": null }, "angle": { "type": "talonfx", - "id": 22, + "id": 12, "canbus": null }, "encoder": { "type": "ctre_mag", - "id": 4, + "id": 1, "canbus": null }, "inverted": { diff --git a/src/main/deploy/swerve/modules/frontright.json b/src/main/deploy/swerve/modules/frontright.json index aa184ba..27d1435 100755 --- a/src/main/deploy/swerve/modules/frontright.json +++ b/src/main/deploy/swerve/modules/frontright.json @@ -1,17 +1,17 @@ { "drive": { "type": "talonfx", - "id": 11, + "id": 01, "canbus": null }, "angle": { "type": "talonfx", - "id": 12, + "id": 02, "canbus": null }, "encoder": { "type": "ctre_mag", - "id": 3, + "id": 0, "canbus": null }, "inverted": { From e91a19b19d90f102a585890f68252ce2e27daf62 Mon Sep 17 00:00:00 2001 From: Alex Sirota Date: Sun, 18 Aug 2024 14:33:34 -0700 Subject: [PATCH 4/5] Fix JSON --- src/main/deploy/swerve/modules/frontright.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/deploy/swerve/modules/frontright.json b/src/main/deploy/swerve/modules/frontright.json index 27d1435..a8c400c 100755 --- a/src/main/deploy/swerve/modules/frontright.json +++ b/src/main/deploy/swerve/modules/frontright.json @@ -1,12 +1,12 @@ { "drive": { "type": "talonfx", - "id": 01, + "id": 1, "canbus": null }, "angle": { "type": "talonfx", - "id": 02, + "id": 2, "canbus": null }, "encoder": { From e64a257c716579d9b14997a54f2de591765f5c7c Mon Sep 17 00:00:00 2001 From: Potatocheese123 <155920099+Potatocheese123@users.noreply.github.com> Date: Sun, 22 Sep 2024 11:53:43 -0700 Subject: [PATCH 5/5] Update offsets, ids, inversions --- src/main/deploy/swerve/modules/backleft.json | 2 +- src/main/deploy/swerve/modules/backright.json | 2 +- src/main/deploy/swerve/modules/frontleft.json | 2 +- src/main/deploy/swerve/modules/frontright.json | 2 +- src/main/deploy/swerve/modules/pidfproperties.json | 2 +- src/main/java/frc/robot/Constants.java | 12 ++++++------ src/main/java/frc/robot/RobotContainer.java | 6 +++--- src/main/java/frc/robot/subsystems/ArmSubsystem.java | 10 +++++----- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/deploy/swerve/modules/backleft.json b/src/main/deploy/swerve/modules/backleft.json index 72c5f9b..816f1f5 100755 --- a/src/main/deploy/swerve/modules/backleft.json +++ b/src/main/deploy/swerve/modules/backleft.json @@ -18,7 +18,7 @@ "drive": false, "angle": true }, - "absoluteEncoderOffset": 289.2, + "absoluteEncoderOffset": 214.9, "location": { "front": -12.125, "left": 12.125 diff --git a/src/main/deploy/swerve/modules/backright.json b/src/main/deploy/swerve/modules/backright.json index c1b9e2a..8561da8 100755 --- a/src/main/deploy/swerve/modules/backright.json +++ b/src/main/deploy/swerve/modules/backright.json @@ -18,7 +18,7 @@ "drive": false, "angle": true }, - "absoluteEncoderOffset": 55.05, + "absoluteEncoderOffset": 131.7, "location": { "front": -12.125, "left": -12.125 diff --git a/src/main/deploy/swerve/modules/frontleft.json b/src/main/deploy/swerve/modules/frontleft.json index 9c2d084..b34f787 100755 --- a/src/main/deploy/swerve/modules/frontleft.json +++ b/src/main/deploy/swerve/modules/frontleft.json @@ -18,7 +18,7 @@ "drive": false, "angle": true }, - "absoluteEncoderOffset": 135.5, + "absoluteEncoderOffset": 206.9, "location": { "front": 12.125, "left": 12.125 diff --git a/src/main/deploy/swerve/modules/frontright.json b/src/main/deploy/swerve/modules/frontright.json index a8c400c..1233674 100755 --- a/src/main/deploy/swerve/modules/frontright.json +++ b/src/main/deploy/swerve/modules/frontright.json @@ -18,7 +18,7 @@ "drive": false, "angle": true }, - "absoluteEncoderOffset": 214.91, + "absoluteEncoderOffset": 144.8, "location": { "front": 12.125, "left": -12.125 diff --git a/src/main/deploy/swerve/modules/pidfproperties.json b/src/main/deploy/swerve/modules/pidfproperties.json index e61afbb..208e5ff 100755 --- a/src/main/deploy/swerve/modules/pidfproperties.json +++ b/src/main/deploy/swerve/modules/pidfproperties.json @@ -7,7 +7,7 @@ "iz": 0 }, "angle": { - "p": 6e-3, + "p": 7, "i": 0.00000, "d": 0, "f": 0, diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index f31c3b9..8af907f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -30,12 +30,12 @@ public static class OperatorConstants { public static final String PHOTONCAMERA_NAME = "Arducam_A"; public static final String PHOTONCAMERA_NAME2 = "Arducam_B"; - public static class IDs { - public static final int INTAKE_MOTOR = 2; - public static final int OUTTAKE_TOP_MOTOR = 3; - public static final int OUTTAKE_BOTTOM_MOTOR = 4; - public static final int ANGLE_MOTOR = 31; - public static final int ROLLER_MOTOR = 30; + public final class IDs { + public static final int INTAKE_MOTOR = 41; + public static final int OUTTAKE_TOP_MOTOR = 42; + public static final int OUTTAKE_BOTTOM_MOTOR = 43; + public static final int ANGLE_MOTOR = 62; + public static final int ROLLER_MOTOR = 61; } public static class Speeds { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index d7539f3..4971b2d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -125,9 +125,9 @@ public RobotContainer() { DriveCommand driveCmd = new DriveCommand( swerveSubsystem, - () -> MathUtil.applyDeadband(-driverXbox.getLeftY(), 0.02), // Y axis on joystick is X axis for FRC. Forward is postive-Y, so need to invert sign - () -> MathUtil.applyDeadband(-driverXbox.getLeftX(), 0.02), // X axis on joystick is Y axis for FRC. Left is positive-X, so need to invert sign - () -> MathUtil.applyDeadband(-driverXbox.getRightX(), 0.08), + () -> MathUtil.applyDeadband(driverXbox.getLeftY(), 0.02), // Y axis on joystick is X axis for FRC. Forward is postive-Y, so need to invert sign + () -> MathUtil.applyDeadband(driverXbox.getLeftX(), 0.02), // X axis on joystick is Y axis for FRC. Left is positive-X, so need to invert sign + () -> MathUtil.applyDeadband(driverXbox.getRightX(), 0.08), () -> driverXbox.getHID().getBButton(), () -> angleToSpeaker() ); // Rotation for FRC is CCW-positive, so need to invert sign diff --git a/src/main/java/frc/robot/subsystems/ArmSubsystem.java b/src/main/java/frc/robot/subsystems/ArmSubsystem.java index d55c730..47ba7fd 100644 --- a/src/main/java/frc/robot/subsystems/ArmSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ArmSubsystem.java @@ -44,11 +44,11 @@ public class ArmSubsystem extends SubsystemBase { public double setpoint = 0; private TalonFXConfiguration configs = new TalonFXConfiguration(); - - private final TalonFX motor1 = new TalonFX(11); - private final TalonFX motor2 = new TalonFX(12); - private final TalonFX motor3 = new TalonFX(13); - + + private final TalonFX motor1 = new TalonFX(51); + private final TalonFX motor2 = new TalonFX(52); + private final TalonFX motor3 = new TalonFX(53); + private final TalonSRX sensorTalon = new TalonSRX(14); Orchestra orch = new Orchestra();