Package frc.robot.shared.commands
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
FieldsModifier and TypeFieldDescriptionprotected final LoggerLogger scoped to the concrete command class.protected final TSubsystemSubsystem instance this command requires and operates on. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSubsystemCommand(TSubsystem subsystem) Creates a subsystem-scoped command and registers the requirement. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidprotected voidOptional 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
-
Field Details
-
subsystem
Subsystem instance this command requires and operates on. -
log
Logger scoped to the concrete command class.
-
-
Constructor Details
-
AbstractSubsystemCommand
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:
initializein classedu.wpi.first.wpilibj2.command.Command
-
onInitialize
protected void onInitialize()Optional hook for subclasses to run logic during initialize after the start log.
-