Class PoseFilterStats
java.lang.Object
yall.filter.PoseFilterStats
Counts of what a camera's pose filter accepted and rejected, and how spread out the accepted poses
are.
The spread is how to find a camera's standard deviations: hold the robot still where it sees
tags, reset(), wait a few seconds, then read getStdDevs(). getSuggestedBaseStdDevs(double) turns that into the base standard deviations for VisionPoseFilter.withStdDevs(Matrix, Matrix, double).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe share of estimates the filter accepted.longHow many estimates the filter accepted.doubleThe average tag distance of the accepted poses.The average accepted pose.longHow many estimates the filter rejected.longgetRejectedCount(String reason) How many estimates one check rejected.How many estimates each check rejected.longHow many accepted poses the spread is measured from.How spread out the accepted poses are: the sample standard deviation of x (meters), y (meters) and heading (radians).getSuggestedBaseStdDevs(double distanceDivisor) The base standard deviations that would give the measured spread at the measured tag distance, forVisionPoseFilter.withStdDevs(Matrix, Matrix, double):measured / (1 + distance² / distanceDivisor).voidrecordAccepted(VisionPoseEstimate estimate) Counts an accepted estimate and adds its pose to the spread.voidrecordRejected(String reason) Counts a rejected estimate.voidreset()Starts counting again.
-
Constructor Details
-
PoseFilterStats
public PoseFilterStats()Creates empty stats.
-
-
Method Details
-
recordAccepted
Counts an accepted estimate and adds its pose to the spread.- Parameters:
estimate- The accepted estimate.
-
recordRejected
Counts a rejected estimate.- Parameters:
reason- Why it was rejected: the name of the check that rejected it.
-
reset
public void reset()Starts counting again. -
getAcceptedCount
public long getAcceptedCount()How many estimates the filter accepted.- Returns:
- The count.
-
getRejectedCount
public long getRejectedCount()How many estimates the filter rejected.- Returns:
- The count.
-
getRejectedCount
How many estimates one check rejected.- Parameters:
reason- The check's rejection reason, such as"ambiguous", or a custom check's name.- Returns:
- The count.
-
getRejectionCounts
-
getAcceptanceRate
public double getAcceptanceRate()The share of estimates the filter accepted.- Returns:
- 0 to 1, or
Double.NaNbefore any estimate.
-
getSampleCount
public long getSampleCount()How many accepted poses the spread is measured from.- Returns:
- The count.
-
getMeanPose
-
getStdDevs
How spread out the accepted poses are: the sample standard deviation of x (meters), y (meters) and heading (radians). Measured with the robot still, this is the camera's real standard deviation at the current distance.- Returns:
- The standard deviations, or
Double.NaNs with fewer than two samples.
-
getAverageTagDistanceMeters
public double getAverageTagDistanceMeters()The average tag distance of the accepted poses.- Returns:
- Meters, or
Double.NaNbefore any accepted estimate.
-
getSuggestedBaseStdDevs
The base standard deviations that would give the measured spread at the measured tag distance, forVisionPoseFilter.withStdDevs(Matrix, Matrix, double):measured / (1 + distance² / distanceDivisor).- Parameters:
distanceDivisor- The filter's distance divisor (30 by default).- Returns:
- The base standard deviations, or
Double.NaNs with fewer than two samples.
-