Package frc.robot.Subsystems.Vision
Class VisionPoseCache
java.lang.Object
frc.robot.Subsystems.Vision.VisionPoseCache
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPose(edu.wpi.first.math.geometry.Pose2d pose, edu.wpi.first.math.geometry.Pose2d referencePose, double timestampSeconds) Updates the cache with a new vision estimate.voidclearOldPoses(double timestampSeconds) edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> Returns the standard deviations for the associated camera based on the cached measurements.edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> Returns standard deviations in combination with the last recorded ambiguity rating.
-
Field Details
-
last_ambiguity
public double last_ambiguity
-
-
Constructor Details
-
VisionPoseCache
public VisionPoseCache()Creates a new VisionPoseCache.
-
-
Method Details
-
addPose
public void addPose(edu.wpi.first.math.geometry.Pose2d pose, edu.wpi.first.math.geometry.Pose2d referencePose, double timestampSeconds) Updates the cache with a new vision estimate. Clears out old datapoints.- Parameters:
pose- The vision-estimated pose.referencePose- The predicted pose of the robot from odometry.timestampSeconds- The time of the vision estimate.
-
clearOldPoses
public void clearOldPoses(double timestampSeconds) -
getStdevs
public edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> getStdevs()Returns the standard deviations for the associated camera based on the cached measurements.- Returns:
- The x, y, and angular standard deviations in meters and radians.
-
getWeightedStdevs
public edu.wpi.first.math.Matrix<edu.wpi.first.math.numbers.N3,edu.wpi.first.math.numbers.N1> getWeightedStdevs()Returns standard deviations in combination with the last recorded ambiguity rating.- Returns:
- The weighted x, y, and angular standard deviations.
-