PathPlanner

class pathplannerlib.PathPlanner

Bases: pybind11_object

static generatePath(*args, **kwargs)

Overloaded function.

  1. generatePath(constraints: pathplannerlib._pathplannerlib.PathConstraints, reversed: bool, points: List[pathplannerlib._pathplannerlib.PathPoint]) -> pathplannerlib._pathplannerlib.PathPlannerTrajectory

Generate a path on-the-fly from a list of points As you can’t see the path in the GUI when using this method, make sure you have a good idea of what works well and what doesn’t before you use this method in competition. Points positioned in weird configurations such as being too close together can lead to really janky paths.

Parameters:
  • constraints – The max velocity and max acceleration of the path

  • reversed – Should the robot follow this path reversed

  • points – Points in the path

Returns:

The generated path

  1. generatePath(constraints: pathplannerlib._pathplannerlib.PathConstraints, points: List[pathplannerlib._pathplannerlib.PathPoint]) -> pathplannerlib._pathplannerlib.PathPlannerTrajectory

Generate a path on-the-fly from a list of points As you can’t see the path in the GUI when using this method, make sure you have a good idea of what works well and what doesn’t before you use this method in competition. Points positioned in weird configurations such as being too close together can lead to really janky paths.

Parameters:
  • constraints – The max velocity and max acceleration of the path

  • reversed – Should the robot follow this path reversed

  • points – Points in the path

Returns:

The generated path

static getConstraintsFromPath(name: str) pathplannerlib._pathplannerlib.PathConstraints

Load path constraints from a path file in storage. This can be used to change path max vel/accel in the GUI instead of updating and rebuilding code. This requires that max velocity and max acceleration have been explicitly set in the GUI.

Throws a runtime error if constraints are not present in the file

Parameters:

name – The name of the path to load constraints from

Returns:

The constraints from the path file

static loadPath(*args, **kwargs)

Overloaded function.

  1. loadPath(name: str, constraints: pathplannerlib._pathplannerlib.PathConstraints, reversed: bool = False) -> pathplannerlib._pathplannerlib.PathPlannerTrajectory

Load a path file from storage

Parameters:
  • name – The name of the path to load

  • constraints – The max velocity and acceleration of the path

  • reversed – Should the robot follow the path reversed

Returns:

The generated path

  1. loadPath(name: str, maxVel: meters_per_second, maxAccel: meters_per_second_squared, reversed: bool = False) -> pathplannerlib._pathplannerlib.PathPlannerTrajectory

Load a path file from storage

Parameters:
  • name – The name of the path to load

  • maxVel – Max velocity of the path

  • maxAccel – Max acceleration of the path

  • reversed – Should the robot follow the path reversed

Returns:

The generated path

static loadPathGroup(*args, **kwargs)

Overloaded function.

  1. loadPathGroup(name: str, constraints: List[pathplannerlib._pathplannerlib.PathConstraints], reversed: bool = False) -> List[pathplannerlib._pathplannerlib.PathPlannerTrajectory]

Load a path file from storage as a path group. This will separate the path into multiple paths based on the waypoints marked as “stop points”

Parameters:
  • name – The name of the path group to load

  • constraints – Vector of path constraints for each path in the group. This requires at least one path constraint. If less constraints than paths are provided, the last constraint will be used for the rest of the paths.

  • reversed – Should the robot follow the path group reversed

Returns:

Vector of all generated paths in the group

  1. loadPathGroup(name: str, maxVel: meters_per_second, maxAccel: meters_per_second_squared, reversed: bool = False) -> List[pathplannerlib._pathplannerlib.PathPlannerTrajectory]

Load a path file from storage as a path group. This will separate the path into multiple paths based on the waypoints marked as “stop points”

Parameters:
  • name – The name of the path group to load

  • maxVel – Max velocity of every path in the group

  • maxAccel – Max acceleration of every path in the group

  • reversed – Should the robot follow the path group reversed

Returns:

Vector of all generated paths in the group

resolution = 0.004