Package org.wildstang.framework.auto
Class AutoStep
java.lang.Object
org.wildstang.framework.auto.AutoStep
- Direct Known Subclasses:
AutoParallelStepGroup,AutoSerialStepGroup,AutoStepDelay,AutoStepStopAutonomous,PathFollowerStep,PathHeadingStep,SetGyroStep,SwervePathFollowerStep
Represents a single automated robot operation.
When it's the step's turn, initialize() is run once,
then update() is run until setFinished(true).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidThis method is called once, when the step is first run.booleanReturns if the AutoStep is finished, meaning the next step may begin.voidCompletes the set by setting finished to true.voidsetFinished(boolean isFinished) Do not use this function in new implementations.abstract StringtoString()Returns the name of the AutoStep, used to uniquely identify the step.abstract voidupdate()This method is called on the active step, once per call to RobotTemplate.autonomousPeriodic().
-
Constructor Details
-
AutoStep
public AutoStep()Set step to not finished. Constructing does not start step, rather prepares it for initialization.
-
-
Method Details
-
initialize
public abstract void initialize()This method is called once, when the step is first run. Use this method to set up anything that is necessary for the step. -
update
public abstract void update()This method is called on the active step, once per call to RobotTemplate.autonomousPeriodic(). Steps will continue to have this method called until they set finished to true. Note: this method is first called right after initialize(), with no delay in between. -
isFinished
public boolean isFinished()Returns if the AutoStep is finished, meaning the next step may begin.- Returns:
- True if the step is finished.
-
setFinished
public void setFinished(boolean isFinished) Do not use this function in new implementations. Previously setFinished took a boolean, but there is not case where setFinished(false) is a valid operation. This exists to allow it to still be called that way.- Parameters:
isFinished- Unused, finished is always set to true.
-
setFinished
public void setFinished()Completes the set by setting finished to true. -
toString
Returns the name of the AutoStep, used to uniquely identify the step.
-