Skip to content

Commit 57ea11b

Browse files
committed
Merge branch 'upstream'
2 parents 9d664b2 + 4109e8c commit 57ea11b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

commands2/src/cpp/frc2/command/Subsystem.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ void Subsystem::SetDefaultCommand(std::shared_ptr<Command> defaultCommand) {
2121
defaultCommand);
2222
}
2323

24+
void Subsystem::RemoveDefaultCommand() {
25+
CommandScheduler::GetInstance().RemoveDefaultCommand(this);
26+
}
27+
2428
std::shared_ptr<Command> Subsystem::GetDefaultCommand() {
2529
return CommandScheduler::GetInstance().GetDefaultCommand(this);
2630
}

commands2/src/include/frc2/command/Subsystem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ class Subsystem {
7979
*/
8080
void SetDefaultCommand(std::shared_ptr<Command> defaultCommand);
8181

82+
/**
83+
* Removes the default command for the subsystem. This will not cancel the
84+
* default command if it is currently running.
85+
*/
86+
void RemoveDefaultCommand();
87+
8288
/**
8389
* Gets the default command for this subsystem. Returns null if no default
8490
* command is currently associated with the subsystem.

0 commit comments

Comments
 (0)