Class ThunderAutoMode

java.lang.Object
com.thunder.lib.auto.ThunderAutoMode

public class ThunderAutoMode extends Object
Represents a ThunderAuto autonomous mode.
  • Method Details

    • isValid

      public boolean isValid()
      Checks if the auto mode is valid.
      Returns:
      True or false.
    • getFirstStep

      public Optional<ThunderAutoModeStep> 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

      public Optional<ThunderAutoModeStep> getNextStep(ThunderAutoModeStep previousStep)
      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

      public boolean isRunnable(ThunderAutoProject project)
      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.