Skip to content

Commit db51602

Browse files
mapped states
Co-Authored-By: lameesnotlame <258483139+lameesnotlame@users.noreply.github.com>
1 parent b2e3be2 commit db51602

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package frc.robot.commands.states;
2+
3+
public class MapStatesToButtons {
4+
}

src/main/java/frc/robot/subsystems/StateMachine.java

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public StateMachine() {
2222

2323
public void setRobotState(RobotState robotState) {
2424
currentRobotState = robotState;
25+
2526
}
2627

2728
public RobotState getRobotState() {
@@ -34,6 +35,8 @@ public Command tryState(RobotState desiredState) {
3435
switch (currentRobotState) {
3536
case NONE:
3637
case INTAKING:
38+
case REVERSING_SHOOTER:
39+
case EJECTING_HOPPER:
3740
return new None();
3841
}
3942
break;
@@ -43,6 +46,75 @@ public Command tryState(RobotState desiredState) {
4346
return new None();
4447
}
4548
break;
49+
case SHOOTING:
50+
switch (currentRobotState) {
51+
case NONE:
52+
return new None();
53+
}
54+
break;
55+
case REVERSING_SHOOTER:
56+
switch (currentRobotState) {
57+
case NONE:
58+
return new None();
59+
}
60+
break;
61+
case PREP_ANYWHERE:
62+
switch (currentRobotState) {
63+
case EJECTING_HOPPER:
64+
case REVERSING_SHOOTER:
65+
case SHOOTING:
66+
return new None();
67+
}
68+
break;
69+
case PREP_HUB:
70+
switch (currentRobotState) {
71+
case EJECTING_HOPPER:
72+
case REVERSING_SHOOTER:
73+
case SHOOTING:
74+
return new None();
75+
}
76+
break;
77+
case PREP_CORNER:
78+
switch (currentRobotState) {
79+
case EJECTING_HOPPER:
80+
case REVERSING_SHOOTER:
81+
case SHOOTING:
82+
return new None();
83+
}
84+
break;
85+
case PREP_NEUTRAL_TO_ALLIANCE:
86+
switch (currentRobotState) {
87+
case EJECTING_HOPPER:
88+
case REVERSING_SHOOTER:
89+
case SHOOTING:
90+
return new None();
91+
}
92+
break;
93+
case PREP_OPPONENT_TO_ALLIANCE:
94+
switch (currentRobotState) {
95+
case EJECTING_HOPPER:
96+
case REVERSING_SHOOTER:
97+
case SHOOTING:
98+
return new None();
99+
}
100+
break;
101+
case PREP_TOWER:
102+
switch (currentRobotState) {
103+
case EJECTING_HOPPER:
104+
case REVERSING_SHOOTER:
105+
case SHOOTING:
106+
return new None();
107+
}
108+
break;
109+
case PREP_TRENCH:
110+
switch (currentRobotState) {
111+
case EJECTING_HOPPER:
112+
case REVERSING_SHOOTER:
113+
case SHOOTING:
114+
return new None();
115+
}
116+
break;
117+
46118
}
47119
return Commands
48120
.print("ITS SO OVER D: Invalid State Provided, Blame Eli. Attempted to go to: " + desiredState.toString()

0 commit comments

Comments
 (0)