Package ftclib.vision

Class FtcVisionAprilTag

java.lang.Object
ftclib.vision.FtcVisionAprilTag

public class FtcVisionAprilTag extends Object
This class encapsulates the AprilTag vision processor to make all vision processors conform to our framework library. By doing so, one can switch between different vision processors and have access to a common interface.
  • Field Details

    • tracer

      public final TrcDbgTrace tracer
    • instanceName

      private final String instanceName
    • aprilTagProcessor

      private final org.firstinspires.ftc.vision.apriltag.AprilTagProcessor aprilTagProcessor
  • Constructor Details

    • FtcVisionAprilTag

      public FtcVisionAprilTag(FtcVisionAprilTag.Parameters params, org.firstinspires.ftc.vision.apriltag.AprilTagProcessor.TagFamily tagFamily)
      Constructor: Create an instance of the object.
      Parameters:
      params - specifies the AprilTag parameters, can be null if using default parameters.
      tagFamily - specifies the tag family.
  • Method Details

    • toString

      @NonNull public String toString()
      This method returns the tag family string.
      Overrides:
      toString in class Object
      Returns:
      tag family string.
    • getVisionProcessor

      public org.firstinspires.ftc.vision.apriltag.AprilTagProcessor getVisionProcessor()
      This method returns the AprilTag vision processor.
      Returns:
      AprilTag vision processor.
    • getDetectedTargetInfo

      public TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject> getDetectedTargetInfo(org.firstinspires.ftc.vision.apriltag.AprilTagDetection detection)
      This method returns the target info of the given detected target.
      Parameters:
      detection - specifies the detected target.
      Returns:
      information about the detected target.
    • getDetectedTargetsInfo

      This method returns an array list of target info on the filtered detected targets.
      Parameters:
      id - specifies the AprilTag ID to look for, null if match to any ID.
      comparator - specifies the comparator to sort the array if provided, can be null if not provided.
      Returns:
      sorted target info array list.
    • getBestDetectedTargetInfo

      This method returns the target info of the best detected target.
      Parameters:
      id - specifies the AprilTag ID to look for, null if match to any ID.
      comparator - specifies the comparator to sort the array if provided, can be null if not provided.
      Returns:
      information about the best detected target.