Class TimePoint

java.lang.Object
frc.team_8840_lib.utils.pathplanner.TimePoint

public class TimePoint extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty timepoint.
    TimePoint(float time)
    Creates a new empty timepoint at time.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the angle of the timepoint
    edu.wpi.first.math.geometry.Pose2d
    Returns the pose of the timepoint
    double
    Returns the time of the timepoint
    double
    Returns the velocity of the timepoint
    double
    Returns the x coordinate of the timepoint
    double
    Returns the y coordinate of the timepoint
    parseFromJSON(org.json.JSONArray timepoint)
    Parses a timepoint array from 8840-app's JSON formatting of its pathplanner
    boolean
    Checks whether the timepoint had parsed an angle when reading the JSON.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • driving

      public boolean driving
  • Constructor Details

    • TimePoint

      public TimePoint(float time)
      Creates a new empty timepoint at time.
      Parameters:
      time - Occurance time
    • TimePoint

      public TimePoint()
      Creates a new empty timepoint.
  • Method Details

    • getPose

      public edu.wpi.first.math.geometry.Pose2d getPose()
      Returns the pose of the timepoint
      Returns:
      Pose of robot at timepoint
    • getX

      public double getX()
      Returns the x coordinate of the timepoint
      Returns:
      X coordinate (in inches)
    • getY

      public double getY()
      Returns the y coordinate of the timepoint
      Returns:
      Y coordinate (in inches)
    • getAngle

      public double getAngle()
      Returns the angle of the timepoint
      Returns:
      Angle (in radians)
    • timepointHadAngle

      public boolean timepointHadAngle()
      Checks whether the timepoint had parsed an angle when reading the JSON. This can be used to make sure it doesn't default onto 0° in autonomous or other situations.
      Returns:
      angle was parsed.
    • getTime

      public double getTime()
      Returns the time of the timepoint
      Returns:
      Time (in seconds)
    • getVelocity

      public double getVelocity()
      Returns the velocity of the timepoint
      Returns:
      Velocity (in in/s)
    • parseFromJSON

      public TimePoint parseFromJSON(org.json.JSONArray timepoint)
      Parses a timepoint array from 8840-app's JSON formatting of its pathplanner
      Parameters:
      timepoint - Array of the events occuring at time.
      Returns:
      Timepoint with all parsed data.