Robotics softwareAdvanced

AdvantageKit Logging and Simulation Separation

Robot logs are most useful when code separates real inputs, simulated inputs, and outputs cleanly enough to replay behavior.

AdvantageKitFRCLoggingSimulation

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

15.3sensor input
33.0code output
17.7derived signal

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.

InputsSensor readings and driver commands.
Robot codeThe deterministic logic that turns inputs into outputs.
OutputsMotor commands, setpoints, and calculated states.
ReplayRun code again against recorded inputs to inspect behavior.

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 signalDebug question
Gyro yawDid heading jump or disconnect?
Module angleDid swerve modules track setpoints?
Pose estimateDid odometry drift?
Shooter RPMDid velocity settle before firing?
Command stateWhich 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?
  1. So real, simulated, and replayed inputs can share the same control code
  2. To remove all sensors
  3. To avoid logging
  4. To make code slower

The IO boundary lets the same logic run with real hardware, simulation, or replayed logs.

Sources and Further Reading

Related Explainers