What is AdvantageKit?
AdvantageKit is a a logging, telemetry, and replay framework developed by Team 6328. AdvantageKit enables log replay, where the full state of the robot code can be replayed in simulation based on a log file (What is AdvantageKit?).
AdvantageKit is not a general-purpose logging framework. Users interested in traditional logging should use WPILib data logging or Epilogue.
To learn more, check out the documentation or take a look at our conference from the 2024 FIRST Championship:
We began our journey with AdvantageKit and log replay in 2021, and we’ve been excited to watch the community response over the past 3 years. AdvantageKit was used by 335 teams in 2024, and we’re grateful for all of the feedback and contributions we’ve received from our users.
Log Replay, Streamlined
The 2025 release of AdvantageKit brings some major updates to streamline the process of setting up and using log replay. The key features are highlighted below, or check the full changelog for details.
All-New Template Projects
The AdvantageKit template projects have been reimagined from the ground up with improved features and documentation:
- The reimagined swerve templates for robots based on the Spark and TalonFX support advanced features like high-frequency odometry, on-controller feedback loops, and automated characterization routines. The TalonFX version of the template now optionally integrates with CTRE’s swerve project generator for calibration.
- The brand new vision template project demonstrates how AdvantageKit can be used to create a deterministic and replayable pose estimation pipeline, with support for high-frequency sampling, simulation with PhotonLib, and advanced filtering options.
- All other template projects have been cleaned up and streamlined.
- Every template project includes now detailed setup and tuning instructions, available here.
We recommend checking the documentation pages linked above for more information about the new features available in each template project.
Every AdvantageKit template is open-source and fully customizable:
- No black boxes: Users can view and adjust all layers of the control stack, including advanced features of the swerve and vision templates.
- Customizable: IO implementations can be adjusted to support any hardware configuration, including a combination of devices from multiple vendors.
- Replayable: Every aspect of the control logic, pose estimation, etc. can be replayed and logged in simulation using AdvantageKit’s deterministic replay features with guaranteed accuracy.
No Shims
Since its initial release, AdvantageKit has relied on shimming some WPILib classes to enable deterministic replay. Thanks to a collaborative effort with the WPILib team, we are thrilled to announce that AdvantageKit no longer uses WPILib shims. Deterministic logging and replay is still fully supported with minimal changes to the user experience. See this page for details on the data available during replay.
...
Replay Watch
Replay watch is a new feature allowing rapid iteration of replayed code, taking advantage of AdvantageKit’s deterministic replay features to replay faster than real time without losing accuracy. The video below shows how replay watch can be used to rapidly iterate on simple code. Check the pose estimation example and documentation for more detail.
This update includes additional features to streamline the log replay process, even without replay watch:
- Log files automatically open in AdvantageScope when replay completes. This behavior can be configured using the
WPILOGWriter
class.- The filenames for replayed logs use number indices when replaying multiple times (e.g.
mylog_sim_2.wpilog
instead ofmylog_sim_sim.wpilog
)
Record Logging
Custom record classes can be logged as structs, including support for single values and arrays as inputs or outputs. This enables efficient logging of custom complex data types, such as pose observations. Check the documentation for details.
Example Code
This code below shows how this feature is used in the new vision template for logging pose observations:
@AutoLog
public static class VisionIOInputs {
public PoseObservation[] poseObservations = new PoseObservation[0];
}
public static record PoseObservation(
double timestamp,
Pose3d pose,
double ambiguity,
int tagCount,
double averageTagDistance,
PoseObservationType type) {}
public static enum PoseObservationType {
MEGATAG_1,
MEGATAG_2,
PHOTONVISION
}
2D Array Logging
In addition to single values and arrays, 2D arrays can now be logged as inputs or outputs. All data types supported by standard array logging also support 2D arrays, including primitives, structs, and records. Check the documentation for details.
Translation2d[][] visionSamples = new Translation2d[][] {
new Translation2d[] { new Translation2d(), new Translation2d() },
new Translation2d[] { new Translation2d(), new Translation2d() }
}
Logger.recordOutput("VisionSamples", visionSamples);
Alerts Logging
The state of any alerts created through WPILib’s persistent alerts API will be automatically logged as outputs. These alerts can be visualized using AdvantageScope’s Line Graph tab. Check the documentation for details.
Radio Logging
Status data from the VH-109 radio is automatically logged as an output. This includes useful information about the connection status, bandwidth usage, etc. Check the documentation for details.
New Documentation Site
The AdvantageKit documentation has been updated to a modern look, with a reorganized layout and detailed template project documentation. The new documentation site also supports easier navigation via the sidebar, a built-in search feature, and a refined mobile interface. This documentation can be accessed at docs.advantagekit.org.
The new log replay comparison page breaks down AdvantageKit’s features and capabilities compared to similar logging tools like Hoot Replay.
Build System Updates
AdvantageKit is currently transitioning to a new build system for library components, which will simplify development and the process of external contribution. We will have more updates to share soon. Additionally, AdvantageKit is in the process of moving Maven hosting from GitHub Packages to the WPILib Artifactory site. This change is intended to provide a more stable and seamless experience when installing and using AdvantageKit. AdvantageKit v4.0.0-beta-1 remains hosted on GitHub Packages, but look for updates soon.
What’s Next?
The AdvantageKit 2025 beta is now released! To get started, check out the installation guide. Projects based on AdvantageKit 2024 or the 2025 alpha cannot be directly upgraded, as this release includes significant changes to the project build. We highly recommend starting with one of the template projects and copying code as necessary from older versions.
THIS IS A BETA RELASE, which means that you will encounter issues not present in stable releases. Feedback, feature requests, and bug reports are welcome on the GitHub issues page. Keep an eye out for updates!