Class ThunderTrajectoryRunnerProperties

java.lang.Object
com.thunder.lib.trajectory.ThunderTrajectoryRunnerProperties

public class ThunderTrajectoryRunnerProperties extends Object
A set of callback functions and properties required to run a trajectory.
  • Constructor Details

    • ThunderTrajectoryRunnerProperties

      public ThunderTrajectoryRunnerProperties(Supplier<Pose2d> getPose, Consumer<Pose2d> resetPose, Consumer<ChassisSpeeds> setSpeeds, HolonomicDriveController holonomicDriveController)
      Constructor for ThunderTrajectoryRunnerProperties.
      Parameters:
      getPose - Function that returns the current robot pose.
      resetPose - Function that resets the robot pose (and PID controllers too!)
      setSpeeds - Function that controls the robot chassis speeds (robot-centric).
      holonomicDriveController - The holonomic drive controller for trajectory following. ThunderLib will NOT reset its x, y, or theta PID controllers; the user should do that in the resetPose function if desired.
    • ThunderTrajectoryRunnerProperties

      public ThunderTrajectoryRunnerProperties(Supplier<Pose2d> getPose, Consumer<Pose2d> resetPose, BiConsumer<ChassisSpeeds,ThunderTrajectoryRunnerProperties.DriveControllerInputData> setSpeedsWithDiagnostics, HolonomicDriveController holonomicDriveController)
      Constructor for ThunderTrajectoryRunnerProperties.
      Parameters:
      getPose - Function that returns the current robot pose.
      resetPose - Function that resets the robot pose (and PID controllers too!)
      setSpeedsWithDiagnostics - Function that controls the robot chassis speeds (robot-centric) with diagnostic data.
      holonomicDriveController - The holonomic drive controller for trajectory following. ThunderLib will NOT reset its x, y, or theta PID controllers; the user should do that in the resetPose function if desired.
    • ThunderTrajectoryRunnerProperties

      public ThunderTrajectoryRunnerProperties(Supplier<Pose2d> getPose, Consumer<Pose2d> resetPose, Consumer<ThunderTrajectoryRunnerProperties.DriveControllerInputData> control, Runnable stop)
      Constructor for ThunderTrajectoryRunnerProperties, with no drive controller. Instead, a consumer of DriveControllerInputData must be provided instead of the typical chassis speeds consumer, and the user is responsible for calculating the appropriate speeds on their own.
      Parameters:
      getPose - Function that returns the current robot pose.
      resetPose - Function that resets the robot pose (and PID controllers too!)
      control - Function that controls the robot based on the provided DriveControllerInputData.
      stop - Function that stops the robot.
  • Method Details