Class LocalADStarAK

java.lang.Object
frc.robot.util.LocalADStarAK
All Implemented Interfaces:
Pathfinder

public class LocalADStarAK extends Object implements Pathfinder
AdvantageKit wrapper for the PathPlanner LocalADStar pathfinder.

This wrapper handles logging path data to AdvantageKit, allowing for recording, replaying, and analyzing pathfinding results in simulation or via log files.

  • Constructor Details

    • LocalADStarAK

      public LocalADStarAK()
  • Method Details

    • isNewPathAvailable

      public boolean isNewPathAvailable()
      Checks if a new path has been calculated since the last retrieval.
      Specified by:
      isNewPathAvailable in interface Pathfinder
      Returns:
      True if a new path is available.
    • getCurrentPath

      public PathPlannerPath getCurrentPath(PathConstraints constraints, GoalEndState goalEndState)
      Retrieves the most recently calculated path.
      Specified by:
      getCurrentPath in interface Pathfinder
      Parameters:
      constraints - The path constraints to use when creating the path.
      goalEndState - The goal end state to use when creating the path.
      Returns:
      The PathPlannerPath created from the points calculated by the pathfinder, or null.
    • setStartPosition

      public void setStartPosition(Translation2d startPosition)
      Sets the start position to pathfind from.
      Specified by:
      setStartPosition in interface Pathfinder
      Parameters:
      startPosition - Start position on the field.
    • setGoalPosition

      public void setGoalPosition(Translation2d goalPosition)
      Sets the goal position to pathfind to.
      Specified by:
      setGoalPosition in interface Pathfinder
      Parameters:
      goalPosition - Goal position on the field.
    • setDynamicObstacles

      public void setDynamicObstacles(List<Pair<Translation2d,Translation2d>> obs, Translation2d currentRobotPos)
      Sets the dynamic obstacles that should be avoided while pathfinding.
      Specified by:
      setDynamicObstacles in interface Pathfinder
      Parameters:
      obs - A List of Translation2d pairs representing obstacles.
      currentRobotPos - The current position of the robot.