From 24f959571a92b3085ff0162fe855483f4ff0bb21 Mon Sep 17 00:00:00 2001 From: Jonah Snider Date: Sat, 9 Nov 2024 15:04:43 -0800 Subject: [PATCH] Add source not race auto --- .../autos/Blue Source Side Not Race NM.auto | 62 ++++++++++++++++ .../autos/Red Source Side Not Race NM.auto | 62 ++++++++++++++++ .../paths/Blue Source Side Not Race 1.path | 70 +++++++++++++++++++ .../paths/Red Source Side Not Race 1.path | 70 +++++++++++++++++++ .../java/frc/robot/autos/AutoCommands.java | 28 ++++++++ .../java/frc/robot/autos/AutoSelection.java | 1 + src/main/java/frc/robot/autos/Autos.java | 2 + 7 files changed, 295 insertions(+) create mode 100644 src/main/deploy/pathplanner/autos/Blue Source Side Not Race NM.auto create mode 100644 src/main/deploy/pathplanner/autos/Red Source Side Not Race NM.auto create mode 100644 src/main/deploy/pathplanner/paths/Blue Source Side Not Race 1.path create mode 100644 src/main/deploy/pathplanner/paths/Red Source Side Not Race 1.path diff --git a/src/main/deploy/pathplanner/autos/Blue Source Side Not Race NM.auto b/src/main/deploy/pathplanner/autos/Blue Source Side Not Race NM.auto new file mode 100644 index 00000000..c9151f8c --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Blue Source Side Not Race NM.auto @@ -0,0 +1,62 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.3957166440680921, + "y": 4.1 + }, + "rotation": 180.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "preloadNote" + } + }, + { + "type": "named", + "data": { + "name": "homeClimber" + } + }, + { + "type": "named", + "data": { + "name": "resetNoteMap" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Blue Source Side Not Race 1" + } + }, + { + "type": "named", + "data": { + "name": "speakerShot" + } + }, + { + "type": "named", + "data": { + "name": "blueSourceSideNotRaceNM" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Red Source Side Not Race NM.auto b/src/main/deploy/pathplanner/autos/Red Source Side Not Race NM.auto new file mode 100644 index 00000000..712a222f --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Red Source Side Not Race NM.auto @@ -0,0 +1,62 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 15.144283355931908, + "y": 4.1 + }, + "rotation": 0.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "preloadNote" + } + }, + { + "type": "named", + "data": { + "name": "homeClimber" + } + }, + { + "type": "named", + "data": { + "name": "resetNoteMap" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Red Source Side Not Race 1" + } + }, + { + "type": "named", + "data": { + "name": "speakerShot" + } + }, + { + "type": "named", + "data": { + "name": "redSourceSideNotRaceNM" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Blue Source Side Not Race 1.path b/src/main/deploy/pathplanner/paths/Blue Source Side Not Race 1.path new file mode 100644 index 00000000..706c6774 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Blue Source Side Not Race 1.path @@ -0,0 +1,70 @@ +{ + "version": 1, + "waypoints": [ + { + "anchor": { + "x": 1.3957166440680921, + "y": 4.1 + }, + "prevControl": null, + "nextControl": { + "x": 1.7185359983465065, + "y": 3.39495238579938 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.9223584297352416, + "y": 3.15475799992654 + }, + "prevControl": { + "x": 2.369281856363958, + "y": 3.169010510049207 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [ + { + "name": "speaker warmup", + "waypointRelativePos": 0.5, + "command": { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "waitingSpeakerShot" + } + } + ] + } + } + } + ], + "globalConstraints": { + "maxVelocity": 5.2, + "maxAcceleration": 3, + "maxAngularVelocity": 540, + "maxAngularAcceleration": 720 + }, + "goalEndState": { + "velocity": 0, + "rotation": 139.56532773520377, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 180, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Red Source Side Not Race 1.path b/src/main/deploy/pathplanner/paths/Red Source Side Not Race 1.path new file mode 100644 index 00000000..48a38855 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Red Source Side Not Race 1.path @@ -0,0 +1,70 @@ +{ + "version": 1, + "waypoints": [ + { + "anchor": { + "x": 15.144283355931908, + "y": 4.1 + }, + "prevControl": null, + "nextControl": { + "x": 14.821464001653492, + "y": 3.39495238579938 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 13.617641570264757, + "y": 3.15475799992654 + }, + "prevControl": { + "x": 14.17071814363604, + "y": 3.169010510049207 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [ + { + "name": "speaker warmup", + "waypointRelativePos": 0.5, + "command": { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "waitingSpeakerShot" + } + } + ] + } + } + } + ], + "globalConstraints": { + "maxVelocity": 5.2, + "maxAcceleration": 3, + "maxAngularVelocity": 540, + "maxAngularAcceleration": 720 + }, + "goalEndState": { + "velocity": 0, + "rotation": 40.43467226479622, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 0, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc/robot/autos/AutoCommands.java b/src/main/java/frc/robot/autos/AutoCommands.java index 0a7b58f6..860dd960 100644 --- a/src/main/java/frc/robot/autos/AutoCommands.java +++ b/src/main/java/frc/robot/autos/AutoCommands.java @@ -166,6 +166,20 @@ public Command redSourceSideRaceNM() { }); } + public Command redSourceSideNotRaceNM() { + return Commands.runOnce( + () -> { + var steps = new LinkedList(); + steps.add(AutoNoteStep.score(8)); + steps.add(AutoNoteStep.score(7)); + steps.add(AutoNoteStep.score(6)); + + noteMapManager.setPreferredScoringLocations( + List.of(NoteMapLocations.RED_SOURCE_SIDE_SCORING_LOCATION)); + noteMapManager.setSteps(steps); + }); + } + public Command blueSourceSideRaceNM() { return Commands.runOnce( () -> { @@ -180,6 +194,20 @@ public Command blueSourceSideRaceNM() { }); } + public Command blueSourceSideNotRaceNM() { + return Commands.runOnce( + () -> { + var steps = new LinkedList(); + steps.add(AutoNoteStep.score(8)); + steps.add(AutoNoteStep.score(7)); + steps.add(AutoNoteStep.score(6)); + + noteMapManager.setPreferredScoringLocations( + List.of(NoteMapLocations.BLUE_SOURCE_SIDE_SCORING_LOCATION)); + noteMapManager.setSteps(steps); + }); + } + public Command noteMapResetCommand() { return Commands.runOnce( () -> { diff --git a/src/main/java/frc/robot/autos/AutoSelection.java b/src/main/java/frc/robot/autos/AutoSelection.java index 0b79d70c..3a9a6674 100644 --- a/src/main/java/frc/robot/autos/AutoSelection.java +++ b/src/main/java/frc/robot/autos/AutoSelection.java @@ -9,6 +9,7 @@ public enum AutoSelection { OP_NON_NM("Red OP", "Blue OP"), AMP_SIDE_NM("Red Amp OP NM", "Blue Amp OP NM"), SOURCE_SIDE_NM("Red Source Side Race NM", "Blue Source Side Race NM"), + SOURCE_SIDE_NOT_RACE_NM("Red Source Side Not Race NM", "Blue Source Side Not Race NM"), SIX_PIECE("Red Six Piece 2 to 4", "Blue Six Piece 2 to 4"); public final String redAutoName; diff --git a/src/main/java/frc/robot/autos/Autos.java b/src/main/java/frc/robot/autos/Autos.java index 8580da52..c48910b5 100644 --- a/src/main/java/frc/robot/autos/Autos.java +++ b/src/main/java/frc/robot/autos/Autos.java @@ -116,6 +116,8 @@ public Autos( registerCommand("blueMidDropRaceNM", autoCommands.blueMidDropRaceNM()); registerCommand("redSourceSideRaceNM", autoCommands.redSourceSideRaceNM()); registerCommand("blueSourceSideRaceNM", autoCommands.blueSourceSideRaceNM()); + registerCommand("redSourceSideNotRaceNM", autoCommands.redSourceSideNotRaceNM()); + registerCommand("blueSourceSideNotRaceNM", autoCommands.blueSourceSideNotRaceNM()); registerCommand("dropNote", noteMapManager.dropNoteMovingBackward()); registerCommand("waitingDropRequest", autoCommands.waitingDropRequestCommand());