Class TimePoint
java.lang.Object
frc.team_8840_lib.utils.pathplanner.TimePoint
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetAngle()Returns the angle of the timepointedu.wpi.first.math.geometry.Pose2dgetPose()Returns the pose of the timepointdoublegetTime()Returns the time of the timepointdoubleReturns the velocity of the timepointdoublegetX()Returns the x coordinate of the timepointdoublegetY()Returns the y coordinate of the timepointparseFromJSON(org.json.JSONArray timepoint) Parses a timepoint array from 8840-app's JSON formatting of its pathplannerbooleanChecks whether the timepoint had parsed an angle when reading the JSON.
-
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
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.
-