Package edu.wpi.first.wpilibj2.command
Class SubsystemBase
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.SubsystemBase
-
- Direct Known Subclasses:
PIDSubsystem,ProfiledPIDSubsystem,TrapezoidProfileSubsystem
public abstract class SubsystemBase extends Object implements Subsystem, Sendable
A base for subsystems that handles registration in the constructor, and provides a more intuitive method for setting the default command.
-
-
Constructor Summary
Constructors Constructor Description SubsystemBase()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(String name, Sendable child)Associates aSendablewith this Subsystem.StringgetName()Gets the name of this Subsystem.StringgetSubsystem()Gets the subsystem name of this Subsystem.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.voidsetName(String name)Sets the name of this Subsystem.voidsetSubsystem(String subsystem)Sets the subsystem name of this Subsystem.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
getCurrentCommand, getDefaultCommand, periodic, register, setDefaultCommand
-
-
-
-
Method Detail
-
getName
public String getName()
Gets the name of this Subsystem.
-
setName
public void setName(String name)
Sets the name of this Subsystem.
-
getSubsystem
public String getSubsystem()
Gets the subsystem name of this Subsystem.- Specified by:
getSubsystemin interfaceSendable- Returns:
- Subsystem name
-
setSubsystem
public void setSubsystem(String subsystem)
Sets the subsystem name of this Subsystem.- Specified by:
setSubsystemin interfaceSendable- Parameters:
subsystem- subsystem name
-
addChild
public void addChild(String name, Sendable child)
Associates aSendablewith this Subsystem. Also update the child's name.- Parameters:
name- name to give childchild- sendable
-
initSendable
public void initSendable(SendableBuilder builder)
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-
-