From 1f21f17596ab6524a0d1a9ade69e02202be1c482 Mon Sep 17 00:00:00 2001 From: maxwtan <100314265+MaxwellTTan20@users.noreply.github.com> Date: Sat, 28 Feb 2026 16:51:05 -0800 Subject: [PATCH] a --- .../autos/Right(2) - Under Trench.auto | 44 +++++ .../paths/#1 Left under the trench.path | 17 +- .../paths/#1(2) Right - Under the trench.path | 16 +- .../paths/#2(2) Right - Under the trench.path | 60 ++++++- .../paths/#3 Right - Under the trench.path | 18 ++- .../paths/Duplicated Not Working.path | 150 ++++++++++++++++++ src/main/java/frc/robot/RobotContainer.java | 5 +- .../frc/robot/constants/FieldConstants.java | 12 +- .../spindexer/SpindexerConstants.java | 2 +- 9 files changed, 283 insertions(+), 41 deletions(-) create mode 100644 src/main/deploy/pathplanner/paths/Duplicated Not Working.path diff --git a/src/main/deploy/pathplanner/autos/Right(2) - Under Trench.auto b/src/main/deploy/pathplanner/autos/Right(2) - Under Trench.auto index e8d7a5a..8fd6d66 100644 --- a/src/main/deploy/pathplanner/autos/Right(2) - Under Trench.auto +++ b/src/main/deploy/pathplanner/autos/Right(2) - Under Trench.auto @@ -16,11 +16,55 @@ "pathName": "#2(2) Right - Under the trench" } }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 10.0 + } + }, + { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } + ] + } + }, { "type": "path", "data": { "pathName": "#3 Right - Under the trench" } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 10.0 + } + }, + { + "type": "named", + "data": { + "name": "Start Spindexer" + } + }, + { + "type": "named", + "data": { + "name": "Start Intake Seizure" + } + } + ] + } } ] } diff --git a/src/main/deploy/pathplanner/paths/#1 Left under the trench.path b/src/main/deploy/pathplanner/paths/#1 Left under the trench.path index fa5e4eb..62211f8 100644 --- a/src/main/deploy/pathplanner/paths/#1 Left under the trench.path +++ b/src/main/deploy/pathplanner/paths/#1 Left under the trench.path @@ -69,29 +69,16 @@ "constraintZones": [ { "name": "Constraints Zone", - "minWaypointRelativePos": 1.95, + "minWaypointRelativePos": 1.5658042744656906, "maxWaypointRelativePos": 2.759480519480524, "constraints": { - "maxVelocity": 3.0, + "maxVelocity": 2.0, "maxAcceleration": 3.0, "maxAngularVelocity": 540.0, "maxAngularAcceleration": 720.0, "nominalVoltage": 12.0, "unlimited": false } - }, - { - "name": "Constraints Zone", - "minWaypointRelativePos": 0, - "maxWaypointRelativePos": 2.0652418447694045, - "constraints": { - "maxVelocity": 6.0, - "maxAcceleration": 7.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, - "unlimited": false - } } ], "pointTowardsZones": [], diff --git a/src/main/deploy/pathplanner/paths/#1(2) Right - Under the trench.path b/src/main/deploy/pathplanner/paths/#1(2) Right - Under the trench.path index d1bb09c..bcf06eb 100644 --- a/src/main/deploy/pathplanner/paths/#1(2) Right - Under the trench.path +++ b/src/main/deploy/pathplanner/paths/#1(2) Right - Under the trench.path @@ -9,23 +9,23 @@ "prevControl": null, "nextControl": { "x": 6.580806642941875, - "y": 0.823380782918149 + "y": 0.6081969157769855 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 7.301672597864768, - "y": 0.823380782918149 + "x": 7.473819691577701, + "y": 0.7050296559905087 }, "prevControl": { - "x": 6.72798848994848, - "y": 0.776996631189148 + "x": 6.900135583661412, + "y": 0.6586455042615077 }, "nextControl": { - "x": 7.911232317280483, - "y": 0.8726655898756941 + "x": 8.083379410993413, + "y": 0.7543144629480538 }, "isLocked": false, "linkedName": null @@ -76,7 +76,7 @@ "minWaypointRelativePos": 1.55, "maxWaypointRelativePos": 2.6989130434782616, "constraints": { - "maxVelocity": 3.0, + "maxVelocity": 2.0, "maxAcceleration": 3.0, "maxAngularVelocity": 540.0, "maxAngularAcceleration": 720.0, diff --git a/src/main/deploy/pathplanner/paths/#2(2) Right - Under the trench.path b/src/main/deploy/pathplanner/paths/#2(2) Right - Under the trench.path index 2e7f080..5e42a30 100644 --- a/src/main/deploy/pathplanner/paths/#2(2) Right - Under the trench.path +++ b/src/main/deploy/pathplanner/paths/#2(2) Right - Under the trench.path @@ -20,23 +20,23 @@ "y": 0.5865314569536417 }, "prevControl": { - "x": 6.035164509263001, - "y": 0.617600951415989 + "x": 6.83902728351127, + "y": 0.5974377224199281 }, "nextControl": { - "x": 3.0682440376782023, - "y": 0.24599719472861176 + "x": 3.157328753736785, + "y": 0.5592661840649349 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 0.6398096026490065, + "x": 0.62, "y": 0.65 }, "prevControl": { - "x": 1.0581491579606932, + "x": 1.0383395553116865, "y": 0.7153598580391806 }, "nextControl": null, @@ -63,6 +63,19 @@ "nominalVoltage": 12.0, "unlimited": false } + }, + { + "name": "Constraints Zone", + "minWaypointRelativePos": 1.4128233970753654, + "maxWaypointRelativePos": 2.0, + "constraints": { + "maxVelocity": 1.5, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } } ], "pointTowardsZones": [], @@ -90,6 +103,41 @@ ] } } + }, + { + "name": "Extend Intake", + "waypointRelativePos": 1.2508436445444353, + "endWaypointRelativePos": null, + "command": { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + }, + { + "type": "named", + "data": { + "name": "Extend Intake" + } + } + ] + } + } + }, + { + "name": "Start Spindexer", + "waypointRelativePos": 1.277840269966252, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } } ], "globalConstraints": { diff --git a/src/main/deploy/pathplanner/paths/#3 Right - Under the trench.path b/src/main/deploy/pathplanner/paths/#3 Right - Under the trench.path index f8ec91e..6e453ea 100644 --- a/src/main/deploy/pathplanner/paths/#3 Right - Under the trench.path +++ b/src/main/deploy/pathplanner/paths/#3 Right - Under the trench.path @@ -3,12 +3,12 @@ "waypoints": [ { "anchor": { - "x": 0.64, + "x": 0.62, "y": 0.65 }, "prevControl": null, "nextControl": { - "x": 1.5400413907284771, + "x": 1.520041390728477, "y": 1.4359437086129003 }, "isLocked": false, @@ -31,7 +31,19 @@ "rotationTargets": [], "constraintZones": [], "pointTowardsZones": [], - "eventMarkers": [], + "eventMarkers": [ + { + "name": "Stop Spindexer", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Spindexer" + } + } + } + ], "globalConstraints": { "maxVelocity": 3.0, "maxAcceleration": 3.0, diff --git a/src/main/deploy/pathplanner/paths/Duplicated Not Working.path b/src/main/deploy/pathplanner/paths/Duplicated Not Working.path new file mode 100644 index 0000000..0ebfc62 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Duplicated Not Working.path @@ -0,0 +1,150 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 7.842, + "y": 4.478 + }, + "prevControl": null, + "nextControl": { + "x": 8.592775800711744, + "y": 7.429525504151838 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.730830367740831, + "y": 8.67 + }, + "prevControl": { + "x": 7.0789534313387525, + "y": 8.67 + }, + "nextControl": { + "x": 3.9343350188895077, + "y": 8.67 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.5353499406880196, + "y": 7.526358244365362 + }, + "prevControl": { + "x": 2.9979952550415194, + "y": 8.591518386714121 + }, + "nextControl": { + "x": 2.3695164161432727, + "y": 7.1445554785530385 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.18, + "y": 5.966 + }, + "prevControl": { + "x": 2.224810422787547, + "y": 6.241444208960923 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.21847246891652505, + "rotationDegrees": 40.0 + }, + { + "waypointRelativePos": 0.4476021314387213, + "rotationDegrees": 150.0 + }, + { + "waypointRelativePos": 0.927175843694493, + "rotationDegrees": -179.587 + }, + { + "waypointRelativePos": 1.4422735346358764, + "rotationDegrees": 180.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "Retract Intake", + "waypointRelativePos": 0.65466816647919, + "endWaypointRelativePos": null, + "command": { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Retract Intake" + } + }, + { + "type": "named", + "data": { + "name": "Stop Intake Rollers" + } + } + ] + } + } + }, + { + "name": "Hood Down", + "waypointRelativePos": 0.9111361079864995, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Hood Down" + } + } + }, + { + "name": "Stop Hood Down", + "waypointRelativePos": 1.7885264341957245, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + } + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "Left Autos", + "idealStartingState": { + "velocity": 0.0, + "rotation": -110.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 926877b..e7b1d9a 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -142,8 +142,9 @@ public class RobotContainer { // Load the auto command try { String leftSideAuto = "Left(No SOTM) - Under Trench"; - PathPlannerAuto.getPathGroupFromAutoFile(leftSideAuto); - auto = new PathPlannerAuto(leftSideAuto); + String rightSideAuto = "Right(2) - Under Trench"; + PathPlannerAuto.getPathGroupFromAutoFile(rightSideAuto); + auto = new PathPlannerAuto(rightSideAuto); } catch (IOException | ParseException e) { e.printStackTrace(); } diff --git a/src/main/java/frc/robot/constants/FieldConstants.java b/src/main/java/frc/robot/constants/FieldConstants.java index 7b95715..4ee974c 100644 --- a/src/main/java/frc/robot/constants/FieldConstants.java +++ b/src/main/java/frc/robot/constants/FieldConstants.java @@ -22,8 +22,8 @@ public class FieldConstants { public static final double RED_BORDER = FIELD_LENGTH/2 + Units.inchesToMeters(167.0); public static final double BLUE_BORDER = FIELD_LENGTH/2 - Units.inchesToMeters(167.0); - public static final double LEFT_SIDE_TARGET = FIELD_WIDTH * 0.10; - public static final double RIGHT_SIDE_TARGET = FIELD_WIDTH * 0.90; + public static final double LEFT_SIDE_TARGET = FIELD_WIDTH * 0.12; + public static final double RIGHT_SIDE_TARGET = FIELD_WIDTH * 0.88; /**The coordinate of the climb position */ public static final Pose2d BLUE_CLIMB_LOCATION = new Pose2d(1.5, FIELD_WIDTH/2 - 2.0, new Rotation2d()); // TODO: find this @@ -52,17 +52,17 @@ public class FieldConstants { new Translation3d(FIELD_LENGTH/2, RIGHT_SIDE_TARGET, 0); public static final Translation3d ALLIANCE_LEFT_BLUE = - new Translation3d(BLUE_BORDER - 2, LEFT_SIDE_TARGET, 0); // previous hub + a few feet further back + new Translation3d(BLUE_BORDER - 2.2, LEFT_SIDE_TARGET, 0); // previous hub + a few feet further back public static final Translation3d ALLIANCE_RIGHT_BLUE = - new Translation3d(BLUE_BORDER - 2, RIGHT_SIDE_TARGET, 0); + new Translation3d(BLUE_BORDER - 2.2, RIGHT_SIDE_TARGET, 0); public static final Translation3d ALLIANCE_LEFT_RED = - new Translation3d(RED_BORDER + 2, LEFT_SIDE_TARGET, 0); // previous hub + a few feet further back + new Translation3d(RED_BORDER + 2.2, LEFT_SIDE_TARGET, 0); // previous hub + a few feet further back public static final Translation3d ALLIANCE_RIGHT_RED = - new Translation3d(RED_BORDER + 2, RIGHT_SIDE_TARGET, 0); + new Translation3d(RED_BORDER + 2.2, RIGHT_SIDE_TARGET, 0); public static final Translation3d ALLIANCE_CENTER_BLUE = new Translation3d(BLUE_BORDER - 2, FIELD_WIDTH/2, 0); diff --git a/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java b/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java index cdd4a69..64b098f 100644 --- a/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java +++ b/src/main/java/frc/robot/subsystems/spindexer/SpindexerConstants.java @@ -3,7 +3,7 @@ package frc.robot.subsystems.spindexer; public class SpindexerConstants { public static final double spindexerVelocityWithBall = 6.0; // rps (for counting balls) public static final double currentLimit = 40; //A - public static final double spindexerMaxPower = 0.5; + public static final double spindexerMaxPower = 0.75; public static final double spindexerReversePower = -0.2; public static final double CURRENT_SPIKE_LIMIT = 80; public static final double CURRENT_TIME_LIMIT = 1.0; //s -- 2.39.5