From 5496d9177ee9428ee8c75af7183f8cf25e03e158 Mon Sep 17 00:00:00 2001 From: Tyler-J42 Date: Tue, 12 Mar 2024 14:29:29 -0400 Subject: [PATCH] driver control updates + autonomous paths. --- .../deploy/pathplanner/autos/Left Sub 3s.auto | 79 ++++++++++++++++ .../autos/Left Subwoofer Center 2S.auto | 2 +- .../deploy/pathplanner/autos/Right 2 Amp.auto | 50 ---------- .../autos/{Right 1S 2A.auto => Right 2S.auto} | 46 +++++----- .../deploy/pathplanner/autos/Right 3 Amp.auto | 43 --------- ...ub to Center.path => L Sub to Note 1.path} | 4 +- .../pathplanner/paths/L Sub to Note 2.path | 92 +++++++++++++++++++ .../pathplanner/paths/Note 1 to Speaker.path | 8 +- .../pathplanner/paths/Note 3 to Sub.path | 52 +++++++++++ .../pathplanner/paths/Right Sub Note 3.path | 58 ++++++++++++ .../pathplanner/paths/Right Wall to Sub.path | 52 +++++++++++ src/main/java/frc/robot/RobotContainer.java | 16 ++-- 12 files changed, 372 insertions(+), 130 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/Left Sub 3s.auto delete mode 100644 src/main/deploy/pathplanner/autos/Right 2 Amp.auto rename src/main/deploy/pathplanner/autos/{Right 1S 2A.auto => Right 2S.auto} (67%) delete mode 100644 src/main/deploy/pathplanner/autos/Right 3 Amp.auto rename src/main/deploy/pathplanner/paths/{L Sub to Center.path => L Sub to Note 1.path} (95%) create mode 100644 src/main/deploy/pathplanner/paths/L Sub to Note 2.path create mode 100644 src/main/deploy/pathplanner/paths/Note 3 to Sub.path create mode 100644 src/main/deploy/pathplanner/paths/Right Sub Note 3.path create mode 100644 src/main/deploy/pathplanner/paths/Right Wall to Sub.path diff --git a/src/main/deploy/pathplanner/autos/Left Sub 3s.auto b/src/main/deploy/pathplanner/autos/Left Sub 3s.auto new file mode 100644 index 0000000..273e7d0 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Left Sub 3s.auto @@ -0,0 +1,79 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.4936438362905214, + "y": 6.981410202136645 + }, + "rotation": 180.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Left Subwoofer" + } + }, + { + "type": "named", + "data": { + "name": "Charge Shooter" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + }, + { + "type": "path", + "data": { + "pathName": "L Sub to Note 1" + } + }, + { + "type": "path", + "data": { + "pathName": "Note 1 to Speaker" + } + }, + { + "type": "named", + "data": { + "name": "Charge Shooter" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + }, + { + "type": "path", + "data": { + "pathName": "L Sub to Note 2" + } + }, + { + "type": "named", + "data": { + "name": "Charge Shooter" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Left Subwoofer Center 2S.auto b/src/main/deploy/pathplanner/autos/Left Subwoofer Center 2S.auto index 0be3579..f77b1dc 100644 --- a/src/main/deploy/pathplanner/autos/Left Subwoofer Center 2S.auto +++ b/src/main/deploy/pathplanner/autos/Left Subwoofer Center 2S.auto @@ -32,7 +32,7 @@ { "type": "path", "data": { - "pathName": "L Sub to Center" + "pathName": "L Sub to Note 1" } }, { diff --git a/src/main/deploy/pathplanner/autos/Right 2 Amp.auto b/src/main/deploy/pathplanner/autos/Right 2 Amp.auto deleted file mode 100644 index dd7668a..0000000 --- a/src/main/deploy/pathplanner/autos/Right 2 Amp.auto +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": 1.0, - "startingPose": null, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Speaker Note Shot" - } - }, - { - "type": "path", - "data": { - "pathName": "Left Preloaded+Pickup" - } - }, - { - "type": "deadline", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Amp Handoff" - } - }, - { - "type": "path", - "data": { - "pathName": "Note 1 to amp" - } - } - ] - } - }, - { - "type": "named", - "data": { - "name": "Amp Note Shot" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Right 1S 2A.auto b/src/main/deploy/pathplanner/autos/Right 2S.auto similarity index 67% rename from src/main/deploy/pathplanner/autos/Right 1S 2A.auto rename to src/main/deploy/pathplanner/autos/Right 2S.auto index 1f24ce8..51bc935 100644 --- a/src/main/deploy/pathplanner/autos/Right 1S 2A.auto +++ b/src/main/deploy/pathplanner/autos/Right 2S.auto @@ -2,41 +2,47 @@ "version": 1.0, "startingPose": { "position": { - "x": 1.1134340217398382, - "y": 6.525338178881486 + "x": 0.4936438362905214, + "y": 4.092954054853979 }, - "rotation": 42.79740183823424 + "rotation": 180.0 }, "command": { "type": "sequential", "data": { "commands": [ + { + "type": "path", + "data": { + "pathName": "Right Wall to Sub" + } + }, + { + "type": "named", + "data": { + "name": "Charge Shooter" + } + }, { "type": "named", "data": { "name": "Speaker Note Shot" } }, - { - "type": "path", - "data": { - "pathName": "Left Preloaded+Pickup" - } - }, { "type": "parallel", "data": { "commands": [ { - "type": "wait", + "type": "named", "data": { - "waitTime": 2.0 + "name": "Auto Intake" } }, { - "type": "named", + "type": "path", "data": { - "name": "Amp Handoff" + "pathName": "Right Sub Note 3" } } ] @@ -45,25 +51,19 @@ { "type": "path", "data": { - "pathName": "Note 1 to amp" + "pathName": "Note 3 to Sub" } }, { "type": "named", "data": { - "name": "Amp Note Shot" + "name": "Charge Shooter" } }, { - "type": "path", + "type": "named", "data": { - "pathName": "Leftmost Center Note" - } - }, - { - "type": "path", - "data": { - "pathName": "Note 1 to amp" + "name": "Speaker Note Shot" } } ] diff --git a/src/main/deploy/pathplanner/autos/Right 3 Amp.auto b/src/main/deploy/pathplanner/autos/Right 3 Amp.auto deleted file mode 100644 index c9f7bb5..0000000 --- a/src/main/deploy/pathplanner/autos/Right 3 Amp.auto +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 1.1134340217398382, - "y": 6.525338178881486 - }, - "rotation": 33.13560954871888 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "Left Preloaded+Pickup" - } - }, - { - "type": "path", - "data": { - "pathName": "Note 1 to amp" - } - }, - { - "type": "path", - "data": { - "pathName": "Leftmost Center Note" - } - }, - { - "type": "path", - "data": { - "pathName": "Note 1 to amp" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/L Sub to Center.path b/src/main/deploy/pathplanner/paths/L Sub to Note 1.path similarity index 95% rename from src/main/deploy/pathplanner/paths/L Sub to Center.path rename to src/main/deploy/pathplanner/paths/L Sub to Note 1.path index 05fab14..0d2d88a 100644 --- a/src/main/deploy/pathplanner/paths/L Sub to Center.path +++ b/src/main/deploy/pathplanner/paths/L Sub to Note 1.path @@ -3,12 +3,12 @@ "waypoints": [ { "anchor": { - "x": 1.1251281761822782, + "x": 1.0900457128549583, "y": 6.560420642208806 }, "prevControl": null, "nextControl": { - "x": 1.569506044994996, + "x": 1.5344235816676761, "y": 7.098351746561042 }, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/L Sub to Note 2.path b/src/main/deploy/pathplanner/paths/L Sub to Note 2.path new file mode 100644 index 0000000..ef033f2 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/L Sub to Note 2.path @@ -0,0 +1,92 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.0900457128549583, + "y": 6.548726487766366 + }, + "prevControl": null, + "nextControl": { + "x": 1.4993411183403562, + "y": 6.490255715554167 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.247767002656512, + "y": 5.87046553010485 + }, + "prevControl": { + "x": 1.8852482149408738, + "y": 6.256372626705368 + }, + "nextControl": { + "x": 2.61028579037215, + "y": 5.484558433504332 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.0900457128549583, + "y": 6.548726487766366 + }, + "prevControl": { + "x": 2.095742994904793, + "y": 6.805997885500045 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.1, + "rotationDegrees": 157.35591349901955, + "rotateFast": true + } + ], + "constraintZones": [], + "eventMarkers": [ + { + "name": "New Event Marker", + "waypointRelativePos": 0.1, + "command": { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Auto Intake" + } + } + ] + } + } + } + ], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -153.43494882292208, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": -148.523160650416, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Note 1 to Speaker.path b/src/main/deploy/pathplanner/paths/Note 1 to Speaker.path index 0fc3f94..a6227f0 100644 --- a/src/main/deploy/pathplanner/paths/Note 1 to Speaker.path +++ b/src/main/deploy/pathplanner/paths/Note 1 to Speaker.path @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 1.2654580294915574, - "y": 6.291455090032687 + "x": 1.136822330624718, + "y": 6.478561561111727 }, "prevControl": { - "x": 1.7098358983042754, - "y": 6.525338178881486 + "x": 1.581200199437436, + "y": 6.712444649960526 }, "nextControl": null, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/Note 3 to Sub.path b/src/main/deploy/pathplanner/paths/Note 3 to Sub.path new file mode 100644 index 0000000..cb7d52d --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Note 3 to Sub.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.2360728482140724, + "y": 4.139730672623739 + }, + "prevControl": null, + "nextControl": { + "x": 1.8501657516135543, + "y": 3.940930047102261 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.9380217051032389, + "y": 4.4671669970120575 + }, + "prevControl": { + "x": 1.6162826627647555, + "y": 3.730435267138341 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 132.43622978853497, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": -1.5911402711946612, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Right Sub Note 3.path b/src/main/deploy/pathplanner/paths/Right Sub Note 3.path new file mode 100644 index 0000000..e3f0585 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Right Sub Note 3.path @@ -0,0 +1,58 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.0666574039700785, + "y": 4.373613761472538 + }, + "prevControl": null, + "nextControl": { + "x": 1.5344235816676757, + "y": 4.338531298145218 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.282849465983832, + "y": 4.139730672623739 + }, + "prevControl": { + "x": 1.7210430076110608, + "y": 4.139730672623739 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.0, + "rotationDegrees": 180.0, + "rotateFast": true + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 180.0, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 131.18592516570968, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Right Wall to Sub.path b/src/main/deploy/pathplanner/paths/Right Wall to Sub.path new file mode 100644 index 0000000..86b5fd6 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Right Wall to Sub.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.4936438362905214, + "y": 4.092954054853979 + }, + "prevControl": null, + "nextControl": { + "x": 1.359011265031077, + "y": 4.034483282641779 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.0198807862003185, + "y": 4.502249460339376 + }, + "prevControl": { + "x": 1.0315749406427583, + "y": 4.116342363738859 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 141.34019174590983, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 180.0, + "velocity": 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 224b227..df9dcf1 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -194,13 +194,13 @@ public class RobotContainer { ) ); - driver.leftTrigger().onTrue( + driver.leftTrigger().onTrue(Commands.parallel( new InstantCommand( () -> { intakeDown = true; } - ) - ); + ), indexer.advanceNote() + )); shooter.setDefaultCommand( shooter.angleSpeedsSetpoints( @@ -214,8 +214,10 @@ public class RobotContainer { () -> { if(driver.getRightTriggerAxis() > 0.25){ return 1.0; - } else { - return 0; + } else if(operator.getRightTriggerAxis() > 0.25){ + return -1.0; + }else{ + return 0.0; } } ) @@ -240,7 +242,7 @@ public class RobotContainer { indexer.setDefaultCommand(indexer.shootNote( () -> { - if (driver.getLeftTriggerAxis() > .25) { + if (driver.getRightTriggerAxis() > .25) { return -1.0; }else { return 0.0; @@ -354,7 +356,7 @@ public class RobotContainer { //operator.povDown().whileTrue(intake.intakeDownCommand()); //operator.povUp().whileTrue(intake.intakeUpCommand()); - driver.leftTrigger().whileTrue(Commands.parallel( intake.manualPivot(() -> 0.0, () -> 1.0), indexer.advanceNote())); + //driver.leftTrigger().whileTrue(Commands.parallel( intake.manualPivot(() -> 0.0, () -> 1.0), indexer.advanceNote())); }