ParallelRaceGroup

class ParallelRaceGroup : public Command

Runs multiple Command s at once, with the command ending once the first command finishes.

Public Functions

inline ParallelRaceGroup(const std::initializer_list<Command*> commands)

Create a new ParallelRaceGroup given a initializer list of commands.

Warning

No Commands in the parallel can require the same hardware! If this happens the code will immediately abort

Parameters:

commands – Initializer list of Command s to run in this parallel

inline virtual void initialize() override

Initialize all commands in the ParallelRaceGroup

inline virtual void execute() override

Runs all the active commands in the ParallelRaceGroup and check if any are done

inline virtual bool isFinished() override

Returns true if any commands is finished.

Returns:

True if any commands is finished

inline virtual void end(bool interrupted) override

Ends all commands with the ones that should be interrupted being interrupted.

Parameters:

interrupted – Ends all commands based on if they are done or not

inline virtual std::vector<Subsystem*> getRequirements() override

Gets all the required subsystems for this ParallelRaceGroup.

Returns:

Set of all requirements of all the command