-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programming Advantagescope logging #14
Comments
AdvantageKit is 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. A variety of logging frameworks already exist in FRC, from built-in tools like the Driver Station and WPILib logging all the way to fully custom solutions. Most of these frameworks follow a similar structure, which looks this: A limited set of values are provided by the robot code and stored in the log. That could include sensor data, PID error, odometry pose, output commands, etc. While this has enormous value, it doesn't solve the eternal sentiment when something goes wrong: "If only we were logging one extra field!" Notice above that there is data flowing in and out of the robot code without being saved to the log file. AdvantageKit takes a different approach. This is what logging looks like with AdvantageKit: Instead of logging a limited set of values from the user code, AdvantageKit records all of the data flowing into the robot code. Every sensor value, button press, and much more is logged every loop cycle. After a match, these values can be replayed to the robot code in a simulator. Since every input command is the same, all of the internal logic of the code is replayed exactly. This allows you to log extra fields after the fact, or modify pipelines to see how they would have functioned during the match. This technique means that logging is more than just a tool for checking on specific issues; it's also a safety net that can be used to verify how any part of the code functions. In other words, we could replay the original logs, along with a new log file generated, which is based on the code that was used in that moment but with the new data generated. When replaying the logs we should not change the behavior of the robot, but we can log new values based on the ones we already have, and see how they would have behaved in that moment. Code example: Now with advantage kit working |
Something to point out, is that we would be required to have a USB stick on the RoboRIO's USB port so the code could be logged with advantage kit. |
Also another comment on this. If we want to log the battery, Network Table Clients, current commands, etc. We have to add that code manually. Fortunate enough, out friends from Mechanical Advantage already did that, so we just have to write a similar code(the exact same) of what they have in theirs, but in ours. |
To be implement it into the code, the recommended way is:
|
No description provided.
The text was updated successfully, but these errors were encountered: