From a63db82cb0fa920191e5eb53f00dfffc67d73091 Mon Sep 17 00:00:00 2001 From: WesleyWong-972 Date: Sun, 22 Mar 2026 12:05:35 -0700 Subject: [PATCH] eoijao --- .../pathplanner/autos/Trial Auto Path.auto | 19 ++ .../pathplanner/paths/Trial Left Path.path | 186 ++++++++++++++++++ src/main/java/frc/robot/RobotContainer.java | 2 +- .../robot/commands/gpm/Superstructure.java | 2 + .../frc/robot/constants/FieldConstants.java | 2 +- 5 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/Trial Auto Path.auto create mode 100644 src/main/deploy/pathplanner/paths/Trial Left Path.path diff --git a/src/main/deploy/pathplanner/autos/Trial Auto Path.auto b/src/main/deploy/pathplanner/autos/Trial Auto Path.auto new file mode 100644 index 0000000..c3224d3 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Trial Auto Path.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Trial Left Path" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Trial Left Path.path b/src/main/deploy/pathplanner/paths/Trial Left Path.path new file mode 100644 index 0000000..68eb1fa --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Trial Left Path.path @@ -0,0 +1,186 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.458534768210455, + "y": 7.628667218546397 + }, + "prevControl": null, + "nextControl": { + "x": 7.754544701986754, + "y": 7.432649006622516 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.667425496687276, + "y": 6.677615894043087 + }, + "prevControl": { + "x": 7.671362748581045, + "y": 7.130399861826626 + }, + "nextControl": { + "x": 7.660165562912443, + "y": 5.8427235099371275 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.41332781456807, + "y": 4.405256622519909 + }, + "prevControl": { + "x": 7.485927152316415, + "y": 5.044130794705338 + }, + "nextControl": { + "x": 7.331274667469874, + "y": 3.6831889280557975 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.482185430463577, + "y": 0.3905132450331109 + }, + "prevControl": { + "x": 6.433236754965422, + "y": 0.4631125827848075 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "Hood Down", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Hood Down" + } + } + }, + { + "name": "Extend Intake", + "waypointRelativePos": 0.0944881889763795, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Extend Intake" + } + } + }, + { + "name": "Spin Intake Rollers", + "waypointRelativePos": 0.17547806524185328, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Spin Intake Rollers" + } + } + }, + { + "name": "Start Spindexer", + "waypointRelativePos": 0.3104611923509808, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } + }, + { + "name": "Stop Hood Down", + "waypointRelativePos": 0.39145106861638246, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + } + }, + { + "name": "Stop Spindexer", + "waypointRelativePos": 2.45, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Spindexer" + } + } + }, + { + "name": "Hood Down", + "waypointRelativePos": 2.6, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Hood Down" + } + } + }, + { + "name": "Stop Hood Down", + "waypointRelativePos": 2.9, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + } + }, + { + "name": "Start Spindexer", + "waypointRelativePos": 2.9, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } + } + ], + "globalConstraints": { + "maxVelocity": 2.75, + "maxAcceleration": 2.75, + "maxAngularVelocity": 200.0, + "maxAngularAcceleration": 150.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 180.0 + }, + "reversed": false, + "folder": "week 2 autos", + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ 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 fe64006..b037477 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -255,7 +255,7 @@ public class RobotContainer { */ public void autoChooserInit() { // add the options to the Chooser - String defaultAuto = "Test default auto"; + String defaultAuto = "Trial Auto Path"; String leftSideAuto = "Left Week V1"; String rightSideAuto = "Right Week V1"; String shootOnlyAuto = "Shoot Only Left Week V1"; diff --git a/src/main/java/frc/robot/commands/gpm/Superstructure.java b/src/main/java/frc/robot/commands/gpm/Superstructure.java index bb16908..d1bdf15 100644 --- a/src/main/java/frc/robot/commands/gpm/Superstructure.java +++ b/src/main/java/frc/robot/commands/gpm/Superstructure.java @@ -232,8 +232,10 @@ public class Superstructure extends Command { System.out.println("X: " + x + "Y: " + y); if (FieldConstants.underTrench(x, y)) { hood.forceHoodDown(true); + System.out.println("Hood forced down"); } else { hood.forceHoodDown(false); + System.out.println("Hood forced down"); } shooter.setShooter(-ShotInterpolation.shooterVelocityMap.get(distanceFromTarget)); Logger.recordOutput("Distance From Target", distanceFromTarget); diff --git a/src/main/java/frc/robot/constants/FieldConstants.java b/src/main/java/frc/robot/constants/FieldConstants.java index 5dc7aa1..7adbf88 100644 --- a/src/main/java/frc/robot/constants/FieldConstants.java +++ b/src/main/java/frc/robot/constants/FieldConstants.java @@ -192,7 +192,7 @@ public class FieldConstants { if (y > Units.inchesToMeters(50.0) && y < FIELD_WIDTH - Units.inchesToMeters(50)) { return false; } - if (!(x > Units.inchesToMeters(182.5) && x < Units.inchesToMeters(230.0)) || !(x < Units.inchesToMeters(FIELD_LENGTH - 182.5) && x > Units.inchesToMeters(FIELD_LENGTH - 230.0))) { + if (!(x > Units.inchesToMeters(182.5) && x < Units.inchesToMeters(230.0)) && !(x < Units.inchesToMeters(FIELD_LENGTH - 182.5) && x > Units.inchesToMeters(FIELD_LENGTH - 230.0))) { return false; } return true; -- 2.39.5