Spectrum 3847 operates several physical robots from the same codebase simultaneously throughout the season. Rather than maintaining separate code branches per robot, the codebase selects aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/spectrum3847/2026-Spectrum/llms.txt
Use this file to discover all available pages before exploring further.
Config object at startup based on which RoboRIO is running the code. Every subsystem-level difference — encoder offsets, attached mechanisms, and tuning constants — is encapsulated in that single config object.
Why multiple configs exist
Different robots in the shop serve different purposes:| Robot | Config class | Purpose |
|---|---|---|
| Final Machine | FM2026 | Competition robot; all mechanisms attached |
| Practice Machine | PM2026 | Practice chassis; matches FM hardware except hood |
| Experimental Machine | XM2026 | Prototype testbed; subset of mechanisms attached |
| Alpha Machine | AM2026 | Early-season prototype; minimal hardware |
| Photon Test Chassis | PHOTON2026 | Vision and drivetrain development |
How Rio.id resolves a config at startup
Rio is an enum in frc.spectrumLib. Each entry stores the RoboRIO serial number printed on the label on the back of the controller. On startup, Rio.checkID() reads the live serial number via RobotController.getSerialNumber() and looks it up in a static map. The result is stored in the public constant Rio.id.
Rio.java
getSerialNumber() is never called (it crashes via JNI in test environments). The serial number defaults to "", which matches the SIM entry.
Robot’s constructor switches on Rio.id and constructs the matching config:
Robot.java
If a RoboRIO’s serial number is not registered in the
Rio enum, Rio.id resolves to UNKNOWN, and the default branch of the switch selects FM2026. An error-level dashboard alert is raised so the discrepancy is immediately visible.Config class structure
All config classes extendRobot.Config, which declares one sub-config field per subsystem using default-constructed values.
Robot.java (inner class)
FM2026 configures all encoder offsets and marks every mechanism as attached:
FM2026.java
The setAttached() pattern
Each per-subsystem config class (e.g.LauncherConfig) extends Mechanism.Config, which carries an attached boolean field. setAttached(false) disables hardware initialization for that subsystem — no CAN messages are sent, no motor objects are created, and all sensor reads return 0.
This makes it straightforward to express exactly which hardware a given robot carries. Compare FM2026 (all mechanisms attached) with AM2026 (alpha machine, fewer mechanisms):
AM2026.java
XM2026 shows an intermediate case — the experimental machine has an intake and launcher but no intake extension:
XM2026.java
How to add a new robot configuration
Register the RoboRIO serial number
Add a new entry to the
Rio enum in Rio.java. The serial number appears on the label on the back of the RoboRIO; add a leading zero as needed.Rio.java
Create a config class
Create a new class in
frc/robot/configs/ that extends Robot.Config. Override encoder offsets and call setAttached() for each mechanism the robot carries.FM2026.java
