Package org.team1126.lib.math.geometry
Record Class TimestampedPose
java.lang.Object
java.lang.Record
org.team1126.lib.math.geometry.TimestampedPose
- All Implemented Interfaces:
Comparable<TimestampedPose>
public record TimestampedPose(edu.wpi.first.math.geometry.Pose2d pose, double timestamp)
extends Record
implements Comparable<TimestampedPose>
Contains a
Pose2d alongside a timestamp in seconds.-
Constructor Summary
ConstructorsConstructorDescriptionTimestampedPose(edu.wpi.first.math.geometry.Pose2d pose, double timestamp) Creates an instance of aTimestampedPoserecord class. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.edu.wpi.first.math.geometry.Pose2dpose()Returns the value of theposerecord component.doubleReturns the value of thetimestamprecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
TimestampedPose
public TimestampedPose(edu.wpi.first.math.geometry.Pose2d pose, double timestamp) Creates an instance of aTimestampedPoserecord class.- Parameters:
pose- the value for theposerecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<TimestampedPose>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
pose
public edu.wpi.first.math.geometry.Pose2d pose()Returns the value of theposerecord component.- Returns:
- the value of the
poserecord component
-
timestamp
public double timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-