Skip to main content

Lifecycle & Scheduling

The CommandScheduler runs every loop and:

  • calls initialize() for new commands
  • calls execute() for scheduled commands
  • ends commands that finish or get interrupted
  • enforces subsystem requirements (prevents conflicts)

Modes

  • Default commands run when a subsystem is idle
  • Interrupts: scheduling a new command that requires the same subsystem interrupts the old one
  • Use .withTimeout() and .until() to bound execution

Health

  • Log active commands each loop
  • Ensure all long‑running commands either have a finish condition or are default commands