This repository contains the robot code for the 2026 FRC season, built using WPILib, AdvantageKit, and the yams library. The core logic resides in src/main/java/frc/robot.
The code is organized into the following packages within src/main/java/frc/robot:
commands: Contains robot commands (e.g.,Shoot,Autos).subsystems: Contains robot subsystems (e.g.,ExampleShooter) and theLoggingSubsystem.model: Contains data models annotated for AdvantageKit logging (e.g.,ShooterLog).utilities: Helper classes, including the configuration system (Config,HoorayConfig).- Root:
Robot.java,RobotContainer.java,Constants.java, andMain.java.
The project uses the standard WPILib Command-based framework.
- Subsystems: Encapsulate hardware and logic (e.g.,
ExampleShooter). They extendSubsystemBase.- Many subsystems implement the
LoggedSubsysteminterface, designed to work with theLoggingSubsystemfor centralized data collection. - Integration with the
yamslibrary allows for advanced motor control wrapping (SmartMotorController) and mechanism simulation (FlyWheel).
- Many subsystems implement the
- Commands: Define robot actions. Dependencies are injected via constructors to ensure modularity.
- LoggingSubsystem: A specialized subsystem designed to iterate through registered
LoggedSubsysteminstances and process their logs. It employs time-slicing (via anoftennessparameter) to distribute the CPU overhead of logging across multiple robot cycles.
The robot uses AdvantageKit to separate data flow provided by the IO layer from the robot logic, enabling high-fidelity replay simulation.
- Modeling: Data to be logged is defined in
modelclasses (e.g.,ShooterLog).- The
@AutoLogannotation automatically generates aLoggableInputsimplementation (e.g.,ShooterLogAutoLogged).
- The
- Telemetry: Subsystems update these model objects during execution. The logging system then records this state.
- Modes:
Robot.javahandles initialization for different environments:- REAL: Logs to USB (if available) or internal storage using
WPILOGWriterand publishes to NetworkTables (NT4Publisher). - SIM: Runs robot logic in simulation.
- REPLAY: Reads from a log file to rerun code against recorded data.
- REAL: Logs to USB (if available) or internal storage using
Configuration is split between static constants and dynamic runtime configuration:
Constants.java: Stores static values (e.g., specific voltage compensation) and acts as the bridge to retrieval of dynamic values.utilities/HoorayConfig.java: A singleton that manages loading configuration.- It attempts to parse a JSON file (e.g., from
/home/lvuser/proto) into theConfigobject. - This allows the same code deployment to adapt ports, offsets, and settings for different physical robots (e.g., "Proto" vs "Comp" bot).
- It attempts to parse a JSON file (e.g., from
Robot.java: The main robot class. It initializes the AdvantageKitLoggerand Phoenix 6SignalLogger, determines the runtime mode (Real/Sim/Replay), and manages the main loop.RobotContainer.java: Serves as the dependency injection container.- Initializes subsystems and controllers.
- Configures button bindings (e.g., binding the
Shootcommand to a controller button). - Sets up the autonomous command chooser.