Class AbstractSubsystemCommand<TSubsystem extends AbstractSubsystem<?>>

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.shared.commands.AbstractSubsystemCommand<TSubsystem>
Type Parameters:
TSubsystem - subsystem type this command operates on
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
Direct Known Subclasses:
AbstractIdleVelocityCommand, AbstractSetAndSeekCommand, AbstractVelocityCommand, HoldHarvesterDeployedPositionCommand, MoveFieldManualCommand, MoveFieldManualWithHeadingCommand, SetAndSeekSettleCommand, TrackFieldTargetCommand

public abstract class AbstractSubsystemCommand<TSubsystem extends AbstractSubsystem<?>> extends edu.wpi.first.wpilibj2.command.Command
Lightweight base command that ties a command to a single subsystem and logs when it starts. Subclasses should override the lifecycle hooks as needed for command behavior.
  • Nested Class Summary

    Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command

    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Logger
    Logger scoped to the concrete command class.
    protected final TSubsystem
    Subsystem instance this command requires and operates on.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a subsystem-scoped command and registers the requirement.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    protected void
    Optional hook for subclasses to run logic during initialize after the start log.

    Methods inherited from class edu.wpi.first.wpilibj2.command.Command

    addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, end, execute, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isFinished, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • subsystem

      protected final TSubsystem extends AbstractSubsystem<?> subsystem
      Subsystem instance this command requires and operates on.
    • log

      protected final Logger log
      Logger scoped to the concrete command class.
  • Constructor Details

    • AbstractSubsystemCommand

      protected AbstractSubsystemCommand(TSubsystem subsystem)
      Creates a subsystem-scoped command and registers the requirement.
      Parameters:
      subsystem - subsystem instance this command will control
  • Method Details

    • initialize

      public final void initialize()
      Overrides:
      initialize in class edu.wpi.first.wpilibj2.command.Command
    • onInitialize

      protected void onInitialize()
      Optional hook for subclasses to run logic during initialize after the start log.