Class AbstractSubsystemCommandFactory<TSubsystem extends AbstractSubsystem<?>>

java.lang.Object
frc.robot.shared.commands.AbstractSubsystemCommandFactory<TSubsystem>
Type Parameters:
TSubsystem - subsystem type that commands will operate on
Direct Known Subclasses:
AbstractSetAndSeekCommandFactory, AbstractVelocityCommandFactory, DriveBaseSubsystemCommandFactory, GameplayStateCommandFactory

public abstract class AbstractSubsystemCommandFactory<TSubsystem extends AbstractSubsystem<?>> extends Object
Base factory for building commands tied to a single subsystem instance.

Extend this in each subsystem package to keep command creation centralized.

  • Field Details

    • subsystem

      protected final TSubsystem extends AbstractSubsystem<?> subsystem
      Subsystem instance shared by all commands created by this factory.
  • Constructor Details

    • AbstractSubsystemCommandFactory

      protected AbstractSubsystemCommandFactory(TSubsystem subsystem)
      Creates a command factory bound to the given subsystem so derived commands can share it. Call from subsystem-specific factory constructors when wiring commands.
      Parameters:
      subsystem - the subsystem instance that commands produced by this factory will operate on
  • Method Details

    • getSubsystem

      public TSubsystem getSubsystem()
      Exposes the shared subsystem instance so callers can apply configuration or tuning hooks.
      Returns:
      subsystem that generated commands will operate on