[commands] Add RepeatCommand (#4009)

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
Excalibur FRC | 6738
2022-04-08 08:02:08 +03:00
committed by GitHub
parent 88222daa3d
commit 1b26e2d5da
8 changed files with 359 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ class ParallelDeadlineGroup;
class SequentialCommandGroup;
class PerpetualCommand;
class ProxyScheduleCommand;
class RepeatCommand;
/**
* A state machine representing a complete action to be performed by the robot.
@@ -185,6 +186,14 @@ class Command {
*/
virtual PerpetualCommand Perpetually() &&;
/**
* Decorates this command to run repeatedly, restarting it when it ends, until
* this command is interrupted. The decorated command can still be canceled.
*
* @return the decorated command
*/
virtual RepeatCommand Repeat() &&;
/**
* Decorates this command to run "by proxy" by wrapping it in a
* ProxyScheduleCommand. This is useful for "forking off" from command groups