From 1bb098eb04dc97a69698c169243bfdf38f69f305 Mon Sep 17 00:00:00 2001 From: Shikhar Date: Fri, 10 Apr 2026 15:29:55 -0600 Subject: [PATCH] Sierra Auto --- .../X. LeftTrench-Neutral-Trench-Shoot.auto | 6 + ...tral-Trench-Shoot-PlayerStation-Shoot.auto | 6 + .../deploy/pathplanner/autos/X. Sierra.auto | 99 +++++++++++ .../deploy/pathplanner/paths/SierraOne.path | 163 ++++++++++++++++++ .../deploy/pathplanner/paths/SierraTwo.path | 95 ++++++++++ .../java/frc4388/robot/RobotContainer.java | 8 +- .../robot/constants/BuildConstants.java | 10 +- 7 files changed, 380 insertions(+), 7 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/X. Sierra.auto create mode 100644 src/main/deploy/pathplanner/paths/SierraOne.path create mode 100644 src/main/deploy/pathplanner/paths/SierraTwo.path diff --git a/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Trench-Shoot.auto b/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Trench-Shoot.auto index fae9ba2..77820b1 100644 --- a/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Trench-Shoot.auto +++ b/src/main/deploy/pathplanner/autos/X. LeftTrench-Neutral-Trench-Shoot.auto @@ -4,6 +4,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Zero Encoder" + } + }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Trench-Shoot-PlayerStation-Shoot.auto b/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Trench-Shoot-PlayerStation-Shoot.auto index 43ba410..d993021 100644 --- a/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Trench-Shoot-PlayerStation-Shoot.auto +++ b/src/main/deploy/pathplanner/autos/X. RightTrench-Neutral-Trench-Shoot-PlayerStation-Shoot.auto @@ -4,6 +4,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Zero Encoder" + } + }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/autos/X. Sierra.auto b/src/main/deploy/pathplanner/autos/X. Sierra.auto new file mode 100644 index 0000000..fe0ddb4 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/X. Sierra.auto @@ -0,0 +1,99 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Zero Encoder" + } + }, + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "named", + "data": { + "name": "Intake Reference" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "SierraOne" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + }, + { + "type": "named", + "data": { + "name": "Labubu Growl" + } + } + ] + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "path", + "data": { + "pathName": "SierraTwo" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + }, + { + "type": "path", + "data": { + "pathName": "PlayerStation-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/SierraOne.path b/src/main/deploy/pathplanner/paths/SierraOne.path new file mode 100644 index 0000000..b059bc2 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/SierraOne.path @@ -0,0 +1,163 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6070897435897447, + "y": 0.6046794871794885 + }, + "prevControl": null, + "nextControl": { + "x": 4.115752584653353, + "y": 0.5635297641960387 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.470976190476191, + "y": 0.9884102564102579 + }, + "prevControl": { + "x": 7.2683607377306005, + "y": 0.7987129676949314 + }, + "nextControl": { + "x": 7.845328732990856, + "y": 1.3388951842695742 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.595564102564104, + "y": 3.3979404761904766 + }, + "prevControl": { + "x": 7.578725039048031, + "y": 3.6473727233837807 + }, + "nextControl": { + "x": 7.645039325071269, + "y": 2.665078110146699 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.3306071428571435, + "y": 0.9884102564102579 + }, + "prevControl": { + "x": 7.602572796768329, + "y": 1.2858726903756175 + }, + "nextControl": { + "x": 6.958504578754579, + "y": 0.5814230769230777 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.712, + "y": 0.6046794871794885 + }, + "prevControl": { + "x": 3.997989714851531, + "y": 0.6083696770485412 + }, + "nextControl": { + "x": 3.4545183150183143, + "y": 0.6013571428571436 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.472, + "y": 0.6046794871794885 + }, + "prevControl": { + "x": 2.721109806922687, + "y": 0.6257580093037158 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 1.255583126550872, + "maxWaypointRelativePos": 1.7617866004962806, + "constraints": { + "maxVelocity": 1.2, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 7.0, + "y": 8.0 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 1.3067552602436252, + "maxWaypointRelativePos": 2.015503875969026, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.0, + "y": 0.6 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.6910299003322272, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.0, + "y": 0.7 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 2.5913621262458837, + "maxWaypointRelativePos": 5.0, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": true + }, + "goalEndState": { + "velocity": 3.0, + "rotation": 0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.0, + "rotation": 0.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/SierraTwo.path b/src/main/deploy/pathplanner/paths/SierraTwo.path new file mode 100644 index 0000000..a81aa9c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/SierraTwo.path @@ -0,0 +1,95 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.472, + "y": 0.605 + }, + "prevControl": null, + "nextControl": { + "x": 2.2708330107691865, + "y": 0.7534312717853275 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.5754761904761914, + "y": 1.0 + }, + "prevControl": { + "x": 2.2272563574654534, + "y": 0.9727386663284083 + }, + "nextControl": { + "x": 0.9236960234869294, + "y": 1.0272613336715914 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.325, + "y": 0.95 + }, + "prevControl": { + "x": 0.5747421350529089, + "y": 0.9386480847776856 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 0, + "maxWaypointRelativePos": 0.0, + "constraints": { + "maxVelocity": 1.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 10.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 0.0, + "y": 0.7 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.6, + "maxWaypointRelativePos": 1.0956834532374118, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0.0, + "rotation": -95.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 3.0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 169f51b..a04c1f8 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -145,6 +145,9 @@ public class RobotContainer { private Command WaitIntakeReference = new WaitUntilCommand(m_robotIntake::intakeAtReference); + private Command ZeroEncoder = + new InstantCommand(() -> m_robotIntake.io.fixEncoder(), m_robotIntake); + private Command RobotShootDriving = new SequentialCommandGroup( new RunCommand(() -> m_robotSwerveDrive.enableRotationOverride(FieldPositions.HUB_POSITION, ShooterConstants.AIM_LEAD_TIME.get(), FieldPositions.HUB_POSITION) @@ -163,9 +166,9 @@ public class RobotContainer { new WaitUntilCommand(m_robotShooter::isShooterUpToSpeed), new InstantCommand(() -> m_robotIntake.setMode(IntakeMode.Idle), m_robotIntake), new InstantCommand(()-> m_robotShooter.allowShooting(), m_robotShooter), - new WaitCommand(2.75), + new WaitCommand(3.5), IntakeRetracted, - new WaitCommand(4.4), + new WaitCommand(5), new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter), new InstantCommand(()-> m_robotShooter.spinUpIdle(), m_robotShooter) ); @@ -191,6 +194,7 @@ public class RobotContainer { }, true); NamedCommands.registerCommand("Robot Rev Up", RobotRev); + NamedCommands.registerCommand("Zero Encoder", ZeroEncoder); NamedCommands.registerCommand("Intake Retracted", IntakeRetracted); NamedCommands.registerCommand("Robot Shoot", RobotShoot); // NamedCommands.registerCommand("Lidar Intake", LidarIntake); diff --git a/src/main/java/frc4388/robot/constants/BuildConstants.java b/src/main/java/frc4388/robot/constants/BuildConstants.java index 1a330bb..07903b8 100644 --- a/src/main/java/frc4388/robot/constants/BuildConstants.java +++ b/src/main/java/frc4388/robot/constants/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "2026KPopRobotHunters"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 238; - public static final String GIT_SHA = "e175ca49a34bea824ae7598a8cc54e22f060c4c2"; - public static final String GIT_DATE = "2026-04-10 13:20:37 MDT"; + public static final int GIT_REVISION = 239; + public static final String GIT_SHA = "4d732970da558d90c4be1787635dc5786674bd27"; + public static final String GIT_DATE = "2026-04-10 13:59:21 MDT"; public static final String GIT_BRANCH = "Encoder-Fix"; - public static final String BUILD_DATE = "2026-04-10 13:43:28 MDT"; - public static final long BUILD_UNIX_TIME = 1775850208266L; + public static final String BUILD_DATE = "2026-04-10 14:33:17 MDT"; + public static final long BUILD_UNIX_TIME = 1775853197175L; public static final int DIRTY = 1; private BuildConstants(){}