For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Animation of one loop of the robot shown twice. On the real robot and in simulation, the IO class reads the YAMS arm into the inputs, the inputs are written to the log, the subsystem logic runs on them, and its setpoint goes back through the IO class to the YAMS arm. In log replay the inputs come from the log file, the same subsystem logic runs on them, and the outputs go to an empty replay IO class that drops them.
The subsystem only sees the inputs, so replaying the logged inputs replays its decisions.

AdvantageKit is optional. YAMS works perfectly without it using its built-in telemetry system. Consider AdvantageKit if you want deterministic log replay capabilities.

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:

Two diagrams of a subsystem, its IO interface and the classes that implement it. Traditional AdvantageKit needs three IO classes for each mechanism: one with your motor and encoder code for the real robot, one with your physics simulation, and an empty one for log replay. With YAMS there are two: one class used on the real robot and in simulation, because the YAMS mechanism under it simulates itself, and the empty one for log replay.
Traditional AdvantageKit needs three IO classes for each mechanism. With YAMS it is two.

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:

Page
What it covers

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

Feature
Benefit

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?