Skip to content

Pathfinding

pathplannerlib Index / Pathplannerlib / Pathfinding

Auto-generated documentation for pathplannerlib.pathfinding module.

Pathfinding

Show source in pathfinding.py:8

Signature

class Pathfinding: ...

Pathfinding.ensureInitialized

Show source in pathfinding.py:20

Ensure that a pathfinding implementation has been chosen. If not, set it to the default.

Signature

@staticmethod
def ensureInitialized() -> None: ...

Pathfinding.getCurrentPath

Show source in pathfinding.py:37

Get the most recently calculated path

Arguments

  • constraints - The path constraints to use when creating the path
  • goal_end_state - The goal end state to use when creating the path

Returns

The PathPlannerPath created from the points calculated by the pathfinder

Signature

@staticmethod
def getCurrentPath(
    constraints: PathConstraints, goal_end_state: GoalEndState
) -> PathPlannerPath: ...

Pathfinding.isNewPathAvailable

Show source in pathfinding.py:28

Get if a new path has been calculated since the last time a path was retrieved

Returns

True if a new path is available

Signature

@staticmethod
def isNewPathAvailable() -> bool: ...

Pathfinding.setDynamicObstacles

Show source in pathfinding.py:66

Set the dynamic obstacles that should be avoided while pathfinding.

Arguments

  • obs - A List of Translation2d pairs representing obstacles. Each Translation2d represents opposite corners of a bounding box.
  • current_robot_pos - The current position of the robot. This is needed to change the start position of the path to properly avoid obstacles

Signature

@staticmethod
def setDynamicObstacles(
    obs: List[Tuple[Translation2d, Translation2d]], current_robot_pos: Translation2d
) -> None: ...

Pathfinding.setGoalPosition

Show source in pathfinding.py:57

Set the goal position to pathfind to

Arguments

  • goal_position - Goal position on the field. f this is within an obstacle it will be moved to the nearest non-obstacle node.

Signature

@staticmethod
def setGoalPosition(goal_position: Translation2d) -> None: ...

Pathfinding.setPathfinder

Show source in pathfinding.py:11

Set the pathfinder that should be used by the path following commands

Arguments

  • pathfinder - The pathfinder to use

Signature

@staticmethod
def setPathfinder(pathfinder: Pathfinder) -> None: ...

Pathfinding.setStartPosition

Show source in pathfinding.py:48

Set the start position to pathfind from

Arguments

  • start_position - Start position on the field. If this is within an obstacle it will be moved to the nearest non-obstacle node.

Signature

@staticmethod
def setStartPosition(start_position: Translation2d) -> None: ...