WPILibC++ 2024.3.2
frc2::SequentialCommandGroup Class Reference

A command composition that runs a list of commands in sequence. More...

#include <frc2/command/SequentialCommandGroup.h>

Inheritance diagram for frc2::SequentialCommandGroup:
frc2::CommandHelper< Command, SequentialCommandGroup >

Public Member Functions

 SequentialCommandGroup (std::vector< std::unique_ptr< Command > > &&commands)
 Creates a new SequentialCommandGroup. More...
 
template<wpi::DecayedDerivedFrom< Command >... Commands>
 SequentialCommandGroup (Commands &&... commands)
 Creates a new SequentialCommandGroup. More...
 
 SequentialCommandGroup (SequentialCommandGroup &&other)=default
 
 SequentialCommandGroup (const SequentialCommandGroup &)=delete
 
 SequentialCommandGroup (SequentialCommandGroup &)=delete
 
template<wpi::DecayedDerivedFrom< Command >... Commands>
void AddCommands (Commands &&... commands)
 Adds the given commands to the group. More...
 
void Initialize () final
 
void Execute () final
 
void End (bool interrupted) final
 
bool IsFinished () final
 
bool RunsWhenDisabled () const override
 
Command::InterruptionBehavior GetInterruptionBehavior () const override
 
void InitSendable (wpi::SendableBuilder &builder) override
 
- Public Member Functions inherited from frc2::CommandHelper< Command, SequentialCommandGroup >
 CommandHelper ()=default
 
CommandPtr ToPtr () &&override
 

Additional Inherited Members

- Protected Member Functions inherited from frc2::CommandHelper< Command, SequentialCommandGroup >
std::unique_ptr< CommandTransferOwnership () &&override
 

Detailed Description

A command composition that runs a list of commands in sequence.

The rules for command compositions apply: command instances that are passed to it are owned by the composition and cannot be added to any other composition or scheduled individually, and the composition requires all subsystems its components require.

This class is provided by the NewCommands VendorDep

Constructor & Destructor Documentation

◆ SequentialCommandGroup() [1/5]

frc2::SequentialCommandGroup::SequentialCommandGroup ( std::vector< std::unique_ptr< Command > > &&  commands)
explicit

Creates a new SequentialCommandGroup.

The given commands will be run sequentially, with the composition finishing when the last command finishes.

Parameters
commandsthe commands to include in this composition.

◆ SequentialCommandGroup() [2/5]

template<wpi::DecayedDerivedFrom< Command >... Commands>
frc2::SequentialCommandGroup::SequentialCommandGroup ( Commands &&...  commands)
inlineexplicit

Creates a new SequentialCommandGroup.

The given commands will be run sequentially, with the composition finishing when the last command finishes.

Parameters
commandsthe commands to include in this composition.

◆ SequentialCommandGroup() [3/5]

frc2::SequentialCommandGroup::SequentialCommandGroup ( SequentialCommandGroup &&  other)
default

◆ SequentialCommandGroup() [4/5]

frc2::SequentialCommandGroup::SequentialCommandGroup ( const SequentialCommandGroup )
delete

◆ SequentialCommandGroup() [5/5]

frc2::SequentialCommandGroup::SequentialCommandGroup ( SequentialCommandGroup )
delete

Member Function Documentation

◆ AddCommands()

template<wpi::DecayedDerivedFrom< Command >... Commands>
void frc2::SequentialCommandGroup::AddCommands ( Commands &&...  commands)
inline

Adds the given commands to the group.

Parameters
commandsCommands to add, in order of execution.

◆ End()

void frc2::SequentialCommandGroup::End ( bool  interrupted)
final

◆ Execute()

void frc2::SequentialCommandGroup::Execute ( )
final

◆ GetInterruptionBehavior()

Command::InterruptionBehavior frc2::SequentialCommandGroup::GetInterruptionBehavior ( ) const
override

◆ Initialize()

void frc2::SequentialCommandGroup::Initialize ( )
final

◆ InitSendable()

void frc2::SequentialCommandGroup::InitSendable ( wpi::SendableBuilder builder)
override

◆ IsFinished()

bool frc2::SequentialCommandGroup::IsFinished ( )
final

◆ RunsWhenDisabled()

bool frc2::SequentialCommandGroup::RunsWhenDisabled ( ) const
override

The documentation for this class was generated from the following file: