AdvantageKit#
AdvantageKit is a logging framework developed by team 6328#
What is logging?#
Logging is recording some or all of the state (such as the current values of variables, inputs and outputs, and what Commands are running) of the robot so that we can play it back later.
Why log?#
Logging helps with debugging by letting us see exactly what was happening to the robot and what it was doing when it broke. This is especially useful at competition, when we have limited time and testing ability to diagnose problems. For instance, at Houston 2023 we had an issue in our second quals match where our grabber stopped responding to input. Using the logs of that match, we saw that the sensor readings of the grabber had stopped responding, which suggested that the CAN bus to the grabber had broken.
Why AdvantageKit?#
AdvantageKit logs every input and output to and from the robot. This means we can perfectly recreate the state of the robot in the log or with a simulator.

It also means that we can run the same inputs through modified code, and simulate how the robot would have responded. AdvantageKit calls this replay. One of the examples 6328 uses is when they used a log to diagnose an issue with the way they tracked vision targets, adjusted it, then used replay to confirm that the change would have produced the correct outputs with the same inputs.
AdvantageKit is a mature and developed framework for this type of logging that should continue to be maintained for the foreseeable future.
AdvantageKit is closely integrated with AdvantageScope, a log and sim viewer built by 6328.
Drawbacks#
Running this amount of logging has performance overhead on the rio, using valuable cpu time each loop. Logging also requires a non-insignificant architecture change to our codebase by using an IO layer under each of our subsystems. While this does require some additional effort to write subsystems, it also makes simulating subsystems easier so it is a worthwhile tradeoff.
8033-specific usage of AdvantageKit features will be covered in more detail in the next couple of lessons.
Resources#
Examples#
Exercises#
- Follow this tutorial to add AdvantageKit to your kitbot code.
Notes#
- See the AdvantageKit Structure Reference article for more on the IO layer structure
- Here are some logs from our 2023-2024 season