Record Class VisionPoseEstimate
java.lang.Object
java.lang.Record
yall.results.VisionPoseEstimate
- Record Components:
cameraName- Name of the camera that produced the estimate.pose- Estimated robot pose on the field, in WPILib blue-origin field coordinates.timestampSeconds- When the image was captured, on theTimer.getMonotonicTimestamp()timebase.tagIds- IDs of the AprilTags used.averageTagDistanceMeters- Average distance from the camera to the tags used.ambiguity- Pose ambiguity of a single-tag estimate, 0 to 1. 0 for multi-tag estimates, andDouble.NaNif the camera doesn't report it.headingAssisted- Whether the estimate used the robot heading fromVisionCamera.setRobotOrientation(Rotation3d, AngularVelocity), so its rotation is that heading rather than the camera's.stdDevs- Standard deviations of x (meters), y (meters) and heading (radians) forPoseEstimator.addVisionMeasurement(Pose2d, double, Matrix). Filled in by theVisionPoseFilter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theambiguityrecord component.doubleReturns the value of theaverageTagDistanceMetersrecord component.Returns the value of thecameraNamerecord 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 theheadingAssistedrecord component.pose()Returns the value of theposerecord component.pose2d()The estimated pose on the floor.stdDevs()Returns the value of thestdDevsrecord component.inttagCount()Number of AprilTags used.tagIds()Returns the value of thetagIdsrecord component.doubleReturns the value of thetimestampSecondsrecord component.final StringtoString()Returns a string representation of this record class.static VisionPoseEstimateunfiltered(String cameraName, Pose3d pose, double timestampSeconds, List<Integer> tagIds, double averageTagDistanceMeters, double ambiguity, boolean headingAssisted) Creates an estimate whose standard deviations the filter hasn't filled in yet.withStdDevs(Matrix<N3, N1> stdDevs) A copy of this estimate with other standard deviations.
-
Constructor Details
-
VisionPoseEstimate
-
-
Method Details
-
unfiltered
public static VisionPoseEstimate unfiltered(String cameraName, Pose3d pose, double timestampSeconds, List<Integer> tagIds, double averageTagDistanceMeters, double ambiguity, boolean headingAssisted) Creates an estimate whose standard deviations the filter hasn't filled in yet.- Parameters:
cameraName- Name of the camera.pose- Estimated robot pose.timestampSeconds- Capture timestamp.tagIds- IDs of the AprilTags used.averageTagDistanceMeters- Average distance to the tags used.ambiguity- Single-tag ambiguity, 0 for multi-tag, NaN if unknown.headingAssisted- Whether the robot heading was used.- Returns:
- The estimate, with zero standard deviations.
-
tagCount
public int tagCount()Number of AprilTags used.- Returns:
- Tag count.
-
pose2d
-
withStdDevs
A copy of this estimate with other standard deviations.- Parameters:
stdDevs- Standard deviations of x, y and heading.- Returns:
- The copy.
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
cameraName
Returns the value of thecameraNamerecord component.- Returns:
- the value of the
cameraNamerecord component
-
pose
-
timestampSeconds
public double timestampSeconds()Returns the value of thetimestampSecondsrecord component.- Returns:
- the value of the
timestampSecondsrecord component
-
tagIds
-
averageTagDistanceMeters
public double averageTagDistanceMeters()Returns the value of theaverageTagDistanceMetersrecord component.- Returns:
- the value of the
averageTagDistanceMetersrecord component
-
ambiguity
-
headingAssisted
public boolean headingAssisted()Returns the value of theheadingAssistedrecord component.- Returns:
- the value of the
headingAssistedrecord component
-
stdDevs
-