Class Path
- java.lang.Object
- 
- io.github.frc5024.purepursuit.pathgen.Path
 
- 
- Direct Known Subclasses:
- BezierPath,- RawPath,- SmoothPath
 
 public class Path extends java.lang.ObjectA "Path" is a list of closely spaces points in space for a robot to follow. The default Path class will generate paths with any number of waypoints, and create linear sub-paths.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Stringnameprotected doublepathGenStartTimeMsprotected doublepathGenTimeMsprotected java.util.ArrayList<Translation2d>pointsprotected Translation2d[]waypoints
 - 
Constructor SummaryConstructors Constructor Description Path(double spacing, Translation2d... waypoints)Create a motion path from pointsPath(Translation2d... waypoints)Create a motion path from points
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbeginTimingGeneration()Begins an internal timer for profiling path gen timeXYChartgetPathVisualization()Get a chart showing every generated path point in 2D space.Translation2d[]getPoses()Get a list of all poses along the pathprotected voidsaveAndLogGenerationTime()Logs how long path gen tookjava.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
pointsprotected java.util.ArrayList<Translation2d> points 
 - 
waypointsprotected Translation2d[] waypoints 
 - 
pathGenStartTimeMsprotected double pathGenStartTimeMs 
 - 
pathGenTimeMsprotected double pathGenTimeMs 
 - 
nameprotected java.lang.String name 
 
- 
 - 
Constructor Detail- 
Pathpublic Path(Translation2d... waypoints) Create a motion path from points- Parameters:
- waypoints- Path waypoints to follow
 
 - 
Pathpublic Path(double spacing, Translation2d... waypoints)Create a motion path from points- Parameters:
- spacing- Amount of space between "inner" points in meters
- waypoints- Path waypoints to follow
 
 
- 
 - 
Method Detail- 
beginTimingGenerationprotected void beginTimingGeneration() Begins an internal timer for profiling path gen time
 - 
saveAndLogGenerationTimeprotected void saveAndLogGenerationTime() Logs how long path gen took
 - 
getPosespublic Translation2d[] getPoses() Get a list of all poses along the path- Returns:
- Poses
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getPathVisualizationpublic XYChart getPathVisualization() Get a chart showing every generated path point in 2D space. Can be written to disk for debugging and demos.- Returns:
- Path visualization
 
 
- 
 
-