Skip to content

DefenderStateMachine

Matthew Roberts edited this page Nov 17, 2026 · 1 revision

Concepts

  • Runnable lambda functions
  • Object/method chaining

Available States (BIOBUZZ)

  • DefenderState: base class that handles a lot of state essentials: starting, finishing, labeling states, handling next states. Also includes hooks for running code before the state begins and before it moves on to the next state.
  • RunOnceState: provide it a runnable lambda function. That code runs and then the state marks itself as finished.
  • TelemetryUpdateState: very simply, pushes telemetry data to the Driver Station. Mostly useful during testing.
  • TimedDriveState: moves the robot through basic time-based driving. Drives using separate values for forward/reverse, strafe, and rotation.
  • WaitState: just waits.
  • DriveToPositionState: requires navigation system and uses odometry to drive to a specific place on field.
  • BuzzBotShootState: runs the shooter system long enough to launch a full set of pollen/nectar.
  • BuzzBotWaitThenShootState: uses the vision system and the opmode's knowledge of alliance color and which side of field we started on to wait for the hive to tip, with a limit for how long it waits. If the hive tips, then it shoots. Otherwise it moves on to the next state.

Clone this wiki locally