Commands
Commands represent actions the robot can take. They are scheduled by the command scheduler and run until either:- They finish naturally (their end condition is met), or
- They are interrupted by another command.
Subsystems
Subsystems represent independent collections of hardware that work together — for example, a drivetrain, an arm, or an intake mechanism. Subsystems serve two main purposes:- Resource management Only one command can control a subsystem at a time, which prevents conflicting hardware instructions.
- Abstraction Subsystems hide hardware details behind a clean interface. This keeps your robot code simple and lets you change the internal hardware implementation without touching the rest of your code.
How Commands Are Run
Commands and subsystems are tied together by the scheduler.- The scheduler keeps track of which commands are running.
- It ensures that only one command at a time can use a given subsystem.
- Each iteration of the robot loop, the scheduler calls the appropriate methods on commands and subsystems to update behavior.