-
Notifications
You must be signed in to change notification settings - Fork 614
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 wait command to receive a supplier #6239
Comments
As an alternative, you can also use DeferredCommand around a wait command:
I think this is a good addition, though. Re: memory concerns |
Shouldn't the supplier be polled at schedule/init (like DeferredCommand and multiple others) and not constantly? Also, given DeferredCommand, I'm wondering whether we should be directing to it rather than adding deferred overloads for everything. |
Closing as wontfix. DeferredCommand can solve this issue:
This isn't a common enough use case to warrant syntax sugar, imo. The memory worries shouldn't be a problem, and with the 2027 controller won't be a consideration at all. |
Is your feature request related to a problem? Please describe.
When testing our shooter we wanted to have a network tables value dictate the length of the delay between two actions (turning on one motor then another). We found that since the wait command only takes the delay as a constructor parameter at initialization.
Describe the solution you'd like
Have an alternate constructor which takes a double supplier for the delay seconds.
Describe alternatives you've considered
Recreating the sequential command group each time the button is pressed seems wasteful of memory and quite frankly we couldn't figure out how to do it.
Additional context
We have a modified version of the WaitCommand class provided here as an example. We will follow this up with a pull request.
The text was updated successfully, but these errors were encountered: