-
Notifications
You must be signed in to change notification settings - Fork 18
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
[BUG]: NetworkButton quirks? #83
Comments
I don't know if the behavior is correct or not, but it appears that Java has the same behavior (https://github.com/wpilibsuite/allwpilib/blob/b44a80c07a809cf4e1d1d10abc9afa2bac648da5/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/NetworkButton.java#L35)... @PeterJohnson you added that as part of NT4 upgrades, any thoughts on this? |
"Node" here means any NetworkTables client. Since the robot code is a server, this checks to see if there's any NetworkTables client connected to the server. Thus, isConnected() should be returning true when Shuffleboard is connected. |
Shall that also apply in the context of running an XRP via simulation? The simulation UI is already up and running. Is that considered as a "shuffleboard" running? So, is this a bug that isConnected() should have returned true? |
The simulation UI is not an NT client (it's actually an NT server), so isConnected would not return true according to what Peter said above. You would need to connect shuffleboard or some other NT client to your simulation for isConnected to return true. |
This perhaps is overly conservative behavior and we should allow local changes (including both the Sim GUI and robot code) to trigger NetworkButton as well? |
That seems reasonable, but probably shouldn't be done in-season. |
You could change the simulation GUI to create a new NT instance and connect to the default instance? That would be fine to introduce in-season and perhaps would be closer to a real dashboard. |
That's a substantial change, and not one I think I want to do even after the season. The simulation GUI has always presented the NT view from the robot perspective. |
Problem description
The code snippet below adds a boolean switch onto shuffleboard. Strangely, line 3 works, but line 4 doesn't.
My investigation found that the difference in line 4 is that its implementation uses an
isConnected()
whose document sounds weird: "Return whether or not the instance is connected to another node." What does it mean by "another node"? I am currently just debugging an XRP running locally; isn't it always connected to the current and only node?BTW, could a future version of NetworkButton also has line 1 built-in, so that the users won't need to deal with that quirk?
Operating System
Linux
Installed Python Packages
Reproducible example code
The text was updated successfully, but these errors were encountered: