From d7fc9cea1d2b0570f7fc1d1edfc65fb49fdef99e Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 5 Apr 2026 22:53:56 -0700 Subject: [PATCH 1/8] add variableWaitCommand --- src/main/java/frc/robot/Constants.java | 1 + src/main/java/frc/robot/RobotContainer.java | 3 +++ .../frc/robot/subsystems/RobotCommandFactory.java | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 6a11e5f1..f73a99b9 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -719,6 +719,7 @@ public static class SensorConstants { // placeholder constants public static class AutoConstants { public static final double AUTO_SHOOT_TIMEOUT = 2.5; // in seconds; TODO: tune public static final double AUTO_SHOOT_CLEANUP_TIMEOUT = 5; + public static final double DEFAULT_WAIT_TIME = 2; // in seconds } public static class TeleopConstants { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index cc9cbe12..1db21888 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -442,6 +442,8 @@ public void logToSmartDashboard() { SmartDashboard.putNumber("robotCommandFactory/angleToHubRadians", Math.toRadians(m_robotCommandFactory.getAngleToHub())); SmartDashboard.putNumber("robotCommandFactory/dashboardTestShooterVelocityRotationsPerSecond", m_robotCommandFactory.getTargetShooterVelocity()); + + SmartDashboard.putNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME); } @@ -569,6 +571,7 @@ private void createNamedCommands() { new EventTrigger("shoot trigger").onTrue(m_robotCommandFactory.autoShootWithVisionCommand().withTimeout(AutoConstants.AUTO_SHOOT_TIMEOUT)); // TODO: tune timeout new EventTrigger("shoot cleanup trigger").onTrue(m_robotCommandFactory.autoShootWithVisionCommand().withTimeout(AutoConstants.AUTO_SHOOT_CLEANUP_TIMEOUT)); + NamedCommands.registerCommand("variable wait command", m_robotCommandFactory.variableWaitCommand(() -> SmartDashboard.getNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME))); NamedCommands.registerCommand("intake command", m_robotCommandFactory.intakeModeCommand()); // DOES NOT END NamedCommands.registerCommand("deploy intake command", diff --git a/src/main/java/frc/robot/subsystems/RobotCommandFactory.java b/src/main/java/frc/robot/subsystems/RobotCommandFactory.java index 180f3887..d2e1d06a 100644 --- a/src/main/java/frc/robot/subsystems/RobotCommandFactory.java +++ b/src/main/java/frc/robot/subsystems/RobotCommandFactory.java @@ -2,6 +2,7 @@ import java.util.Optional; import java.util.function.BooleanSupplier; +import java.util.function.DoubleSupplier; import java.util.function.Supplier; import edu.wpi.first.math.filter.Debouncer.DebounceType; @@ -708,6 +709,20 @@ public Command autoShootWithVisionDynamicCommand() { ).withName("autoShootWithVisionDynamic"); } + /** + * Creates a wait command with a variable duration determined by a DoubleSupplier. + * The duration is evaluated when the command is scheduled. + * + * @param durationSupplier Supplier that provides the wait duration in seconds + * @return Command that waits for the supplied duration + */ + public Command variableWaitCommand(DoubleSupplier durationSupplier) { + return Commands.defer( + () -> new WaitCommand(durationSupplier.getAsDouble()), + java.util.Set.of() + ).withName("variableWaitCommand"); + } + // HELPER FUNCTIONS private Double getPivotVelocityFromDashboard() { return SmartDashboard.getNumber("pivot/dashboardTestVelocityRotationsPerSecond", 1); From e538a5088879ec7d39e1a93e966ce1fa5aa5f128 Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 5 Apr 2026 23:03:10 -0700 Subject: [PATCH 2/8] add outpost flex auto --- .../pathplanner/autos/outpost flex.auto | 37 ++++ .../pathplanner/paths/outpost flex bump.path | 61 +++++++ .../paths/outpost flex pickup.path | 158 ++++++++++++++++++ src/main/java/frc/robot/Constants.java | 2 + src/main/java/frc/robot/RobotContainer.java | 7 +- 5 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 src/main/deploy/pathplanner/autos/outpost flex.auto create mode 100644 src/main/deploy/pathplanner/paths/outpost flex bump.path create mode 100644 src/main/deploy/pathplanner/paths/outpost flex pickup.path diff --git a/src/main/deploy/pathplanner/autos/outpost flex.auto b/src/main/deploy/pathplanner/autos/outpost flex.auto new file mode 100644 index 00000000..08f6350d --- /dev/null +++ b/src/main/deploy/pathplanner/autos/outpost flex.auto @@ -0,0 +1,37 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "outpost flex bump" + } + }, + { + "type": "named", + "data": { + "name": "variable wait command" + } + }, + { + "type": "path", + "data": { + "pathName": "outpost flex pickup" + } + }, + { + "type": "named", + "data": { + "name": "snap to hub flex command" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/outpost flex bump.path b/src/main/deploy/pathplanner/paths/outpost flex bump.path new file mode 100644 index 00000000..47593302 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/outpost flex bump.path @@ -0,0 +1,61 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.679, + "y": 2.618 + }, + "prevControl": null, + "nextControl": { + "x": 4.679, + "y": 2.6180000000000003 + }, + "isLocked": false, + "linkedName": "outpost neutral zone start" + }, + { + "anchor": { + "x": 5.559956958912037, + "y": 2.618 + }, + "prevControl": { + "x": 4.559956958912037, + "y": 2.618 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "outpost flex wait" + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "deploy intake trigger", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/outpost flex pickup.path b/src/main/deploy/pathplanner/paths/outpost flex pickup.path new file mode 100644 index 00000000..f4b9811c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/outpost flex pickup.path @@ -0,0 +1,158 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.559956958912037, + "y": 2.618 + }, + "prevControl": null, + "nextControl": { + "x": 5.909295402082991, + "y": 2.4811622016226815 + }, + "isLocked": false, + "linkedName": "outpost flex wait" + }, + { + "anchor": { + "x": 7.407549551504631, + "y": 2.4922339409722225 + }, + "prevControl": { + "x": 6.930470304294506, + "y": 2.1509418748167835 + }, + "nextControl": { + "x": 7.759287615740742, + "y": 2.7438596643518527 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.952868561921297, + "y": 3.6831963252314814 + }, + "prevControl": { + "x": 7.831937412616808, + "y": 3.6513524541634252 + }, + "nextControl": { + "x": 5.7864445167824075, + "y": 3.7254495081018515 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.88000513599537, + "y": 2.725676215277778 + }, + "prevControl": { + "x": 6.154978877314814, + "y": 2.8671325231481477 + }, + "nextControl": { + "x": 5.61712274927909, + "y": 2.590440131822684 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.262, + "y": 2.618 + }, + "prevControl": { + "x": 3.5033209700115195, + "y": 2.6833007613485447 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "outpost close shooting point" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.0, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 0.5, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 1.342757502913754, + "rotationDegrees": 100.0 + }, + { + "waypointRelativePos": 1.8467548076923106, + "rotationDegrees": -167.6160466084564 + }, + { + "waypointRelativePos": 2.35, + "rotationDegrees": 180.0 + }, + { + "waypointRelativePos": 3.185897435897435, + "rotationDegrees": -179.5935408627037 + }, + { + "waypointRelativePos": 4.0, + "rotationDegrees": 180.0 + } + ], + "constraintZones": [ + { + "name": "come back over the bump", + "minWaypointRelativePos": 3.3041964285714287, + "maxWaypointRelativePos": 3.6382142857142843, + "constraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "intake trigger", + "waypointRelativePos": 0.2, + "endWaypointRelativePos": null, + "command": null + }, + { + "name": "shoot flex trigger", + "waypointRelativePos": 3.84, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 46.24 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index f73a99b9..181120f5 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -719,6 +719,8 @@ public static class SensorConstants { // placeholder constants public static class AutoConstants { public static final double AUTO_SHOOT_TIMEOUT = 2.5; // in seconds; TODO: tune public static final double AUTO_SHOOT_CLEANUP_TIMEOUT = 5; + public static final double AUTO_SHOOT_FLEX_TIMEOUT = 5; + public static final double DEFAULT_WAIT_TIME = 2; // in seconds } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 1db21888..b8c4d57f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -570,8 +570,13 @@ private void createNamedCommands() { new EventTrigger("intake trigger").onTrue(m_robotCommandFactory.autoIntakeModeCommand()); new EventTrigger("shoot trigger").onTrue(m_robotCommandFactory.autoShootWithVisionCommand().withTimeout(AutoConstants.AUTO_SHOOT_TIMEOUT)); // TODO: tune timeout new EventTrigger("shoot cleanup trigger").onTrue(m_robotCommandFactory.autoShootWithVisionCommand().withTimeout(AutoConstants.AUTO_SHOOT_CLEANUP_TIMEOUT)); + new EventTrigger("shoot flex trigger").onTrue(m_robotCommandFactory.autoShootWithVisionCommand().withTimeout(AutoConstants.AUTO_SHOOT_FLEX_TIMEOUT)); - NamedCommands.registerCommand("variable wait command", m_robotCommandFactory.variableWaitCommand(() -> SmartDashboard.getNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME))); + + NamedCommands.registerCommand("variable wait command", + m_robotCommandFactory.variableWaitCommand(() -> SmartDashboard.getNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME))); + NamedCommands.registerCommand("snap to hub flex command", + m_robotCommandFactory.snapToHubCommand(() -> new JoystickVals(0, 0)).withTimeout(AutoConstants.AUTO_SHOOT_FLEX_TIMEOUT)); NamedCommands.registerCommand("intake command", m_robotCommandFactory.intakeModeCommand()); // DOES NOT END NamedCommands.registerCommand("deploy intake command", From 7b398e4bd9d625c1c497de7dd9e2694a62e3a9df Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 5 Apr 2026 23:04:41 -0700 Subject: [PATCH 3/8] edit outpost flex auto a bit --- .../paths/outpost flex pickup.path | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/deploy/pathplanner/paths/outpost flex pickup.path b/src/main/deploy/pathplanner/paths/outpost flex pickup.path index f4b9811c..18872851 100644 --- a/src/main/deploy/pathplanner/paths/outpost flex pickup.path +++ b/src/main/deploy/pathplanner/paths/outpost flex pickup.path @@ -36,28 +36,28 @@ "y": 3.6831963252314814 }, "prevControl": { - "x": 7.831937412616808, - "y": 3.6513524541634252 + "x": 7.832411026228868, + "y": 3.6697378755627974 }, "nextControl": { - "x": 5.7864445167824075, - "y": 3.7254495081018515 + "x": 5.456423538773148, + "y": 3.7060944010416668 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 5.88000513599537, - "y": 2.725676215277778 + "x": 5.559956958912037, + "y": 2.618 }, "prevControl": { - "x": 6.154978877314814, - "y": 2.8671325231481477 + "x": 5.5497217158564816, + "y": 3.405204499421296 }, "nextControl": { - "x": 5.61712274927909, - "y": 2.590440131822684 + "x": 5.563800393852754, + "y": 2.3223969291063193 }, "isLocked": false, "linkedName": null @@ -86,20 +86,20 @@ "rotationDegrees": 0.0 }, { - "waypointRelativePos": 1.342757502913754, + "waypointRelativePos": 1.147690850815852, "rotationDegrees": 100.0 }, { "waypointRelativePos": 1.8467548076923106, - "rotationDegrees": -167.6160466084564 + "rotationDegrees": -167.61604660845643 }, { "waypointRelativePos": 2.35, "rotationDegrees": 180.0 }, { - "waypointRelativePos": 3.185897435897435, - "rotationDegrees": -179.5935408627037 + "waypointRelativePos": 3.0033143939393963, + "rotationDegrees": 180.0 }, { "waypointRelativePos": 4.0, From 665c69afd13b3e224aa4ac8f31217e33ddba8a77 Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 5 Apr 2026 23:06:11 -0700 Subject: [PATCH 4/8] add depot flex auto --- .../deploy/pathplanner/autos/depot flex.auto | 37 ++++ .../pathplanner/paths/depot flex bump.path | 61 +++++++ .../pathplanner/paths/depot flex pickup.path | 158 ++++++++++++++++++ 3 files changed, 256 insertions(+) create mode 100644 src/main/deploy/pathplanner/autos/depot flex.auto create mode 100644 src/main/deploy/pathplanner/paths/depot flex bump.path create mode 100644 src/main/deploy/pathplanner/paths/depot flex pickup.path diff --git a/src/main/deploy/pathplanner/autos/depot flex.auto b/src/main/deploy/pathplanner/autos/depot flex.auto new file mode 100644 index 00000000..8897b00e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/depot flex.auto @@ -0,0 +1,37 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "depot flex bump" + } + }, + { + "type": "named", + "data": { + "name": "variable wait command" + } + }, + { + "type": "path", + "data": { + "pathName": "depot flex pickup" + } + }, + { + "type": "named", + "data": { + "name": "snap to hub flex command" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/depot flex bump.path b/src/main/deploy/pathplanner/paths/depot flex bump.path new file mode 100644 index 00000000..a6ef2f54 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/depot flex bump.path @@ -0,0 +1,61 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.679, + "y": 5.4510000000000005 + }, + "prevControl": null, + "nextControl": { + "x": 4.679, + "y": 5.4510000000000005 + }, + "isLocked": false, + "linkedName": "depot neutral zone start" + }, + { + "anchor": { + "x": 5.559956958912037, + "y": 5.4510000000000005 + }, + "prevControl": { + "x": 4.559956958912037, + "y": 5.4510000000000005 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "depot flex wait" + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "deploy intake trigger", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/depot flex pickup.path b/src/main/deploy/pathplanner/paths/depot flex pickup.path new file mode 100644 index 00000000..f4e3f439 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/depot flex pickup.path @@ -0,0 +1,158 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.559956958912037, + "y": 5.4510000000000005 + }, + "prevControl": null, + "nextControl": { + "x": 5.909295402082991, + "y": 5.587837798377319 + }, + "isLocked": false, + "linkedName": "depot flex wait" + }, + { + "anchor": { + "x": 7.407549551504631, + "y": 5.576766059027778 + }, + "prevControl": { + "x": 6.930470304294506, + "y": 5.918058125183217 + }, + "nextControl": { + "x": 7.759287615740742, + "y": 5.325140335648149 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.952868561921297, + "y": 4.385803674768519 + }, + "prevControl": { + "x": 7.832411026228868, + "y": 4.399262124437204 + }, + "nextControl": { + "x": 5.456423538773148, + "y": 4.362905598958334 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.559956958912037, + "y": 5.4510000000000005 + }, + "prevControl": { + "x": 5.5497217158564816, + "y": 4.663795500578704 + }, + "nextControl": { + "x": 5.563800393852754, + "y": 5.7466030708936815 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.262, + "y": 5.4510000000000005 + }, + "prevControl": { + "x": 3.5033209700115195, + "y": 5.385699238651457 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "depot close shooting point" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.0, + "rotationDegrees": -0.0 + }, + { + "waypointRelativePos": 0.5, + "rotationDegrees": -0.0 + }, + { + "waypointRelativePos": 1.147690850815852, + "rotationDegrees": -100.0 + }, + { + "waypointRelativePos": 1.8467548076923106, + "rotationDegrees": 167.61604660845643 + }, + { + "waypointRelativePos": 2.35, + "rotationDegrees": -180.0 + }, + { + "waypointRelativePos": 3.0033143939393963, + "rotationDegrees": -180.0 + }, + { + "waypointRelativePos": 4.0, + "rotationDegrees": -180.0 + } + ], + "constraintZones": [ + { + "name": "come back over the bump", + "minWaypointRelativePos": 3.3041964285714287, + "maxWaypointRelativePos": 3.6382142857142843, + "constraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "intake trigger", + "waypointRelativePos": 0.2, + "endWaypointRelativePos": null, + "command": null + }, + { + "name": "shoot flex trigger", + "waypointRelativePos": 3.84, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -46.24 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.0, + "rotation": -0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file From de400e596d4b4757a57d41de554dadac454640cd Mon Sep 17 00:00:00 2001 From: zoe Date: Sun, 5 Apr 2026 23:12:30 -0700 Subject: [PATCH 5/8] add center flex auto --- .../pathplanner/autos/depot center flex.auto | 31 +++++ .../autos/outpost center flex.auto | 31 +++++ .../pathplanner/paths/depot flex center.path | 106 ++++++++++++++++++ .../paths/outpost flex center.path | 106 ++++++++++++++++++ 4 files changed, 274 insertions(+) create mode 100644 src/main/deploy/pathplanner/autos/depot center flex.auto create mode 100644 src/main/deploy/pathplanner/autos/outpost center flex.auto create mode 100644 src/main/deploy/pathplanner/paths/depot flex center.path create mode 100644 src/main/deploy/pathplanner/paths/outpost flex center.path diff --git a/src/main/deploy/pathplanner/autos/depot center flex.auto b/src/main/deploy/pathplanner/autos/depot center flex.auto new file mode 100644 index 00000000..0ae61019 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/depot center flex.auto @@ -0,0 +1,31 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "depot flex bump" + } + }, + { + "type": "named", + "data": { + "name": "variable wait command" + } + }, + { + "type": "path", + "data": { + "pathName": "depot flex center" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/outpost center flex.auto b/src/main/deploy/pathplanner/autos/outpost center flex.auto new file mode 100644 index 00000000..009695cd --- /dev/null +++ b/src/main/deploy/pathplanner/autos/outpost center flex.auto @@ -0,0 +1,31 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "outpost flex bump" + } + }, + { + "type": "named", + "data": { + "name": "variable wait command" + } + }, + { + "type": "path", + "data": { + "pathName": "outpost flex center" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/depot flex center.path b/src/main/deploy/pathplanner/paths/depot flex center.path new file mode 100644 index 00000000..f949505f --- /dev/null +++ b/src/main/deploy/pathplanner/paths/depot flex center.path @@ -0,0 +1,106 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.559956958912037, + "y": 5.4510000000000005 + }, + "prevControl": null, + "nextControl": { + "x": 6.559956958912037, + "y": 5.4510000000000005 + }, + "isLocked": false, + "linkedName": "depot flex wait" + }, + { + "anchor": { + "x": 6.452785083912038, + "y": 7.299567418981482 + }, + "prevControl": { + "x": 6.394654152199075, + "y": 6.613609302662038 + }, + "nextControl": { + "x": 6.473895452122505, + "y": 7.548674529185142 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.222563585069445, + "y": 7.299567418981482 + }, + "prevControl": { + "x": 8.241235078153444, + "y": 7.548869194639046 + }, + "nextControl": { + "x": 8.177366818599856, + "y": 6.696100193079516 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.222563585069445, + "y": 4.02743894675926 + }, + "prevControl": { + "x": 8.24040964988426, + "y": 4.71680881076389 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.493687913907287, + "rotationDegrees": -0.0 + }, + { + "waypointRelativePos": 2.342922185430464, + "rotationDegrees": -90.0 + }, + { + "waypointRelativePos": 2.96409354304636, + "rotationDegrees": -90.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "intake trigger", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/outpost flex center.path b/src/main/deploy/pathplanner/paths/outpost flex center.path new file mode 100644 index 00000000..ff509758 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/outpost flex center.path @@ -0,0 +1,106 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 5.559956958912037, + "y": 2.618 + }, + "prevControl": null, + "nextControl": { + "x": 6.559956958912037, + "y": 2.618 + }, + "isLocked": false, + "linkedName": "outpost flex wait" + }, + { + "anchor": { + "x": 6.452785083912038, + "y": 0.7694325810185183 + }, + "prevControl": { + "x": 6.394654152199075, + "y": 1.455390697337963 + }, + "nextControl": { + "x": 6.473895452122505, + "y": 0.5203254708148592 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.222563585069445, + "y": 0.7694325810185183 + }, + "prevControl": { + "x": 8.241235078153444, + "y": 0.5201308053609548 + }, + "nextControl": { + "x": 8.177366818599856, + "y": 1.3728998069204847 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.222563585069445, + "y": 4.04156105324074 + }, + "prevControl": { + "x": 8.24040964988426, + "y": 3.352191189236111 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.493687913907287, + "rotationDegrees": 0.0 + }, + { + "waypointRelativePos": 2.342922185430464, + "rotationDegrees": 90.0 + }, + { + "waypointRelativePos": 2.96409354304636, + "rotationDegrees": 90.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [ + { + "name": "intake trigger", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": null + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file From 305e65806b792192a5531f44c11c7a5c3ada6f5d Mon Sep 17 00:00:00 2001 From: zoe Date: Mon, 6 Apr 2026 08:49:06 -0700 Subject: [PATCH 6/8] edit center auto drive diagonal to push fuel in; point wheels in x after reaching center --- .../pathplanner/autos/outpost center flex.auto | 6 ++++++ .../pathplanner/paths/outpost flex center.path | 16 ++++++++-------- src/main/java/frc/robot/RobotContainer.java | 2 ++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/outpost center flex.auto b/src/main/deploy/pathplanner/autos/outpost center flex.auto index 009695cd..1bc49f8a 100644 --- a/src/main/deploy/pathplanner/autos/outpost center flex.auto +++ b/src/main/deploy/pathplanner/autos/outpost center flex.auto @@ -21,6 +21,12 @@ "data": { "pathName": "outpost flex center" } + }, + { + "type": "named", + "data": { + "name": "pointwheelsinx" + } } ] } diff --git a/src/main/deploy/pathplanner/paths/outpost flex center.path b/src/main/deploy/pathplanner/paths/outpost flex center.path index ff509758..94feb25d 100644 --- a/src/main/deploy/pathplanner/paths/outpost flex center.path +++ b/src/main/deploy/pathplanner/paths/outpost flex center.path @@ -33,15 +33,15 @@ { "anchor": { "x": 8.222563585069445, - "y": 0.7694325810185183 + "y": 1.1843535879629632 }, "prevControl": { - "x": 8.241235078153444, - "y": 0.5201308053609548 + "x": 8.194941550925927, + "y": 0.18444907407407418 }, "nextControl": { - "x": 8.177366818599856, - "y": 1.3728998069204847 + "x": 8.239274483811554, + "y": 1.7892801837581498 }, "isLocked": false, "linkedName": null @@ -67,11 +67,11 @@ }, { "waypointRelativePos": 2.342922185430464, - "rotationDegrees": 90.0 + "rotationDegrees": 110.0 }, { - "waypointRelativePos": 2.96409354304636, - "rotationDegrees": 90.0 + "waypointRelativePos": 2.91, + "rotationDegrees": 110.0 } ], "constraintZones": [], diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index b8c4d57f..079fde7d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -577,6 +577,8 @@ private void createNamedCommands() { m_robotCommandFactory.variableWaitCommand(() -> SmartDashboard.getNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME))); NamedCommands.registerCommand("snap to hub flex command", m_robotCommandFactory.snapToHubCommand(() -> new JoystickVals(0, 0)).withTimeout(AutoConstants.AUTO_SHOOT_FLEX_TIMEOUT)); + NamedCommands.registerCommand("pointwheelsinx", + m_drivetrainCommandFactory.pointWheelsinX()); NamedCommands.registerCommand("intake command", m_robotCommandFactory.intakeModeCommand()); // DOES NOT END NamedCommands.registerCommand("deploy intake command", From d8cbc40de7b6dc041dbd3990cb63cbec91e67b97 Mon Sep 17 00:00:00 2001 From: zoe Date: Mon, 6 Apr 2026 17:46:57 -0700 Subject: [PATCH 7/8] ensure robot turns at end of flex pickup --- mirror-autos.py | 7 ++++++- .../pathplanner/autos/depot center flex.auto | 6 ++++++ .../pathplanner/paths/depot flex center.path | 16 ++++++++-------- .../pathplanner/paths/depot flex pickup.path | 2 +- .../pathplanner/paths/outpost flex pickup.path | 2 +- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/mirror-autos.py b/mirror-autos.py index 8c2b23e9..3bf193e4 100644 --- a/mirror-autos.py +++ b/mirror-autos.py @@ -87,6 +87,9 @@ def main(): outpost_paths = [ "1st outpost shoot", "fast outpost shoot", + "outpost flex pickup", + "outpost flex bump", + "outpost flex center", "2nd outpost cleanup", "2nd outpost shoot", "outpost center half neutral zone" @@ -96,7 +99,9 @@ def main(): outpost_autos = [ "outpost cleanup", "outpost fast", - "outpost shoot" + "outpost shoot", + "outpost flex", + "outpost center flex" ] # Mirror paths diff --git a/src/main/deploy/pathplanner/autos/depot center flex.auto b/src/main/deploy/pathplanner/autos/depot center flex.auto index 0ae61019..36966f79 100644 --- a/src/main/deploy/pathplanner/autos/depot center flex.auto +++ b/src/main/deploy/pathplanner/autos/depot center flex.auto @@ -21,6 +21,12 @@ "data": { "pathName": "depot flex center" } + }, + { + "type": "named", + "data": { + "name": "pointwheelsinx" + } } ] } diff --git a/src/main/deploy/pathplanner/paths/depot flex center.path b/src/main/deploy/pathplanner/paths/depot flex center.path index f949505f..338e3720 100644 --- a/src/main/deploy/pathplanner/paths/depot flex center.path +++ b/src/main/deploy/pathplanner/paths/depot flex center.path @@ -33,15 +33,15 @@ { "anchor": { "x": 8.222563585069445, - "y": 7.299567418981482 + "y": 6.884646412037037 }, "prevControl": { - "x": 8.241235078153444, - "y": 7.548869194639046 + "x": 8.194941550925927, + "y": 7.884550925925927 }, "nextControl": { - "x": 8.177366818599856, - "y": 6.696100193079516 + "x": 8.239274483811554, + "y": 6.279719816241851 }, "isLocked": false, "linkedName": null @@ -67,11 +67,11 @@ }, { "waypointRelativePos": 2.342922185430464, - "rotationDegrees": -90.0 + "rotationDegrees": -110.0 }, { - "waypointRelativePos": 2.96409354304636, - "rotationDegrees": -90.0 + "waypointRelativePos": 2.91, + "rotationDegrees": -110.0 } ], "constraintZones": [], diff --git a/src/main/deploy/pathplanner/paths/depot flex pickup.path b/src/main/deploy/pathplanner/paths/depot flex pickup.path index f4e3f439..e776aa1a 100644 --- a/src/main/deploy/pathplanner/paths/depot flex pickup.path +++ b/src/main/deploy/pathplanner/paths/depot flex pickup.path @@ -102,7 +102,7 @@ "rotationDegrees": -180.0 }, { - "waypointRelativePos": 4.0, + "waypointRelativePos": 3.8491307947019875, "rotationDegrees": -180.0 } ], diff --git a/src/main/deploy/pathplanner/paths/outpost flex pickup.path b/src/main/deploy/pathplanner/paths/outpost flex pickup.path index 18872851..3fa2752f 100644 --- a/src/main/deploy/pathplanner/paths/outpost flex pickup.path +++ b/src/main/deploy/pathplanner/paths/outpost flex pickup.path @@ -102,7 +102,7 @@ "rotationDegrees": 180.0 }, { - "waypointRelativePos": 4.0, + "waypointRelativePos": 3.8491307947019875, "rotationDegrees": 180.0 } ], From 3171fd4457252b2f404f35d4d3b5d985bf541a31 Mon Sep 17 00:00:00 2001 From: zoe Date: Mon, 6 Apr 2026 17:54:51 -0700 Subject: [PATCH 8/8] make waitTime persist across startups --- src/main/java/frc/robot/RobotContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 19aaab13..a6bda7fb 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -461,7 +461,7 @@ public void logToSmartDashboard() { SmartDashboard.putNumber("robotCommandFactory/dashboardTestShooterVelocityRotationsPerSecond", m_robotCommandFactory.getTargetShooterVelocity()); - SmartDashboard.putNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME); + SmartDashboard.putNumber("auton/waitTime", SmartDashboard.getNumber("auton/waitTime", AutoConstants.DEFAULT_WAIT_TIME)); }