Skip to content

Commit

Permalink
Add source not race auto
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahsnider committed Nov 9, 2024
1 parent a4d3633 commit 24f9595
Show file tree
Hide file tree
Showing 7 changed files with 295 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
62 changes: 62 additions & 0 deletions src/main/deploy/pathplanner/autos/Red Source Side Not Race NM.auto
Original file line number Diff line number Diff line change
@@ -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
}
70 changes: 70 additions & 0 deletions src/main/deploy/pathplanner/paths/Blue Source Side Not Race 1.path
Original file line number Diff line number Diff line change
@@ -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
}
70 changes: 70 additions & 0 deletions src/main/deploy/pathplanner/paths/Red Source Side Not Race 1.path
Original file line number Diff line number Diff line change
@@ -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
}
28 changes: 28 additions & 0 deletions src/main/java/frc/robot/autos/AutoCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@ public Command redSourceSideRaceNM() {
});
}

public Command redSourceSideNotRaceNM() {
return Commands.runOnce(
() -> {
var steps = new LinkedList<AutoNoteStep>();
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(
() -> {
Expand All @@ -180,6 +194,20 @@ public Command blueSourceSideRaceNM() {
});
}

public Command blueSourceSideNotRaceNM() {
return Commands.runOnce(
() -> {
var steps = new LinkedList<AutoNoteStep>();
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(
() -> {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/autos/AutoSelection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/autos/Autos.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 24f9595

Please sign in to comment.