-
Notifications
You must be signed in to change notification settings - Fork 613
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
[commands] Clarified error messages for parallel composition commands #7161
base: main
Are you sure you want to change the base?
Conversation
This PR modifies commands. Please open a corresponding PR in Python Commands and include a link to this PR. |
|
/format |
You'll need to install and run wpiformat yourself, the PR format command will not work if the PR is based on your main branch. For the future, it's best to make a branch for each PR. |
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.
We should only include the subsystems that are actually conflicting, since if we just report which ones the added command requires, we aren't actually communicating information that couldn't be found in other ways.
…between commands in a parallel group
var currentRequirements = getRequirements(); | ||
if (!Collections.disjoint(command.getRequirements(), currentRequirements)) { | ||
String requirementsStr = command.getRequirements() | ||
.stream() |
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.
The Stream API is really inefficient (for these use cases) and is generally avoided in the WPILib codebase
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.
I feel like it’s probably fine to use the stream api here, even if it’s slow, because this code will only run when an error happens anyways
Addresses Issue #6353.