|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <concurrent_command.hpp>


Public Member Functions | |
| ConcurrentTemplateCommand (std::array< Command *, COMMANDS > commands, const char *name) | |
| const char * | getName () const override |
| bool | isReady () override |
| void | initialize () override |
| void | execute () override |
| void | end (bool interrupted) override |
| bool | isFinished () const override |
Public Member Functions inherited from tap::control::Command | |
| Command () | |
| virtual | ~Command () |
| mockable subsystem_scheduler_bitmap_t | getRequirementsBitwise () const |
| int | getGlobalIdentifier () const |
| mockable void | addSubsystemRequirement (Subsystem *requirement) |
Additional Inherited Members | |
Protected Attributes inherited from tap::control::Command | |
| command_scheduler_bitmap_t | commandRequirementsBitwise = 0 |
A command that runs multiple commands in parallel. Waits for all passed in commands to be ready before being ready itself. When RACE is false, it continues executing until all passed in commands have finished and then the concurrent command finishes. When RACE is true, only one passed in command needs to finish for the concurrent command to finish.
|
inline |
|
inlineoverridevirtual |
The action to take when the command ends. Called when either the command finishes normally, or when it interrupted/canceled.
| [in] | interrupted | whether the command was interrupted/canceled. |
Implements tap::control::Command.
|
inlineoverridevirtual |
The main body of a command. Called repeatedly while the command is scheduled by a CommandScheduler.
Implements tap::control::Command.
|
inlineoverridevirtual |
Implements tap::control::Command.
|
inlineoverridevirtual |
The initial subroutine of a command. Called once when the command is initially scheduled by a CommandScheduler.
Note that command instances are re-used: a single command could be initialized, run, finished, then later initialized again. Ensure that initialize() resets any state stored in the command!
Implements tap::control::Command.
|
inlineoverridevirtual |
Whether the command has finished. Once a Command finishes, the scheduler will call the end() function and un-schedule it. If a Command is naturally finished (i.e. isFinished() == true), then the CommandScheduler will pass in false to end(). If, for example, another Command is added that in turn stops the Command from executing, then the CommandScheduler will pass in true to end().
Implements tap::control::Command.
|
inlineoverridevirtual |
A check called right before a command is scheduled to determine whether or not a command should be scheduled. If return is true then the command is scheduled, if false then the command is not scheduled.
Not forced to be overridden, returns true by default.
Reimplemented from tap::control::Command.