Class Path

  • Direct Known Subclasses:
    BezierPath, RawPath, SmoothPath

    public class Path
    extends java.lang.Object
    A "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 Detail

      • pathGenStartTimeMs

        protected double pathGenStartTimeMs
      • pathGenTimeMs

        protected double pathGenTimeMs
      • name

        protected java.lang.String name
    • Constructor Detail

      • Path

        public Path​(Translation2d... waypoints)
        Create a motion path from points
        Parameters:
        waypoints - Path waypoints to follow
      • Path

        public 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

      • beginTimingGeneration

        protected void beginTimingGeneration()
        Begins an internal timer for profiling path gen time
      • saveAndLogGenerationTime

        protected void saveAndLogGenerationTime()
        Logs how long path gen took
      • getPoses

        public Translation2d[] getPoses()
        Get a list of all poses along the path
        Returns:
        Poses
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getPathVisualization

        public 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