-
Notifications
You must be signed in to change notification settings - Fork 615
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 method to set selected option in SendableChooser #6252
Conversation
This doesn't obey the sim/non-sim class split. Users shouldn't be able to call SetSelected() in non-sim robot code (sim objects are no-ops in non-sim). |
Should I wrap it in |
SendableChooser is still using a key-value system like HALSIM in the form of NT. Teams already complain about how much sim and non-sim code is mixed, and this change conflates them further. |
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.
Rather than adding a new test, the existing tests should use SendableChooserSim rather than what they do now.
wpilibc/src/main/native/include/frc/simulation/SendableChooserSim.h
Outdated
Show resolved
Hide resolved
wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SendableChooserSim.java
Outdated
Show resolved
Hide resolved
Is there value in being able to select from code regardless of sim? |
That’s what the set default option is for. It should theoretically be safe to use NT setDefault() to set the selected value (as this will not override the dashboard set value), but this is not exposed on the Sendable interface. |
Resolves #3731