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
public abstract class AutoStep extends java.lang.Object
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 Constructor Description AutoStep()
Set step to not finished.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
initialize()
This method is called once, when the step is first run.boolean
isFinished()
Returns if the AutoStep is finished, meaning the next step may begin.void
setFinished()
Completes the set by setting finished to true.void
setFinished(boolean isFinished)
Do not use this function in new implementations.abstract java.lang.String
toString()
Returns the name of the AutoStep, used to uniquely identify the step.abstract void
update()
This method is called on the active step, once per call to RobotTemplate.autonomousPeriodic().
-
-
-
Method Detail
-
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
public abstract java.lang.String toString()
Returns the name of the AutoStep, used to uniquely identify the step.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Name of the AutoStep.
-
-