Record Class AprilTagPoseEstimator.EstimationResult
java.lang.Object
java.lang.Record
frc.robot.subsystems.apriltagvision.AprilTagPoseEstimator.EstimationResult
- Record Components:
measurement- the validated vision measurement, or empty if rejectedrejectionReason- the reason for rejection, or empty if accepted
- Enclosing class:
- AprilTagPoseEstimator
public static record AprilTagPoseEstimator.EstimationResult(Optional<AprilTagPoseEstimator.VisionMeasurement> measurement, Optional<AprilTagPoseEstimator.RejectionReason> rejectionReason)
extends Record
Result of evaluating a pose observation. Contains either an accepted measurement or a rejection reason for telemetry.
-
Constructor Summary
ConstructorsConstructorDescriptionEstimationResult(Optional<AprilTagPoseEstimator.VisionMeasurement> measurement, Optional<AprilTagPoseEstimator.RejectionReason> rejectionReason) Creates an instance of aEstimationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaccepted(AprilTagPoseEstimator.VisionMeasurement measurement) Creates an accepted result containing a vision measurement.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themeasurementrecord component.Creates a rejected result with the given reason.Returns the value of therejectionReasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EstimationResult
public EstimationResult(Optional<AprilTagPoseEstimator.VisionMeasurement> measurement, Optional<AprilTagPoseEstimator.RejectionReason> rejectionReason) Creates an instance of aEstimationResultrecord class.- Parameters:
measurement- the value for themeasurementrecord componentrejectionReason- the value for therejectionReasonrecord component
-
-
Method Details
-
accepted
public static AprilTagPoseEstimator.EstimationResult accepted(AprilTagPoseEstimator.VisionMeasurement measurement) Creates an accepted result containing a vision measurement.- Parameters:
measurement- the validated measurement to forward to the pose estimator- Returns:
- accepted result
-
rejected
public static AprilTagPoseEstimator.EstimationResult rejected(AprilTagPoseEstimator.RejectionReason reason) Creates a rejected result with the given reason.- Parameters:
reason- why the observation was rejected- Returns:
- rejected result
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
measurement
Returns the value of themeasurementrecord component.- Returns:
- the value of the
measurementrecord component
-
rejectionReason
Returns the value of therejectionReasonrecord component.- Returns:
- the value of the
rejectionReasonrecord component
-