Package frc.robot.shared.commands
Class AbstractSetAndSeekCommand<TSubsystem extends AbstractSetAndSeekSubsystem<?>>
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.shared.commands.AbstractSubsystemCommand<TSubsystem>
frc.robot.shared.commands.AbstractSetAndSeekCommand<TSubsystem>
- Type Parameters:
TSubsystem- concrete set-and-seek subsystem type
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
- Direct Known Subclasses:
MoveHarvesterToPositionCommand,MoveTurretToAngleCommand
public class AbstractSetAndSeekCommand<TSubsystem extends AbstractSetAndSeekSubsystem<?>>
extends AbstractSubsystemCommand<TSubsystem>
Command base that drives a
AbstractSetAndSeekSubsystem toward a supplied target using its trapezoidal profile.
Extend this class to bind operator inputs or autonomous goals without having the subsystem manufacture commands. Provide a target supplier in the
constructor; the command will set the goal on initialize, step the profile each cycle, and finish once the subsystem reports
AbstractSetAndSeekSubsystem.isProfileSettled().
-
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 inherited from class frc.robot.shared.commands.AbstractSubsystemCommand
log, subsystem -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractSetAndSeekCommand(TSubsystem subsystem, Supplier<Double> targetSupplier) Builds a profiled seek command for the given subsystem. -
Method Summary
Methods inherited from class frc.robot.shared.commands.AbstractSubsystemCommand
initializeMethods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
AbstractSetAndSeekCommand
Builds a profiled seek command for the given subsystem.- Parameters:
subsystem- subsystem instance to controltargetSupplier- provider for target positions; evaluated on initialize
-
-
Method Details
-
execute
public void execute()- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
end
public void end(boolean interrupted) - Overrides:
endin classedu.wpi.first.wpilibj2.command.Command
-
isFinished
public boolean isFinished()- Overrides:
isFinishedin classedu.wpi.first.wpilibj2.command.Command
-
onInitialize
protected void onInitialize()Description copied from class:AbstractSubsystemCommandOptional hook for subclasses to run logic during initialize after the start log.- Overrides:
onInitializein classAbstractSubsystemCommand<TSubsystem extends AbstractSetAndSeekSubsystem<?>>
-