Skip to content

Commit

Permalink
Started transitions between states
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusFlusche committed Jan 20, 2025
1 parent 6b676db commit e7f6f92
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/main/java/frc/robot/statemachine/StateMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ public StateMachine(CommandXboxController driverController, CommandXboxControlle
.withChild(goToIntake)
.withChild(intakeGamePiece);

// Example, will be button board later
manual.withTransition(scoreGamePiece, () -> false, "Example");

// Children inside children
goToScoringPosition.withChild(goToScoreCoral)
.withChild(goToScoreAlgae);
Expand All @@ -88,6 +85,27 @@ public StateMachine(CommandXboxController driverController, CommandXboxControlle
scoreAlgae.withChild(scoreAlgaeNet)
.withChild(scoreAlgaeProcessor);

// Example, will be button board later
manual.withTransition(goToScoringPosition, () -> false, "Driver presses score")
.withTransition(goToIntake, () -> false, "Driver presses intake");

goToScoringPosition.withTransition(scoreGamePiece, () -> false, "Close to scoring location")
.withTransition(manual, () -> false, "Score button released");

scoreGamePiece.withTransition(goToScoringPosition, () -> false, "Scoring location changed")
.withTransition(manual, () -> false, "Score button released")
.withTransition(manual, () -> false, "No game piece in robot");

goToIntake.withTransition(intakeGamePiece, () -> false, "Close to intake location")
.withTransition(manual, () -> false, "Intake button released");

intakeGamePiece.withTransition(goToIntake, () -> false, "Intake location changed")
.withTransition(manual, () -> false, "Intake button released");

intakeCoral.withTransition(manual, () -> false, "Has coral");

intakeAlgae.withTransition(manual, () -> false, "Has algae");

// Auto
auto.withModeTransitions(disabled, teleop, auto, test);

Expand Down

0 comments on commit e7f6f92

Please sign in to comment.