Package ftclib.vision
Class FtcLimelightVision.DetectedObject
java.lang.Object
ftclib.vision.FtcLimelightVision.DetectedObject
- All Implemented Interfaces:
TrcVisionTargetInfo.ObjectInfo
- Enclosing class:
- FtcLimelightVision
public static class FtcLimelightVision.DetectedObject
extends Object
implements TrcVisionTargetInfo.ObjectInfo
This class encapsulates info of the detected object. It extends TrcOpenCvDetector.DetectedObject that requires
it to provide a method to return the detected object rect and area.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDetectedObject(com.qualcomm.hardware.limelightvision.LLResult llResult, FtcLimelightVision.ResultType resultType, Object result, String label, org.firstinspires.ftc.robotcore.external.navigation.Pose3D robotPose, FtcLimelightVision.TargetGroundOffset targetGroundOffset, TrcPose3D cameraPose) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptiondoubleThis method returns the area of the detected object.This method returns the objects real world depth.This method returns the pose of the detected object relative to the camera.org.opencv.core.RectThis method returns the rect of the detected object.This method returns the objects real world width.This method returns the object's pixel height.This method returns the object's pixel width.private TrcPose2DgetRobotPose(org.firstinspires.ftc.robotcore.external.navigation.Pose3D botpose, TrcPose3D cameraPose) This method returns the robot's field position as a TrcPose2D.This method returns the object's rotated rectangle angle.org.opencv.core.Point[]This method returns the rotated rect vertices of the detected object.private TrcPose2DgetTargetPose(TrcPose3D cameraPose) This method calculates the target pose of the detected object.toString()This method returns the string form of the target info.
-
Field Details
-
llResult
public final com.qualcomm.hardware.limelightvision.LLResult llResult -
resultType
-
result
-
label
-
targetGroundOffset
-
targetPose
-
robotPose
-
vertices
public final org.opencv.core.Point[] vertices -
pixelWidth
public final double pixelWidth -
pixelHeight
public final double pixelHeight -
rotatedAngle
public final double rotatedAngle -
targetRect
public final org.opencv.core.Rect targetRect -
targetArea
public final double targetArea -
targetDepth
public double targetDepth
-
-
Constructor Details
-
Method Details
-
toString
This method returns the string form of the target info. -
getObjectRect
public org.opencv.core.Rect getObjectRect()This method returns the rect of the detected object.- Specified by:
getObjectRectin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rect of the detected object.
-
getObjectArea
public double getObjectArea()This method returns the area of the detected object.- Specified by:
getObjectAreain interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- area of the detected object.
-
getPixelWidth
This method returns the object's pixel width.- Specified by:
getPixelWidthin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object pixel width, null if not supported.
-
getPixelHeight
This method returns the object's pixel height.- Specified by:
getPixelHeightin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object pixel height, null if not supported.
-
getRotatedAngle
This method returns the object's rotated rectangle angle.- Specified by:
getRotatedAnglein interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rotated rectangle angle.
-
getObjectPose
This method returns the pose of the detected object relative to the camera.- Specified by:
getObjectPosein interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- pose of the detected object relative to camera.
-
getObjectWidth
This method returns the objects real world width.- Specified by:
getObjectWidthin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object real world width, null if not supported.
-
getObjectDepth
This method returns the objects real world depth.- Specified by:
getObjectDepthin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object real world depth, null if not supported.
-
getRotatedRectVertices
public org.opencv.core.Point[] getRotatedRectVertices()This method returns the rotated rect vertices of the detected object.- Specified by:
getRotatedRectVerticesin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rotated rect vertices.
-
getTargetPose
This method calculates the target pose of the detected object.- Parameters:
cameraPose- specifies the the camera position on the robot.- Returns:
- target pose from the camera.
-