Log message on robot mode changes#1923
Conversation
|
Very good addition. Is it possible to include match time too? |
|
If that's in NT, yeah absolutely |
|
@crschardt I don't see it in https://github.com/wpilibsuite/allwpilib/blob/main/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java#L106 . Maybe time for a feature request? |
mcm001
left a comment
There was a problem hiding this comment.
Let's also publish with it match number/type/event name/etc?
crschardt
left a comment
There was a problem hiding this comment.
Added. It's logging the match info on each mode change (if the data is available). I can change that if you would prefer only logging once when the data becomes available.
|
This seems reasonable to me! Net positive and no net negative to this afaict. Thank you!! |
crschardt
left a comment
There was a problem hiding this comment.
I can't test it without an FMS or some hack to publish match data to NT. (lol) Any suggestions?
|
We could test using one of our photonlib examples running a robot sim, which will publish to FMSInfo. I could have added unit tests but its hard to make assertions against console output and I'm lazy. |
Description
Log messages to the logger immediately at startup and then every time the value changes using a NT listener.
I left some comments about potential data races. I haven't had issues yet.
Meta
Merge checklist: