Class PnpResult

java.lang.Object
org.photonvision.targeting.PnpResult
All Implemented Interfaces:
PhotonStructSerializable<PnpResult>, org.wpilib.util.protobuf.ProtobufSerializable, org.wpilib.util.WPISerializable

public class PnpResult extends Object implements org.wpilib.util.protobuf.ProtobufSerializable, PhotonStructSerializable<PnpResult>
The best estimated transformation from solvePnP, and possibly an alternate transformation depending on the solvePNP method. If an alternate solution is present, the ambiguity value represents the ratio of reprojection error in the best solution to the alternate (best / alternate).

Note that the coordinate frame of these transforms depends on the implementing solvePnP method.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.wpilib.math.geometry.Transform3d
    Alternate, ambiguous solution from solvepnp.
    double
    If no alternate solution is found, this is bestReprojErr
    double
    If no alternate solution is found, this is 0
    org.wpilib.math.geometry.Transform3d
    The best-fit transform.
    double
    Reprojection error of the best solution, in pixels
    static final PnpResultSerde
    PnpResult PhotonStruct for serialization.
    static final PNPResultProto
    PnpResult protobuf for serialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
    An empty (invalid) result.
    PnpResult(org.wpilib.math.geometry.Transform3d best, double bestReprojErr)
     
    PnpResult(org.wpilib.math.geometry.Transform3d best, org.wpilib.math.geometry.Transform3d alt, double ambiguity, double bestReprojErr, double altReprojErr)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns the PhotonStruct serializer for this type.
    int
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • best

      public org.wpilib.math.geometry.Transform3d best
      The best-fit transform. The coordinate frame of this transform depends on the method which gave this result.
    • bestReprojErr

      public double bestReprojErr
      Reprojection error of the best solution, in pixels
    • alt

      public org.wpilib.math.geometry.Transform3d alt
      Alternate, ambiguous solution from solvepnp. If no alternate solution is found, this is equal to the best solution.
    • altReprojErr

      public double altReprojErr
      If no alternate solution is found, this is bestReprojErr
    • ambiguity

      public double ambiguity
      If no alternate solution is found, this is 0
    • proto

      public static final PNPResultProto proto
      PnpResult protobuf for serialization.
    • photonStruct

      public static final PnpResultSerde photonStruct
      PnpResult PhotonStruct for serialization.
  • Constructor Details

    • PnpResult

      public PnpResult()
      An empty (invalid) result.
    • PnpResult

      public PnpResult(org.wpilib.math.geometry.Transform3d best, double bestReprojErr)
    • PnpResult

      public PnpResult(org.wpilib.math.geometry.Transform3d best, org.wpilib.math.geometry.Transform3d alt, double ambiguity, double bestReprojErr, double altReprojErr)
  • Method Details