Class Limelight.PoseEstimate

java.lang.Object
com.limelightvision.Limelight.PoseEstimate
Enclosing class:
Limelight

public static class Limelight.PoseEstimate extends Object
A robot pose estimate with the metadata needed for pose-estimator fusion.
  • Field Details

    • pose

      public org.wpilib.math.geometry.Pose2d pose
    • timestampSeconds

      public double timestampSeconds
      Latency-compensated capture timestamp in the local NetworkTables timebase. Pass this value directly to addVisionMeasurement in WPILib.
    • latencyMillis

      public double latencyMillis
      Total latency (capture + targeting) in milliseconds.
    • reportedTagCount

      public int reportedTagCount
      Camera-reported botpose tag count, telemetry only.
    • fieldedTagCount

      public int fieldedTagCount
      Number of fielded tags. Used for validity, filtering, and standard deviation scaling
    • tagSpanMeters

      public double tagSpanMeters
      Max distance between contributing tags in meters.
    • avgTagDistanceMeters

      public double avgTagDistanceMeters
      Average distance to contributing tags in meters.
    • avgTagAreaPercent

      public double avgTagAreaPercent
      Average area of contributing tags (percentage of image).
    • stdDevs

      public org.wpilib.math.linalg.Vector<org.wpilib.math.numbers.N3> stdDevs
      Fusion-ready standard deviations [x meters, y meters, theta radians]. The Limelight.PoseEstimateConfig of this camera computes them from tag distance and tag count. Pass this value as the third argument to addVisionMeasurement.
    • reportedStdDevs

      public double[] reportedStdDevs
      Standard deviations [x, y, z, roll, pitch, yaw] reported by the camera. The camera averages them over a long window. Use them for telemetry only. Do not give them to a pose estimator. Use stdDevs instead.
    • rawFiducials

      public Limelight.FiducialTarget[] rawFiducials
      The fiducials visible in this frame.
    • type

      Which pose estimate output this is (origin + algorithm).
    • frameIndex

      public long frameIndex
      The frame index of the source camera. Estimates from the same camera with the same index came from one frame. Do not fuse more than one pose type from one frame. The index can reset when the camera restarts.
    • rejectionFlags

      public int rejectionFlags
      OR of the Limelight.PoseEstimateConfig REJECT_* flags for every check this estimate failed. 0 = accepted. Decode with Limelight.PoseEstimateConfig.describeRejection(int). The flags reflect the filter configured for the algorithm of this estimate.
  • Constructor Details

    • PoseEstimate

      public PoseEstimate()
  • Method Details

    • getFieldedFiducials

      public Limelight.FiducialTarget[] getFieldedFiducials()
      Returns the visible fiducials that contributed to pose estimation.
      Returns:
      The visible fiducials that contributed to pose estimation. These have Limelight.FiducialTarget.fielded set
    • isMT2

      public boolean isMT2()
      Returns true if this estimate was produced by the MegaTag2 algorithm.
      Returns:
      True if this estimate was produced by the MegaTag2 algorithm
    • isValid

      public boolean isValid()
      Returns true if at least one fielded tag produced this estimate and no check rejected it.
      Returns:
      True if at least one fielded tag produced this estimate and no check rejected it. This does not show current camera health. It does not show whether the frame was already read.
    • toString

      public String toString()
      Overrides:
      toString in class Object