-
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
Allow loop epochs to be logged to DataLog and published to NT #5375
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Huh. How did Actions screw up that badly? |
This comment was marked as outdated.
This comment was marked as outdated.
Yeah something is really messed up with that action... there was some changes made to wpiformat recently that may have broken it. |
Emergency PR time! |
Do you need help with the c++ implementation? |
Allow user-specified data log entry
A little bit, the thing with |
This comment was marked as resolved.
This comment was marked as resolved.
/format We're good! |
You can't directly concatenate If you upload what code you have I can help out better. |
Use .count() on epoch times
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some naming notes: publishToNetworkTables
and startDataLog
is unclear for CommandScheduler
and IterativeRobotBase
because it isn't immediately obvious what is being published or logged. (I don't think this isn't a problem for Tracer
or Watchdog
because those classes should provide enough context, whereas the other cases have too many other possibilities)
wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandScheduler.java
Outdated
Show resolved
Hide resolved
wpilibNewCommands/src/main/native/include/frc2/command/CommandScheduler.h
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
Outdated
Show resolved
Hide resolved
|
I've done some more thinking, and I think that making |
What's blocking this PR? |
Perhaps use the structured data support that #5391 will add to encode the epochs as a single topic/property? |
Multiple topics is the right approach here. While structured data could be used, you would have to use protobuf (higher overhead) and send the string names on every update (a lot higher overhead). It does feel like we need to figure out a good api shape for nesting dynamic topics or even other Sendables within Sendable without requiring NTSendable. |
Maybe It also conveniently allows values to be updated independently without needing |
#5180? It still has some design decisions needed, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have corresponding unpublish
/stop
methods?
wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
Outdated
Show resolved
Hide resolved
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
I've fixed the CMake failure in #6403. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The technical debt here isn't great, but we don't have a better solution at the moment so I agree this is worth it.
Most of this looks good, just has some resource closing issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watchdog should close its tracer
Includes methods to enable DataLog logging or NT publishing. The first time an epoch is added, an NT publisher is created and a DataLog entry is started (if they're enabled), both of which are cached for future use. Everytime an epoch is added, it gets published to NT and logged to DataLog (if they're enabled). Addresses a part of #5314. Resolves #609.