From 4234f1935a902baf81269d86f000eec9966d4142 Mon Sep 17 00:00:00 2001 From: moo Date: Sun, 8 Mar 2026 15:12:10 -0700 Subject: [PATCH] 3/8 afternoon, works, runs into alliance wall --- .../deploy/pathplanner/autos/Left Week 2.auto | 8 +- .../pathplanner/paths/Full Left Path.path | 259 ++++++++++++++++++ .../paths/Step 1 Left Near Scoop.path | 106 ------- .../Step 2 Left Return to Alliance Zone.path | 144 ---------- src/main/java/frc/robot/RobotContainer.java | 28 +- .../java/frc/robot/subsystems/hood/Hood.java | 2 +- 6 files changed, 280 insertions(+), 267 deletions(-) create mode 100644 src/main/deploy/pathplanner/paths/Full Left Path.path delete mode 100644 src/main/deploy/pathplanner/paths/Step 1 Left Near Scoop.path delete mode 100644 src/main/deploy/pathplanner/paths/Step 2 Left Return to Alliance Zone.path diff --git a/src/main/deploy/pathplanner/autos/Left Week 2.auto b/src/main/deploy/pathplanner/autos/Left Week 2.auto index 7ffb8ca..e8d1ec3 100644 --- a/src/main/deploy/pathplanner/autos/Left Week 2.auto +++ b/src/main/deploy/pathplanner/autos/Left Week 2.auto @@ -7,13 +7,7 @@ { "type": "path", "data": { - "pathName": "Step 1 Left Near Scoop" - } - }, - { - "type": "path", - "data": { - "pathName": "Step 2 Left Return to Alliance Zone" + "pathName": "Full Left Path" } } ] diff --git a/src/main/deploy/pathplanner/paths/Full Left Path.path b/src/main/deploy/pathplanner/paths/Full Left Path.path new file mode 100644 index 0000000..4a7be08 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Full Left Path.path @@ -0,0 +1,259 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.461245551596047, + "y": 7.623190984573506 + }, + "prevControl": null, + "nextControl": { + "x": 7.743473196617387, + "y": 7.377736791114949 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.280759193351683, + "y": 7.031435349935309 + }, + "prevControl": { + "x": 8.10447288300756, + "y": 7.230962092735046 + }, + "nextControl": { + "x": 8.92423686271917, + "y": 6.303125799507752 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 8.571257413997628, + "y": 4.352396204033215 + }, + "prevControl": { + "x": 8.781602053412554, + "y": 4.613384619419231 + }, + "nextControl": { + "x": 8.168972011382511, + "y": 3.8532542717573026 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.107402135231317, + "y": 4.503024911032028 + }, + "prevControl": { + "x": 6.420187836854095, + "y": 4.0694436094907385 + }, + "nextControl": { + "x": 5.652586346687132, + "y": 5.133487302808302 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 6.236512455516015, + "y": 7.268137603795967 + }, + "prevControl": { + "x": 6.971268132524162, + "y": 6.657769242225851 + }, + "nextControl": { + "x": 5.941353937897051, + "y": 7.513328524315462 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.8784341637010682, + "y": 7.268137603795967 + }, + "prevControl": { + "x": 4.103847815719562, + "y": 7.898024322078127 + }, + "nextControl": { + "x": 0.24137764926754224, + "y": 7.14372768912171 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.4588256227758012, + "y": 5.084021352313167 + }, + "prevControl": { + "x": 0.4411298472046822, + "y": 5.3813118023937445 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.087033747779748, + "rotationDegrees": -90.0 + }, + { + "waypointRelativePos": 2.5364120781527437, + "rotationDegrees": 155.02674741986806 + }, + { + "waypointRelativePos": 3.85, + "rotationDegrees": 138.60721817200425 + }, + { + "waypointRelativePos": 4.4, + "rotationDegrees": 180.0 + }, + { + "waypointRelativePos": 4.660237388724038, + "rotationDegrees": 180.0 + }, + { + "waypointRelativePos": 4.95, + "rotationDegrees": -89.50334218867351 + } + ], + "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": "Stop Hood Down", + "waypointRelativePos": 0.39145106861638246, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + } + }, + { + "name": "Start Spindexer", + "waypointRelativePos": 1.066366704161966, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } + }, + { + "name": "Stop Spindexer", + "waypointRelativePos": 2.2812148481439465, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Spindexer" + } + } + }, + { + "name": "Hood Down", + "waypointRelativePos": 4.1, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Hood Down" + } + } + }, + { + "name": "Stop Hood Down", + "waypointRelativePos": 4.724409448818935, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Stop Hood Down" + } + } + }, + { + "name": "Start Spindexer", + "waypointRelativePos": 4.764904386951711, + "endWaypointRelativePos": null, + "command": { + "type": "named", + "data": { + "name": "Start Spindexer" + } + } + } + ], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 200.0, + "maxAngularAcceleration": 300.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -90.37860096211433 + }, + "reversed": false, + "folder": "week 2 autos", + "idealStartingState": { + "velocity": 0, + "rotation": -0.4275725068334245 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Step 1 Left Near Scoop.path b/src/main/deploy/pathplanner/paths/Step 1 Left Near Scoop.path deleted file mode 100644 index 39411b3..0000000 --- a/src/main/deploy/pathplanner/paths/Step 1 Left Near Scoop.path +++ /dev/null @@ -1,106 +0,0 @@ -{ - "version": "2025.0", - "waypoints": [ - { - "anchor": { - "x": 4.418208778173192, - "y": 7.666227758007118 - }, - "prevControl": null, - "nextControl": { - "x": 5.446060605950143, - "y": 7.836540115984649 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 7.4307829181494665, - "y": 6.471957295373666 - }, - "prevControl": { - "x": 7.383924347134917, - "y": 6.717526581568976 - }, - "nextControl": { - "x": 7.726832024394402, - "y": 4.920468077387175 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 7.431, - "y": 4.578339264531436 - }, - "prevControl": { - "x": 7.352398493947435, - "y": 4.815661415301793 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [ - { - "waypointRelativePos": 1.0, - "rotationDegrees": -90.0 - } - ], - "constraintZones": [], - "pointTowardsZones": [], - "eventMarkers": [ - { - "name": "Hood Down", - "waypointRelativePos": 0, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Extend intake", - "waypointRelativePos": 0, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Spin Intake Rollers", - "waypointRelativePos": 0.2412241224122456, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Stop Hood Down", - "waypointRelativePos": 0.4248424842484219, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Start Spindexer", - "waypointRelativePos": 1.0189018901890188, - "endWaypointRelativePos": null, - "command": null - } - ], - "globalConstraints": { - "maxVelocity": 2.0, - "maxAcceleration": 2.0, - "maxAngularVelocity": 200.0, - "maxAngularAcceleration": 300.0, - "nominalVoltage": 12.0, - "unlimited": false - }, - "goalEndState": { - "velocity": 0, - "rotation": -90.18847227912985 - }, - "reversed": false, - "folder": "week 2 autos", - "idealStartingState": { - "velocity": 0, - "rotation": 0.0 - }, - "useDefaultConstraints": true -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Step 2 Left Return to Alliance Zone.path b/src/main/deploy/pathplanner/paths/Step 2 Left Return to Alliance Zone.path deleted file mode 100644 index 4d45ac3..0000000 --- a/src/main/deploy/pathplanner/paths/Step 2 Left Return to Alliance Zone.path +++ /dev/null @@ -1,144 +0,0 @@ -{ - "version": "2025.0", - "waypoints": [ - { - "anchor": { - "x": 7.431, - "y": 4.578339264531436 - }, - "prevControl": null, - "nextControl": { - "x": 8.448096652146784, - "y": 4.443817359049041 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 8.097852906287072, - "y": 7.268137603795967 - }, - "prevControl": { - "x": 8.388197983214178, - "y": 7.161046321759119 - }, - "nextControl": { - "x": 7.053810025345407, - "y": 7.653223832241156 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 1.8790391459074738, - "y": 7.526358244365362 - }, - "prevControl": { - "x": 1.6365321729512556, - "y": 7.465609844653007 - }, - "nextControl": { - "x": 2.121546118863692, - "y": 7.587106644077717 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 0.8031198102016615, - "y": 7.268137603795967 - }, - "prevControl": { - "x": 0.8752107543682976, - "y": 7.507517836415879 - }, - "nextControl": { - "x": 0.42411399378818265, - "y": 6.009636948184546 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 0.4588256227758012, - "y": 5.084021352313167 - }, - "prevControl": { - "x": 0.4889387492292675, - "y": 5.458299710277916 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [ - { - "waypointRelativePos": 0.28486646884272737, - "rotationDegrees": 76.69826503940088 - }, - { - "waypointRelativePos": 0.9139465875370935, - "rotationDegrees": -179.23505781164891 - }, - { - "waypointRelativePos": 1.7744807121661785, - "rotationDegrees": 180.0 - }, - { - "waypointRelativePos": 2.86053412462906, - "rotationDegrees": -89.5033421886735 - } - ], - "constraintZones": [], - "pointTowardsZones": [], - "eventMarkers": [ - { - "name": "Stop Spindexer", - "waypointRelativePos": 0.0, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Hood Down", - "waypointRelativePos": 1.1917191719171927, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Stop Hood Down", - "waypointRelativePos": 1.5697569756975704, - "endWaypointRelativePos": null, - "command": null - }, - { - "name": "Start Spindexer", - "waypointRelativePos": 1.598559855985599, - "endWaypointRelativePos": null, - "command": null - } - ], - "globalConstraints": { - "maxVelocity": 2.0, - "maxAcceleration": 2.0, - "maxAngularVelocity": 200.0, - "maxAngularAcceleration": 300.0, - "nominalVoltage": 12.0, - "unlimited": false - }, - "goalEndState": { - "velocity": 0, - "rotation": -90.37860096211433 - }, - "reversed": false, - "folder": "week 2 autos", - "idealStartingState": { - "velocity": 0, - "rotation": -90.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 5f50053..39b3d3f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -197,8 +197,14 @@ public class RobotContainer { private boolean seizing; public void registerCommands() { + if (intake != null) { - NamedCommands.registerCommand("Extend Intake", new InstantCommand(() -> intake.extend())); + + NamedCommands.registerCommand("Extend Intake", new InstantCommand(() -> { + intake.extend(); + System.out.println( + "============================================================================================================================extending"); + })); NamedCommands.registerCommand("Retract Intake", new InstantCommand(() -> intake.retract())); NamedCommands.registerCommand("Intermediate Extend", new InstantCommand(() -> intake.intermediateExtend())); NamedCommands.registerCommand("Spin Intake Rollers", new InstantCommand(() -> intake.spinStart())); @@ -213,16 +219,18 @@ public class RobotContainer { })); } - // if (intake != null && spindexer != null){ - // NamedCommands.registerCommand("Spin Intake Rollers", new ParallelCommandGroup( - // new InstantCommand(()->intake.spin(IntakeConstants.SPEED)) - // )); - // NamedCommands.registerCommand("Stop Intake Rollers", new ParallelCommandGroup( - // new InstantCommand(()->intake.spinStop()) - // )); + // if (intake != null && spindexer != null){ + // NamedCommands.registerCommand("Spin Intake Rollers", new + // ParallelCommandGroup( + // new InstantCommand(()->intake.spin(IntakeConstants.SPEED)) + // )); + // NamedCommands.registerCommand("Stop Intake Rollers", new + // ParallelCommandGroup( + // new InstantCommand(()->intake.spinStop()) + // )); // } - if (turret != null && drive != null && hood != null && shooter != null && spindexer != null){ + if (turret != null && drive != null && hood != null && shooter != null && spindexer != null) { Command runSpindexer = new RunSpindexer(spindexer, turret); NamedCommands.registerCommand("Auto shoot", new AutoShootCommand(turret, drive, hood, shooter, spindexer)); NamedCommands.registerCommand("Auto shoot", new AutoShootCommand(turret, drive, hood, shooter, spindexer)); @@ -232,11 +240,13 @@ public class RobotContainer { } if (hood != null) { + NamedCommands.registerCommand("Hood Down", new InstantCommand(() -> { hood.forceHoodDown(true); })); NamedCommands.registerCommand("Stop Hood Down", new InstantCommand(() -> { hood.forceHoodDown(false); + Logger.recordOutput("hello", true); })); } diff --git a/src/main/java/frc/robot/subsystems/hood/Hood.java b/src/main/java/frc/robot/subsystems/hood/Hood.java index 1959139..dbaa397 100644 --- a/src/main/java/frc/robot/subsystems/hood/Hood.java +++ b/src/main/java/frc/robot/subsystems/hood/Hood.java @@ -36,7 +36,7 @@ public class Hood extends SubsystemBase implements HoodIO { private boolean calibrating = false; private Debouncer calibrateDebouncer = new Debouncer(0.5, DebounceType.kRising); - private boolean forceHoodDown = false; + private boolean forceHoodDown = true; private HoodIOInputsAutoLogged inputs = new HoodIOInputsAutoLogged(); -- 2.39.5