Skip to content

Commit d4b5c6d

Browse files
committed
Add AutoOptions to RedGoalSideAuto to only do part of the full auto.
1 parent 4802b6e commit d4b5c6d

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

TeamCode/src/main/kotlin/pioneer/opmodes/auto/RedGoalSideAuto.kt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ import pioneer.general.AllianceColor
1212

1313
class RedGoalSideAuto : BaseOpMode() {
1414

15-
1615
val P = Points(AllianceColor.RED)
1716
/* ----------------
1817
- ENUMS -
1918
---------------- */
2019

20+
// Allows you to do some or all of the auto
21+
enum class AutoOptions {
22+
PRELOAD_ONLY,
23+
FIRST_ROW,
24+
SECOND_ROW,
25+
ALL
26+
}
27+
2128
// Main state for auto
2229
enum class State {
2330
GOTO_SHOOT,
@@ -35,6 +42,7 @@ class RedGoalSideAuto : BaseOpMode() {
3542
DONE
3643
}
3744

45+
var autoType = AutoOptions.ALL
3846
var state = State.GOTO_SHOOT
3947
var collectState = CollectState.GOAL
4048

@@ -88,6 +96,26 @@ class RedGoalSideAuto : BaseOpMode() {
8896
// TODO: Shoot
8997
if (true) {
9098
state = State.GOTO_COLLECT
99+
100+
// Breakpoint for the different auto options
101+
when (autoType) {
102+
AutoOptions.PRELOAD_ONLY -> {
103+
if (collectState == CollectState.GOAL) {
104+
state = State.STOP
105+
}
106+
}
107+
AutoOptions.FIRST_ROW -> {
108+
if (collectState == CollectState.MID) {
109+
state = State.STOP
110+
}
111+
}
112+
AutoOptions.SECOND_ROW -> {
113+
if (collectState == CollectState.AUDIENCE) {
114+
state = State.STOP
115+
}
116+
}
117+
AutoOptions.ALL -> {}
118+
}
91119
}
92120
}
93121

0 commit comments

Comments
 (0)