FRC robot code for the 2027 season. Built on WPILib 2026.2.1 with CTRE Phoenix6, PathPlanner, and PhotonVision.
src/main/java/frc/robot/
├── Robot.java # Main robot class (extends LoggedRobot)
├── RobotContainer.java # Subsystem instantiation and button bindings
├── Constants.java # Tuning constants (PID gains, CAN IDs, etc.)
├── Telemetry.java # Swerve drivetrain telemetry
├── commands/ # WPILib commands
├── subsystems/ # Robot subsystems (Shooter, Intake, Indexer, …)
│ └── vision/ # PhotonVision integration
├── constants/ # Feature switches, field layout, robot constants
├── generated/ # CTRE Tuner X generated swerve constants
├── lib/ # Shared utilities (logging, simulation helpers, …)
└── sim/ # Physics simulation profiles
# Build
./gradlew build
# Deploy to roboRIO
./gradlew deploy
# Simulate (desktop)
./gradlew simulateJavaconstants/FeatureSwitches.java contains boolean flags to enable or disable
features at compile time (e.g. vision filters, debug logging, mechanical
protections). All flags default to the safe/2026-baseline state.
AdvantageKit (v26.0.2) is integrated for structured telemetry logging and deterministic log replay.
- Logs all
@AutoLogOutputfields from every subsystem automatically each robot cycle, publishing them to NetworkTables and writing them to a.wpilogfile on the roboRIO. - Enables log replay — you can re-run robot code in simulation against a real match log, deterministically reproducing every sensor input and state change.
Open the .wpilog file created in /home/lvuser/logs/ on the roboRIO with
AdvantageScope.
During a match or simulation you can also connect AdvantageScope to the robot's
live NetworkTables stream.
Add @AutoLogOutput to any public or package-private instance field in a
SubsystemBase subclass. Supported types include boolean, int, double,
String, double[], Pose2d, SwerveModuleState[], and other WPILib structs.
import org.littletonrobotics.junction.AutoLogOutput;
public class MySubsystem extends SubsystemBase {
@AutoLogOutput(key = "MySubsystem/IsActive")
private boolean isActive = false;
@AutoLogOutput(key = "MySubsystem/TargetRPS")
private double targetRPS = 0.0;
}The key is the path shown in AdvantageScope/NetworkTables under the
AdvantageKit root table.
You can also log one-off values anywhere in code with:
Logger.recordOutput("MySubsystem/SomeValue", myValue);| Class | Key | Type |
|---|---|---|
Shooter |
Shooter/TargetRPS |
double |
Shooter |
Shooter/Locked |
boolean |
Shooter |
Shooter/WasLocked |
boolean |
Shooter |
Shooter/ShotCount |
int |
Indexer |
Indexer/Active |
boolean |
Note: Log replay is not wired up by default — simulation currently runs the physics sim with live NT telemetry only. To enable replay:
- Transfer a
.wpilogfile from the roboRIO to your PC. - Open the log in AdvantageScope and use File → Export replay log to set it
as the replay source, or edit
Robot.java's simulation block:
} else {
setUseTiming(false); // run as fast as possible during replay
String logPath = LogFileUtil.findReplayLog();
Logger.setReplaySource(new WPILOGReader(logPath));
Logger.addDataReceiver(
new WPILOGWriter(LogFileUtil.addPathSuffix(logPath, "_sim")));
}- Run
./gradlew simulateJava— the robot code will re-execute against the recorded inputs and write a new_simlog with all outputs.
You can also watch for log file changes with the Gradle task:
./gradlew replayWatchOn the real robot, AdvantageKit writes to /home/lvuser/logs/ (same directory
as WPILib's DataLogManager). Both systems run in parallel — AKit writes its
own .wpilog file while DataLogManager writes a separate one for CTRE Hoot
compatibility. This is intentional; you can remove the DataLogManager calls
in Robot.java once you no longer need CTRE Hoot replay.
The robot uses PhotonVision cameras for AprilTag-based pose estimation.
Vision filtering parameters (boundary rejection, stddev tuning, tag rankings)
are controlled via feature switches in FeatureSwitches.java. See
docs/vision-testing-protocol.md for the A/B testing methodology.
Coprocessor (Orange Pi) scripts — metrics publishing and raw-frame vision recording — live
in coprocessor/; see coprocessor/README.md.