AdvantageKit Logging and Simulation Separation
Robot logs are most useful when code separates real inputs, simulated inputs, and outputs cleanly enough to replay behavior.
Site connection
The FRC robot code used AdvantageKit, AdvantageScope, simulation separation, and log analysis to debug drivetrain and mechanism behavior.
Visual model
Replay a moment in robot state
Move through a synthetic replay timestamp and watch input, output, and derived signals change.
Interactive
Log replay turns recorded inputs into repeatable debugging
A robot match is too chaotic to debug only by memory. Logging turns sensor readings, commands, estimated poses, setpoints, and mechanism states into a timeline that can be inspected after the robot leaves the field.
The IO Boundary
The clean architecture is to isolate hardware interaction behind IO interfaces. Real code reads actual devices; sim code produces simulated measurements; replay uses logged inputs.
That boundary makes the robot code easier to test because the control logic does not have to know where the input came from.
Debugging with Replay
If a gyro disconnects, a module jitters, or a shooter misses its setpoint, logs let the team compare what the robot believed with what it commanded.
Replay is especially powerful because it can show whether a bug lives in decision logic or in live hardware input.
| Logged signal | Debug question |
|---|---|
| Gyro yaw | Did heading jump or disconnect? |
| Module angle | Did swerve modules track setpoints? |
| Pose estimate | Did odometry drift? |
| Shooter RPM | Did velocity settle before firing? |
| Command state | Which behavior was active? |
Common Pitfalls
- Logging outputs but not inputs.
- Mixing hardware calls into high-level logic.
- Forgetting timestamps and units.
- Treating replay as perfect when unlogged inputs still affect code.
Quick check
Quiz
Why separate IO from robot logic?
- So real, simulated, and replayed inputs can share the same control code
- To remove all sensors
- To avoid logging
- To make code slower
The IO boundary lets the same logic run with real hardware, simulation, or replayed logs.