Class FollowPathTask

java.lang.Object
com.cdarobotics.cdalib.tasks.Task
com.cdarobotics.cdalib.tasks.FollowPathTask

public class FollowPathTask extends Task
A task that follows a PedroPathing Path, finishing when the follower is no longer busy.
  • Constructor Details

    • FollowPathTask

      public FollowPathTask(com.pedropathing.follower.Follower follower, com.pedropathing.paths.Path path)
      Follows the path at full speed.
      Parameters:
      follower - the drivetrain follower
      path - the path to follow
    • FollowPathTask

      public FollowPathTask(com.pedropathing.follower.Follower follower, com.pedropathing.paths.Path path, double speed)
      Follows the path at the given speed.
      Parameters:
      follower - the drivetrain follower
      path - the path to follow
      speed - the path-following speed multiplier, as a fraction of the robot's max speed (1.0 is full speed)
  • Method Details

    • init

      public void init()
      Description copied from class: Task
      Called once before the first Task.run(). Set up state and issue starting commands here.
      Specified by:
      init in class Task
    • run

      public boolean run()
      Description copied from class: Task
      Called every loop after Task.init().
      Specified by:
      run in class Task
      Returns:
      true when the task is finished, false to keep running.
    • toString

      @NonNull public String toString()
      Specified by:
      toString in class Task