Stage 3 bridges the bench-measured gains from Stage 1 with the programming patterns established in Stage 2 to create production mechanism code.
In this stage, you will write fully encapsulated subsystem classes, implement command factory methods, configure software safety limits, and wire driver controls in RobotContainer.
Subsystem Architecture Standard
Section titled “Subsystem Architecture Standard”Every mechanism subsystem built in this course adheres to a strict architectural standard:
- Private Final Actuators: All motor controllers, sensors, and pneumatic solenoids are private final members.
- Dedicated Config Method: A single
configureHardware()method configures gains, current limits, and soft limits in one atomic call. - Command Factories: High-level commands are constructed via public methods returning
Commandobjects, encapsulating requirements automatically. - Telemetry Publishing: The
periodic()method publishes sensor positions, setpoints, and stator currents to NetworkTables on every loop cycle.
For complete subsystem implementations of arms, elevators, flywheels, intakes, and climbers, refer to the Mechanism Code Snippets library.
Verified Sources & Standards
- WPILib Subsystems Documentationdocs.wpilib.orgWPILib Standard
Lessons
Building Mechanism Subsystems
Writing complete Subsystem classes, private hardware handles, importing Tuner X gains, stator current limits, soft limits, and telemetry in periodic().
Writing Mechanism Commands
Command factory methods on Subsystems vs standalone Command classes, setpoint moves with timeouts, and sensor-based termination.
RobotContainer Wiring & Default Commands
Central architecture in RobotContainer, default commands, mechanism safety interlocks, and subsystem dependency injection.