Closed Oblarg closed 1 year ago
We had this problem with SelectCommand, which is why we moved the deferred functionality to ProxyCommand: when the command's construction is deferred, there's no way to figure out requirements etc. Hence, deferred are proxied.
DeferredCommand would declare its requirements normally, and because it would wrap the supplied command internally it would sidestep the current problem ProxyCommand has with the proxied command's requirements possibly conflicting with those of the group it's composed in.
That requires duplicate declaration of requirements, which is easy to miss.
Not if we use subsystem factories to do the requirements implicitly.
Not really... in my experience, most of the cases for deferred command construction is for multi-requirement commands.
I've seen a bunch of teams using it to do runtime state dependencies in their commands (e.g. generating a trajectory and then following it), which seems like a reasonable case that we should support in a way that handles the requirements correctly "by default." Currently we don't.
This would work similarly to
ProxyCommand
except it would not expose the wrapped command to the scheduler, making it more suitable for composition inside of single-subsystem command groups (ProxyCommand
is designed for forking off to an unrelated requirement, and the semantics there are not well-suited to deferred execution inside of an ordinary composition).A
deferred()
factory method should be added, as well.