Package com.titaniumtigers4829.data.pose
Record Class PoseEstimate
java.lang.Object
java.lang.Record
com.titaniumtigers4829.data.pose.PoseEstimate
public record PoseEstimate(edu.wpi.first.math.geometry.Pose2d pose, double timestampSeconds, double latency, int tagCount, double tagSpan, double avgTagDist, double avgTagArea, RawFiducial[] rawFiducials, boolean isMegaTag2, Botpose botpose)
extends Record
Represents a Limelight pose estimate from Limelight's NetworkTables output. This is for any
botpose estimate, so MegaTag1 or MegaTag2
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an "empty" PoseEstimate record with default valuesPoseEstimate(edu.wpi.first.math.geometry.Pose2d pose, double timestampSeconds, double latency, int tagCount, double tagSpan, double avgTagDist, double avgTagArea, RawFiducial[] rawFiducials, boolean isMegaTag2, Botpose botpose) Creates an instance of aPoseEstimaterecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgTagArearecord component.doubleReturns the value of theavgTagDistrecord component.botpose()Returns the value of thebotposerecord component.booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisMegaTag2record component.booleanChecks if the PoseEstimate is valid.doublelatency()Returns the value of thelatencyrecord component.edu.wpi.first.math.geometry.Pose2dpose()Returns the value of theposerecord component.Returns the value of therawFiducialsrecord component.inttagCount()Returns the value of thetagCountrecord component.doubletagSpan()Returns the value of thetagSpanrecord component.doubleReturns the value of thetimestampSecondsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PoseEstimate
public PoseEstimate()Initializes an "empty" PoseEstimate record with default values -
PoseEstimate
public PoseEstimate(edu.wpi.first.math.geometry.Pose2d pose, double timestampSeconds, double latency, int tagCount, double tagSpan, double avgTagDist, double avgTagArea, RawFiducial[] rawFiducials, boolean isMegaTag2, Botpose botpose) Creates an instance of aPoseEstimaterecord class.- Parameters:
pose- the value for theposerecord componenttimestampSeconds- the value for thetimestampSecondsrecord componentlatency- the value for thelatencyrecord componenttagCount- the value for thetagCountrecord componenttagSpan- the value for thetagSpanrecord componentavgTagDist- the value for theavgTagDistrecord componentavgTagArea- the value for theavgTagArearecord componentrawFiducials- the value for therawFiducialsrecord componentisMegaTag2- the value for theisMegaTag2record componentbotpose- the value for thebotposerecord component
-
-
Method Details
-
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 '=='. -
isValidPoseEstimate
public boolean isValidPoseEstimate()Checks if the PoseEstimate is valid. If this is true, it means the PoseEstimate has valid data from at least one april tag.- Returns:
- True if the PoseEstimate is valid, false otherwise
-
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. -
pose
public edu.wpi.first.math.geometry.Pose2d pose()Returns the value of theposerecord component.- Returns:
- the value of the
poserecord component
-
timestampSeconds
public double timestampSeconds()Returns the value of thetimestampSecondsrecord component.- Returns:
- the value of the
timestampSecondsrecord component
-
latency
public double latency()Returns the value of thelatencyrecord component.- Returns:
- the value of the
latencyrecord component
-
tagCount
public int tagCount()Returns the value of thetagCountrecord component.- Returns:
- the value of the
tagCountrecord component
-
tagSpan
public double tagSpan()Returns the value of thetagSpanrecord component.- Returns:
- the value of the
tagSpanrecord component
-
avgTagDist
public double avgTagDist()Returns the value of theavgTagDistrecord component.- Returns:
- the value of the
avgTagDistrecord component
-
avgTagArea
public double avgTagArea()Returns the value of theavgTagArearecord component.- Returns:
- the value of the
avgTagArearecord component
-
rawFiducials
Returns the value of therawFiducialsrecord component.- Returns:
- the value of the
rawFiducialsrecord component
-
isMegaTag2
public boolean isMegaTag2()Returns the value of theisMegaTag2record component.- Returns:
- the value of the
isMegaTag2record component
-
botpose
Returns the value of thebotposerecord component.- Returns:
- the value of the
botposerecord component
-