Class VisionTargetSim

java.lang.Object
org.photonvision.simulation.VisionTargetSim

public class VisionTargetSim extends Object
Describes a vision target located somewhere on the field that your vision system can detect.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     
    final int
    The object detection class ID, or -1 if not applicable.
    final float
    The object detection confidence, or -1 if not applicable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model)
    Describes a retro-reflective/colored shape vision target located somewhere on the field that your vision system can detect.
    VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model, int id)
    Describes a fiducial tag located somewhere on the field that your vision system can detect.
    VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model, int objDetClassId, float objDetConf)
    Describes an object-detection vision target located somewhere on the field that your vision system can detect.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    List<org.wpilib.math.geometry.Translation3d>
    This target's vertices offset from its field pose.
    Returns the model describing this target's geometry.
    org.wpilib.math.geometry.Pose3d
    Returns the pose of this target on the field.
    void
    Sets the model describing this target's geometry.
    void
    setPose(org.wpilib.math.geometry.Pose3d pose)
    Sets the pose of this target on the field.

    Methods inherited from class Object

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

    • fiducialID

      public final int fiducialID
    • objDetClassId

      public final int objDetClassId
      The object detection class ID, or -1 if not applicable.
    • objDetConf

      public final float objDetConf
      The object detection confidence, or -1 if not applicable.
  • Constructor Details

    • VisionTargetSim

      public VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model)
      Describes a retro-reflective/colored shape vision target located somewhere on the field that your vision system can detect.
      Parameters:
      pose - Pose3d of the tag in field-relative coordinates
      model - TargetModel which describes the geometry of the target
    • VisionTargetSim

      public VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model, int id)
      Describes a fiducial tag located somewhere on the field that your vision system can detect.
      Parameters:
      pose - Pose3d of the tag in field-relative coordinates
      model - TargetModel which describes the geometry of the target(tag)
      id - The ID of this fiducial tag
    • VisionTargetSim

      public VisionTargetSim(org.wpilib.math.geometry.Pose3d pose, TargetModel model, int objDetClassId, float objDetConf)
      Describes an object-detection vision target located somewhere on the field that your vision system can detect. Class ID is the (zero-indexed) index of the object's class ID in the list of all classes. Confidence can be specified, or pass -1 to estimate confidence based on 2 * sqrt(target area / total image area)
      Parameters:
      pose - Pose3d of the target in field-relative coordinates
      model - TargetModel which describes the geometry of the target
      objDetClassId - The object detection class ID, if -1 it will not be detected by object detection
      objDetConf - The object detection confidence, or -1 in which case the simulation will compute a confidence based on the area of the target in the camera's field of view
  • Method Details

    • setPose

      public void setPose(org.wpilib.math.geometry.Pose3d pose)
      Sets the pose of this target on the field.
      Parameters:
      pose - The pose in field-relative coordinates
    • setModel

      public void setModel(TargetModel model)
      Sets the model describing this target's geometry.
      Parameters:
      model - The model of the target
    • getPose

      public org.wpilib.math.geometry.Pose3d getPose()
      Returns the pose of this target on the field.
      Returns:
      The pose in field-relative coordinates
    • getModel

      Returns the model describing this target's geometry.
      Returns:
      The model of the target
    • getFieldVertices

      public List<org.wpilib.math.geometry.Translation3d> getFieldVertices()
      This target's vertices offset from its field pose.
      Returns:
      A vector of Translation3d representing the vertices of the target
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object