mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[commands] C++: Add CommandPtr overload for SetDefaultCommand (#4488)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace frc2 {
|
||||
class Command;
|
||||
class CommandPtr;
|
||||
/**
|
||||
* A robot subsystem. Subsystems are the basic unit of robot organization in
|
||||
* the Command-based framework; they encapsulate low-level hardware objects
|
||||
@@ -71,6 +72,17 @@ class Subsystem {
|
||||
this, std::forward<T>(defaultCommand));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default Command of the subsystem. The default command will be
|
||||
* automatically scheduled when no other commands are scheduled that require
|
||||
* the subsystem. Default commands should generally not end on their own, i.e.
|
||||
* their IsFinished() method should always return false. Will automatically
|
||||
* register this subsystem with the CommandScheduler.
|
||||
*
|
||||
* @param defaultCommand the default command to associate with this subsystem
|
||||
*/
|
||||
void SetDefaultCommand(CommandPtr&& defaultCommand);
|
||||
|
||||
/**
|
||||
* Gets the default command for this subsystem. Returns null if no default
|
||||
* command is currently associated with the subsystem.
|
||||
|
||||
Reference in New Issue
Block a user