Subsystems
In an FRC robot a subsystem is a part of the robot hardware and software that performs a certain function or set of related functions. Subsystems may operate independently of other subsystems or they may operate in a coordinated fashion to carry out a robot function.
Some of common types of subsystems supported in WPILIb are:
- Elevator Subsystems - Linear Mechanisms
- Flywheel Subsystems - Intakes, Shooters
The exact organization and functionality of the subsystems on a given robot depend on the game and the team's design for that year. Other support functions like displays can also be coded as a subsystem.
In WPILib software a subsystem has added functionality that supports operation within the robot classes, commands and the_scheduler.
- Provides a way to automatically have functions called during initialization or periodically.
- Provides a way to manage hardware resources across commands to prevent conflicts.
- Provides a simplified way to define commands that are specific to a subsystem.
In the robot-template and software repositories based on it, there are specific places in the software that need to be modified to add a new subsystem, tie it into the robot and OI controllers, and support testing. These steps are outline in Adding a Subsystem to the Software.
References:
WPILib Subsystems in Command Based Programming:
https://docs.wpilib.org/en/stable/docs/software/commandbased/subsystems.html
FRC Team 2928 Training - Subsystems:
https://2928-frc-programmer-training.readthedocs.io/en/latest/Romi/SC/romiSubsystems/

Discussion