Skip to content

Commit

Permalink
Add smart BCAD autos
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbell4 committed Apr 7, 2024
1 parent fc9db50 commit 8970328
Show file tree
Hide file tree
Showing 3 changed files with 308 additions and 0 deletions.
138 changes: 138 additions & 0 deletions src/main/deploy/pathplanner/autos/BC-direct-AD start.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 1.33,
"y": 5.54
},
"rotation": 0.0
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Startup delay"
}
},
{
"type": "named",
"data": {
"name": "Shoot without aiming"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Subwoofer to B"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Shoot without aiming"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "B to C for shooting"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Shoot"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "C to A"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Shoot"
}
},
{
"type": "race",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Intake note"
}
},
{
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "A to D"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.5
}
}
]
}
}
]
}
}
]
}
},
"folder": "Partial",
"choreoAuto": false
}
144 changes: 144 additions & 0 deletions src/main/deploy/pathplanner/autos/BCAD start.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 1.33,
"y": 5.54
},
"rotation": 0.0
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Startup delay"
}
},
{
"type": "named",
"data": {
"name": "Shoot without aiming"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Subwoofer to B"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Shoot without aiming"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "B to C"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "path",
"data": {
"pathName": "C to B"
}
},
{
"type": "named",
"data": {
"name": "Shoot"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "B to A"
}
},
{
"type": "named",
"data": {
"name": "Intake note"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "Shoot"
}
},
{
"type": "race",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "Intake note"
}
},
{
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "A to D"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.5
}
}
]
}
}
]
}
}
]
}
},
"folder": "Partial",
"choreoAuto": false
}
26 changes: 26 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,32 @@ private void buildAutos(SendableChooser<Command> chooser) {
).withName("Smart ADE");
chooser.addOption("Smart ADE", smartADE);

Command smartBCAD =
Commands.sequence(
new PathPlannerAuto("BCAD start"),
Commands.runOnce(() -> { System.out.println("Ready for conditional part: " + s_Index.haveNote()); }),
Commands.either(
Commands.print("Running DE from A").andThen(new PathPlannerAuto("DE from A")),
Commands.print("Running D-E-Shoot").andThen(new PathPlannerAuto("D-E-Shoot")),
s_Index::haveNote
),
Commands.print("Conditional part over")
).withName("Smart BCAD");
chooser.addOption("Smart BCAD", smartBCAD);

Command smartBCdirectAD =
Commands.sequence(
new PathPlannerAuto("BC-direct-AD start"),
Commands.runOnce(() -> { System.out.println("Ready for conditional part: " + s_Index.haveNote()); }),
Commands.either(
Commands.print("Running DE from A").andThen(new PathPlannerAuto("DE from A")),
Commands.print("Running D-E-Shoot").andThen(new PathPlannerAuto("D-E-Shoot")),
s_Index::haveNote
),
Commands.print("Conditional part over")
).withName("Smart BC-direct-AD");
chooser.addOption("Smart BC-direct-AD", smartBCdirectAD);

Command smartADEOTF =
Commands.sequence(
new PathPlannerAuto("Amp-side OTF + AD"),
Expand Down

0 comments on commit 8970328

Please sign in to comment.