-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
99 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.team1701.lib.util; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import com.pathplanner.lib.path.PathPlannerPath; | ||
import edu.wpi.first.math.geometry.Pose2d; | ||
|
||
public class PathBuilder { | ||
private final List<Pose2d> mPath = new ArrayList<>(); | ||
|
||
public Pose2d[] build() { | ||
return mPath.toArray(new Pose2d[mPath.size()]); | ||
} | ||
|
||
public Pose2d[] buildAndClear() { | ||
var path = build(); | ||
clear(); | ||
return path; | ||
} | ||
|
||
public void clear() { | ||
mPath.clear(); | ||
} | ||
|
||
public PathBuilder addPose(Pose2d pose) { | ||
// TODO: Add to mPath | ||
return this; | ||
} | ||
|
||
public PathBuilder addPath(Pose2d[] path) { | ||
Collections.addAll(mPath, path); | ||
return this; | ||
} | ||
|
||
public PathBuilder addPath(PathPlannerPath path) { | ||
// TODO: Add to mPath | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters