Class ThunderAutoTrajectory

java.lang.Object
com.thunder.lib.auto.ThunderAutoTrajectory
All Implemented Interfaces:
ThunderTrajectory

public class ThunderAutoTrajectory extends Object implements ThunderTrajectory
Represents a ThunderAuto trajectory.
  • Method Details

    • isValid

      public boolean isValid()
      Description copied from interface: ThunderTrajectory
      Checks if the trajectory is valid.
      Specified by:
      isValid in interface ThunderTrajectory
      Returns:
      True or false.
    • sample

      public ThunderTrajectoryState sample(double timeSeconds)
      Description copied from interface: ThunderTrajectory
      Samples the trajectory at a specified time.
      Specified by:
      sample in interface ThunderTrajectory
      Parameters:
      timeSeconds - The time at which to sample the trajectory.
      Returns:
      The state of the robot at the specified time.
    • getDurationSeconds

      public double getDurationSeconds()
      Description copied from interface: ThunderTrajectory
      Returns the duration of the trajectory.
      Specified by:
      getDurationSeconds in interface ThunderTrajectory
      Returns:
      The duration.
    • getInitialState

      public ThunderTrajectoryState getInitialState()
      Description copied from interface: ThunderTrajectory
      Returns the initial state of the robot.
      Specified by:
      getInitialState in interface ThunderTrajectory
      Returns:
      The initial state.
    • getFinalState

      public ThunderTrajectoryState getFinalState()
      Description copied from interface: ThunderTrajectory
      Returns the final state of the robot.
      Specified by:
      getFinalState in interface ThunderTrajectory
      Returns:
      The final state.
    • getStartAction

      public Optional<String> getStartAction()
      Gets the start action to perform before starting the trajectory.
      Returns:
      Action name, or an empty optional if there is no start action to perform.
    • getEndAction

      public Optional<String> getEndAction()
      Gets the end action to perform after finishing the trajectory.
      Returns:
      Action name, or an empty optional if there is no end action to perform.
    • getStopTimes

      public ArrayList<Double> getStopTimes()
      Get times at which the robot comes to a complete stop during the trajectory.
      Returns:
      List of stop times in seconds
    • getStopAction

      public Optional<String> getStopAction(double stopTimeSeconds)
      Gets the action to perform when the robot is stopped. This action must complete before the robot resumes driving. If the robot is not stopped at the specified time or there is no stop action to perform at the stop time, an empty optional will be returned
      Parameters:
      stopTimeSeconds - Stop time in seconds
      Returns:
      Action name, or an empty optional.
    • getActionTimes

      public ArrayList<Double> getActionTimes()
      Get times at which actions are to be performed during the trajectory.
      Returns:
      List of action times in seconds
    • getActionsAtTime

      public HashSet<String> getActionsAtTime(double timeSeconds)
      Get actions to perform at the specified time during the trajectory. This function simply returns the actions scheduled to start at the specified time, which is usually retrieved from getActionTimes(). Actions may continue running beyond the specified time, but this function will not return those.
      Parameters:
      timeSeconds - Time in seconds
      Returns:
      Set of action names