Enum Class TargetModel

java.lang.Object
java.lang.Enum<TargetModel>
org.photonvision.vision.target.TargetModel
All Implemented Interfaces:
Serializable, Comparable<TargetModel>, Constable, Releasable

public enum TargetModel extends Enum<TargetModel> implements Releasable
A model representing the vertices of targets with known shapes. The vertices are in the EDN coordinate system. When creating a TargetModel, the vertices must be supplied in a certain order to ensure correct correspondence with corners detected in 2D for use with SolvePNP. For planar targets, we expect the target's Z-axis to point towards the camera.

SolvePNPPipe expects 3d object points to correspond to the CornerDetectionPipe implementation. The 2d corner detection finds the 4 extreme corners (bottom-left, bottom-right, top-right, top-left). To match our expectations, this means the model vertices would look like:

  • (+x, +y, 0)
  • (-x, +y, 0)
  • (-x, -y, 0)
  • (+x, -y, 0)

AprilTag models are currently only used for drawing on the output stream.

  • Enum Constant Details

    • k2016HighGoal

      public static final TargetModel k2016HighGoal
    • k2019DualTarget

      public static final TargetModel k2019DualTarget
    • k2020HighGoalOuter

      public static final TargetModel k2020HighGoalOuter
    • kCircularPowerCell7in

      public static final TargetModel kCircularPowerCell7in
    • k2022CircularCargoBall

      public static final TargetModel k2022CircularCargoBall
    • kAprilTag6in_16h5

      public static final TargetModel kAprilTag6in_16h5
    • kAprilTag6p5in_36h11

      public static final TargetModel kAprilTag6p5in_36h11
  • Method Details

    • values

      public static TargetModel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TargetModel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getRealWorldCoordinatesArray

      public List<org.opencv.core.Point3> getRealWorldCoordinatesArray()
    • getBoxHeight

      public double getBoxHeight()
    • setRealWorldCoordinatesArray

      public void setRealWorldCoordinatesArray(List<org.opencv.core.Point3> realWorldCoordinatesArray)
    • setBoxHeight

      public void setBoxHeight(double boxHeight)
    • getRealWorldTargetCoordinates

      public org.opencv.core.MatOfPoint3f getRealWorldTargetCoordinates()
    • getVisualizationBoxBottom

      public org.opencv.core.MatOfPoint3f getVisualizationBoxBottom()
    • getVisualizationBoxTop

      public org.opencv.core.MatOfPoint3f getVisualizationBoxTop()
    • release

      public void release()
      Specified by:
      release in interface Releasable