mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[commands] Add Subsystem.idle() (#7815)
This commit is contained in:
@@ -46,6 +46,10 @@ void Subsystem::Register() {
|
||||
return CommandScheduler::GetInstance().RegisterSubsystem(this);
|
||||
}
|
||||
|
||||
CommandPtr Subsystem::Idle() {
|
||||
return cmd::Idle({this});
|
||||
}
|
||||
|
||||
CommandPtr Subsystem::RunOnce(std::function<void()> action) {
|
||||
return cmd::RunOnce(std::move(action), {this});
|
||||
}
|
||||
|
||||
@@ -121,6 +121,15 @@ class Subsystem {
|
||||
*/
|
||||
void Register();
|
||||
|
||||
/**
|
||||
* Constructs a command that does nothing until interrupted. Requires this
|
||||
* subsystem.
|
||||
*
|
||||
* @return the command
|
||||
*/
|
||||
[[nodiscard]]
|
||||
CommandPtr Idle();
|
||||
|
||||
/**
|
||||
* Constructs a command that runs an action once and finishes. Requires this
|
||||
* subsystem.
|
||||
|
||||
Reference in New Issue
Block a user