Comments (3)
Given how trivial it is to convert between the two using Set.of
/Set.toArray
, I don't think we should duplicate everything for rare cases.
from allwpilib.
One case I'm assuming you're referring to is Defer
, which uses Set<Subsystem>
so that not passing any requirements is explicit.
addRequirements
has overloads for both, especially as getRequirements
returns a Set
.
What others are there?
from allwpilib.
The cases I could find:
CommandScheduler.cancel(Command...)
- Having aCollection<Command>
overload would probably be fine, but there isn't a clear use-case for canceling aCollection<Command>
, and in general we avoid adding stuff that nobody would use.CommandScheduler.isScheduled(Command...)
- I honestly don't know when this method is called with more than one argument, let alone with a collection.CommandScheduler.registerComposedCommands(Command...)
- ACollection<Command>
overload would be useful forSelectCommand
, though it wouldn't have any other uses. (I'd probably make aSet<Command>
overload that skips the check for duplicates, and have theCommand...
andCollection<Command>
overloads just do the duplicate checks)CommandScheduler.registerSubsystem(Subsystem...)
- I honestly don't know when this method is called with more than one argument, let alone with a collection. (The name is singular, too)CommandScheduler.schedule(Command...)
- We discourage manually callingschedule()
in user code, and the only times I saw a single call being used to schedule multiple commands at a time, it was with varargs, not an already existing array object. (RobotDisabledCommandTest.java#L124, RobotDisabledCommandTest.java#L148, and CommandScheduleTest#L71)CommandScheduler.unregisterSubsystem(Subsystem...)
- I honestly don't know when this method is called with more than one argument, let alone with a collection. (The name is singular, too)Command.addRequirements(Subsystem...)
- This is covered in #6304- Command decorators, factories and constructors that use multiple commands (
Command.alongWith(Command...)
,Command.andThen(Command...)
,Command.deadlineFor(Command...)
,Command.deadlineWith(Command...)
(deprecated),Command.raceWith(Command...)
,Commands.deadline(Command, Command...)
,Commands.parallel(Command...)
,Commands.race(Command...)
,Commands.repeatingSequence(Command...)
,Commands.sequence(Command...)
,ParallelCommandGroup(Command...)
,ParallelDeadlineGroup(Command, Command...)
,ParallelRaceGroup(Command...)
,ScheduleCommand(Command...)
,SequentialCommandGroup(Command...)
,SequentialCommandGroup.addCommands(Command...)
)
I'm ambivalent with these- I don't know of any cases where having aCollection<Command>
overload would be useful, but someone might be able to provide an example. - Command decorators, factories and constructors that use requirements (
Command.andThen(Runnable, Subsystem...)
,Command.beforeStarting(Runnable, Subsystem...)
,Commands.idle(Subsystem...)
,Commands.run(Runnable, Subsystem...)
,Commands.runEnd(Runnable, Runnable, Subsystem...)
,Commands.runOnce(Runnable, Subsystem...)
,Commands.startEnd(Runnable, Runnable, Subsystem...)
,Commands.startRun(Runnable, Runnable, Subsystem...)
,FunctionalCommand(Runnable, Runnable, Consumer<Boolean>, BooleanSupplier, Subsystem...)
,InstantCommand(Runnable, Subsystem...)
,MecanumControlCommand(...)
(4 overloads),NotifierCommand(Runnable, double, Subsystem...)
,PIDCommand(...)
(2 overloads),ProfiledPIDCommand(...)
(4 overloads),RamseteCommand(...)
(2 overloads, deprecated),RunCommand(Runnable, Subsystem...)
,StartEndCommand(Runnable, Runnable, Subsystem...)
,SwerveControllerCommand(...)
(4 overloads),TrapezoidProfileCommand(...)
(1 overload))
I could see the case for making overloads that take aSet<Subsystem>
for the requirements.
from allwpilib.
Related Issues (20)
- Improve the Java Units Library with additional methods and unit types HOT 4
- Sim GUI does not disable joystick data in auto mode
- [wpimath] Remove or deprecate unused WheelPositions interface/concept HOT 4
- Provide a way to flush NetworkTables to the wire immediately HOT 8
- Question about New Radio from Vivid Hosting wireless connection HOT 4
- NetworkTables server crashes when publishers are rapidly created and closed HOT 6
- Closing NetworkTables publisher doesn't flush queued data HOT 3
- Use Jinja to generate PWM motor controller classes
- Include sendable type information in topic metadata
- [Build] Consider breaking up wpimath / geometry classes HOT 5
- Make encoder classes unit-aware
- Feedforward Javadocs use incorrect terminology
- Consider adding VirtualSubsystems? HOT 2
- Add DataLog support for logging stdout/stderr
- Add 2D addressable LED display class
- Rotation2d(0,0) should be some sort of NaN HOT 19
- Synchronize C++ and Java versions of BooleanEvent HOT 1
- Trigger.onChange has no test HOT 3
- cmake build broken as of 2024.1.1 HOT 11
- WPIMath JNI classes should use single runtime loader
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allwpilib.