Package com.thunder.lib.auto
Class ThunderAutoMode
java.lang.Object
com.thunder.lib.auto.ThunderAutoMode
Represents a ThunderAuto autonomous mode.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the first step of the auto mode.getFirstStepOfBranch(ThunderAutoModeStep branchStep, boolean booleanCondition) From the given boolean condition step, gets the first step of either the true or false branch depending on booleanCondition.getFirstStepOfBranch(ThunderAutoModeStep branchStep, int switchCondition) From the given switch condition step, gets the first step of a case branch or the default branch depending on switchCondition.getNextStep(ThunderAutoModeStep previousStep) Gets the next step in the auto mode.booleanisRunnable(ThunderAutoProject project) Checks if the auto mode is runnable (i.e., all referenced trajectories exist and are continuous).booleanisValid()Checks if the auto mode is valid.
-
Method Details
-
isValid
public boolean isValid()Checks if the auto mode is valid.- Returns:
- True or false.
-
getFirstStep
Returns the first step of the auto mode.- Returns:
- The first step of the auto mode, or an empty optional if none exists.
-
getNextStep
Gets the next step in the auto mode.- Parameters:
previousStep- The step before the one to get.- Returns:
- The next step of the auto mode, or an empty optional if previousStep was the final step.
-
getFirstStepOfBranch
public Optional<ThunderAutoModeStep> getFirstStepOfBranch(ThunderAutoModeStep branchStep, boolean booleanCondition) From the given boolean condition step, gets the first step of either the true or false branch depending on booleanCondition.- Parameters:
branchStep- A boolean condition step.booleanCondition- Which branch to get.- Returns:
- The first step of the branch, or an empty optional if the branch is empty or there was a problem.
-
getFirstStepOfBranch
public Optional<ThunderAutoModeStep> getFirstStepOfBranch(ThunderAutoModeStep branchStep, int switchCondition) From the given switch condition step, gets the first step of a case branch or the default branch depending on switchCondition.- Parameters:
branchStep- A switch condition step.switchCondition- Which branch to get.- Returns:
- The first step of the branch, or an empty optional if the branch is empty or there was a problem.
-
isRunnable
Checks if the auto mode is runnable (i.e., all referenced trajectories exist and are continuous).- Parameters:
project- The ThunderAutoProject containing all trajectories referenced by this auto mode.- Returns:
- True or false.
-