AdvantageKit
YAMS integrates seamlessly with AdvantageKit, Team 6328's logging and replay framework. This guide shows how to use YAMS mechanisms with AdvantageKit's IO layer pattern for deterministic log replay.
What is AdvantageKit?
AdvantageKit is a logging framework that records all inputs to your robot code, enabling deterministic replay in simulation. Unlike traditional logging that captures specific values, AdvantageKit captures everything flowing into your code, allowing you to:
Replay matches exactly as they happened
Add new logged fields after the fact
Test code changes against real match data
Debug issues that only occurred on the real robot

Architecture overview
AdvantageKit uses an IO interface pattern to separate hardware interaction from business logic. Traditionally, this requires separate IO implementations for real hardware and simulation:

YAMS simplification: one IO class for real and sim
With YAMS, you don't need separate Real and Sim IO implementations. Every SmartMotorController wrapper (TalonFXWrapper, SparkWrapper, etc.) and every Mechanism class (Arm, Elevator, FlyWheel, SwerveModule, SwerveDrive, etc.) includes passive simulation that runs automatically when Robot.isSimulation() returns true.
The YAMS mechanism under the IO class picks real hardware or its own simulation by itself, based on Robot.isSimulation().
This means:
One IO class handles both real robot and simulation
No duplicate code - configuration is written once
No SimWrapper needed - real hardware wrappers simulate themselves
Physics are automatic - based on your DCMotor, gearing, and mass/MOI configuration
Tutorial
The tutorial builds an arm with the IO layer pattern, one step per page, and shows the elevator and shooter IO classes alongside it. Start with Step 0:
The vendor library, build.gradle, and Robot as a LoggedRobot.
The inputs each mechanism logs.
One IO class per mechanism that works on the real robot and in simulation.
The subsystem that uses the IO class, and wiring it up.
Replaying a log, and the pattern in summary.
The same pattern for a YAMS swerve drive.
A simpler pattern that logs straight from the subsystem.
Benefits of YAMS + AdvantageKit
No Duplicate IO Classes
Single IO class works for real robot AND simulation
Deterministic Replay
Debug issues from real matches using log replay
Automatic Physics
YAMS uses DCMotor, gearing, and mass/MOI for accurate sim
Less Boilerplate
2 IO classes instead of 3 per mechanism
Consistent Behavior
Same code paths execute in real and sim modes
Flexible Hardware
Swap vendors by changing one IO class
Further reading
Last updated
Was this helpful?
