Package ftclib.vision
Class FtcVisionAprilTag
java.lang.Object
ftclib.vision.FtcVisionAprilTag
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This class encapsulates info of the detected object.static class
This class encapsulates all the parameters for creating the AprilTag vision processor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.firstinspires.ftc.vision.apriltag.AprilTagProcessor
private final String
final TrcDbgTrace
-
Constructor Summary
ConstructorsConstructorDescriptionFtcVisionAprilTag
(FtcVisionAprilTag.Parameters params, org.firstinspires.ftc.vision.apriltag.AprilTagProcessor.TagFamily tagFamily) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiongetBestDetectedTargetInfo
(Integer id, Comparator<? super TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject>> comparator) This method returns the target info of the best detected target.getDetectedTargetInfo
(org.firstinspires.ftc.vision.apriltag.AprilTagDetection detection) This method returns the target info of the given detected target.getDetectedTargetsInfo
(Integer id, Comparator<? super TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject>> comparator) This method returns an array list of target info on the filtered detected targets.org.firstinspires.ftc.vision.apriltag.AprilTagProcessor
This method returns the AprilTag vision processor.toString()
This method returns the tag family string.
-
Field Details
-
tracer
-
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
This method returns the 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
public ArrayList<TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject>> getDetectedTargetsInfo(Integer id, Comparator<? super TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject>> comparator) 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
public TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject> getBestDetectedTargetInfo(Integer id, Comparator<? super TrcVisionTargetInfo<FtcVisionAprilTag.DetectedObject>> comparator) 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.
-