My team is looking into logging for the upcoming season, and we have found pretty good information on good ways to log native values or Struct values, but we are still looking for a good way to log a Sendable. I know that you can use SmartDashboard.putData(...) to send a Sendable like a Mechanism2d over NetworkTables that you can then view in Advantage Scope. Our issue with this is that it does not show up in the .wpilog file saved after the match, and we would love to be able to see our mechanisms in log replay. I found that using DogLog and using the record all NT data option recorded it, but it also recorded a lot of other data we didn’t want. Is there a way to just record a Mechanism2d and or generic Sendable to a data log?
I cannot recommend enough using advantage kit and advantage scope for anything you want to log. Advantage kit isnt just a simulation tool, but also a logging tool. My team uses it for only the ladder, and its been fantastic. Pretty easy to set up if you follow the advantage kit docs.
We for sure use replay to check on things. We haven’t used it at an official event yet, and it has been extremely helpful. We are very excited to use it at an event. Its super helpful for both visualizations and understanding what your robot is doing.
WPILib’s DataLogManager automatically captures all data published to NetworkTables. If you call DataLogManager.start() and publish a sendable using SmartDashboard.putData("MyField", ...), it should appear in the log under the key NT:/SmartDashboard/MyField and be viewable in AdvantageScope. If you’re having trouble with that setup, it would be helpful if you can post your code and a log file from DataLogManager.
AdvantageKit definitely isn’t the right solution for this problem. AdvantageKit is only intended for teams interested in simulation replay, while it sounds like your goal is just to capture data to a file. DataLogManager is the intended solution for doing that.
Thank you so much for the response! This seems like the fix we were looking for! Small additional question, would calling DataLogManager.start() also log information from another device on NetworkTables like a Limelight?