Class SubsystemBase

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
All Implemented Interfaces:
Sendable, Subsystem
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.

This class is provided by the NewCommands VendorDep

  • Constructor Details

    • SubsystemBase

      public SubsystemBase()
      Constructor. Telemetry/log name defaults to the classname.
    • SubsystemBase

      public SubsystemBase(String name)
      Constructor.
      Parameters:
      name - Name of the subsystem for telemetry and logging.
  • Method Details

    • getName

      public String getName()
      Gets the name of this Subsystem.
      Specified by:
      getName in interface Subsystem
      Returns:
      Name
    • setName

      public void setName(String name)
      Sets the name of this Subsystem.
      Parameters:
      name - name
    • getSubsystem

      public String getSubsystem()
      Gets the subsystem name of this Subsystem.
      Returns:
      Subsystem name
    • setSubsystem

      public void setSubsystem(String subsystem)
      Sets the subsystem name of this Subsystem.
      Parameters:
      subsystem - subsystem name
    • addChild

      public void addChild(String name, Sendable child)
      Associates a Sendable with this Subsystem. Also update the child's name.
      Parameters:
      name - name to give child
      child - sendable
    • initSendable

      public void initSendable(SendableBuilder builder)
      Description copied from interface: Sendable
      Initializes this Sendable object.
      Specified by:
      initSendable in interface Sendable
      Parameters:
      builder - sendable builder