Conditional Command

The ConditionalCommand will run one command or another based on a condtion that must be met.

Example

1
2
3
4
5
// Base parameters
new ConditionalCommand(trueCommand, falseCommand, boolean condition);

// Use case
new ConditionalCommand(new DriveForward(), new DriveReverse(), isLimitHit());
1
frc2::ConditionalCommand(trueCommand, falseCommand, [&limit] {return isLimitHit();});