Skip to content

Commit

Permalink
re-add the fromPathPoints PathPlannerPath factory method (#399)
Browse files Browse the repository at this point in the history
* re-add fromPathPoints factory to java pplib

* format
  • Loading branch information
mjansen4857 authored Oct 13, 2023
1 parent 1ba5799 commit d8d8b89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@ private PathPlannerPath(PathConstraints globalConstraints, GoalEndState goalEndS
this.allPoints = new ArrayList<>();
}

/**
* Creat a path with pre-generated points. This should already be a smooth path.
*
* @param pathPoints Path points along the smooth curve of the path
* @param constraints The global constraints of the path
* @param goalEndState The goal end state of the path
* @return A PathPlannerPath following the given pathpoints
*/
public static PathPlannerPath fromPathPoints(
List<PathPoint> pathPoints, PathConstraints constraints, GoalEndState goalEndState) {
PathPlannerPath path = new PathPlannerPath(constraints, goalEndState);
path.allPoints = pathPoints;
path.precalcValues();

return path;
}

/**
* Create the bezier points necessary to create a path using a list of poses
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ public PathPoint(Translation2d position, Rotation2d holonomicRotation) {
this.holonomicRotation = holonomicRotation;
}

/**
* Create a path point
*
* @param position Position of the point
*/
public PathPoint(Translation2d position) {
this.position = position;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down

0 comments on commit d8d8b89

Please sign in to comment.