Package frc.robot.util
Record Class Aiming.AimingResult
java.lang.Object
java.lang.Record
frc.robot.util.Aiming.AimingResult
- Enclosing class:
- Aiming
public static record Aiming.AimingResult(Rotation2d targetRotation, double distanceToTargetMeters, boolean hasTarget)
extends Record
Cached result of the aiming pipeline, including target rotation, distance, and target presence.
-
Constructor Summary
ConstructorsConstructorDescriptionAimingResult(Rotation2d targetRotation, double distanceToTargetMeters, boolean hasTarget) Creates an instance of aAimingResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thedistanceToTargetMetersrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasTargetrecord component.Returns the value of thetargetRotationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AimingResult
Creates an instance of aAimingResultrecord class.- Parameters:
targetRotation- the value for thetargetRotationrecord componentdistanceToTargetMeters- the value for thedistanceToTargetMetersrecord componenthasTarget- the value for thehasTargetrecord component
-
-
Method Details
-
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 '=='. -
targetRotation
Returns the value of thetargetRotationrecord component.- Returns:
- the value of the
targetRotationrecord component
-
distanceToTargetMeters
public double distanceToTargetMeters()Returns the value of thedistanceToTargetMetersrecord component.- Returns:
- the value of the
distanceToTargetMetersrecord component
-
hasTarget
public boolean hasTarget()Returns the value of thehasTargetrecord component.- Returns:
- the value of the
hasTargetrecord component
-