-
Notifications
You must be signed in to change notification settings - Fork 611
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
Add loop timing telemetry #609
Comments
Could this also be exposed through an API inside user software? Being able to read it directly (rather than only NT) would be useful to us. |
@gerth2 One can already read directly from NT on the robot (without having to wait for updates), so that shouldn't be a problem. |
Yeah, I've been bit by this sort of thing a lot. It would be good to do this. |
Would a histogram of execution times be useful as well? Definitely wouldn't be needed at first-pass, but our team would find use in it. |
@gerth2 if you have a NT client that logs the values as they are updated, you could rather easily use your favourite data analysis tools to create a histogram from that. |
@auscompgeek makes sense! |
Hasn't this been resolved by the |
My understanding is that there is still no fine-grained timing telemetry for the command scheduler, which would definitely be desirable. |
There is a |
What's implemented now doesn't address the intent of the original post. The idea is that Tracer data would be published to NetworkTables so teams can easily see it on every loop iteration (well, it gets actually sent out at 100ms by NT and intermediate values are dropped, so network I/O shouldn't be too bad). Watchdog only warns on overruns, but it's useful to know how much of the timing budget you're using in nominal cases too. Having more information like this makes it easier to optimize or find performance concerns early and fix them. (In other words, "the first rule of performance is to measure".) |
So perhaps a method in |
For C++, you could create a simple void Periodic() {
frc::ScopedTracer timer(m_telemetryEntry);
...
} |
Why can't C++ get the same treatment as Java and just have the data published to a listener? |
You can create a similar version of a The main point I was trying to make was that it would be nice for the C++ variant to be scoped so that teams wouldn't have to call start() and stop() manually (or whatever the API ends up being for Java). |
You missed my point. I think that the team can (and should) be responsible for posting the data to wherever they want, whether it be NT, |
Yes, I agree. As I pointed in my last comment, the primary constructor should be a listener, but we can have a secondary constructor that takes in an NT Entry (which calls the primary constructor internally) because that is a common use case and specifically requested by the OP. |
I want to avoid the middleman "dummy" class - just have an overload that takes an NTEntry, and calls the lambda overload with |
* Use dynamic width for sidebar version picker * Update frc-rtd.css * Remove unnecessary width override * Landscape support
It would be useful for users to know loop timing of various pieces of their code. This should be published via NT so it can be recorded and played back on the dashboard. For command based this could be pretty fine-grained.
The text was updated successfully, but these errors were encountered: