Package frc8768.visionlib
Class PhotonVision
java.lang.Object
frc8768.visionlib.PhotonVision
- All Implemented Interfaces:
Vision
Impl for photonvision for Vision-related things.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changePipeline
(int index) Change the current pipeline.double
getDistanceToTarget
(double mountAngle, double mountHeight, double goalHeight, boolean topY) Get the Distance to target via trigonometry.double
Sometimes, you may want to find the maximum Y for corners for the intake to suck in the top of a cone, or cube.List
<org.photonvision.targeting.PhotonTrackedTarget> Get all targets.
-
Constructor Details
-
PhotonVision
- Parameters:
name
- Camera hostname
-
-
Method Details
-
getTargets
Get all targets.- Specified by:
getTargets
in interfaceVision
- Returns:
- All targets in view.
-
changePipeline
public void changePipeline(int index) Change the current pipeline.- Specified by:
changePipeline
in interfaceVision
- Parameters:
index
- Pipeline index, depends on your configuration.
-
getDistanceToTarget
public double getDistanceToTarget(double mountAngle, double mountHeight, double goalHeight, boolean topY) Get the Distance to target via trigonometry.- Specified by:
getDistanceToTarget
in interfaceVision
- Parameters:
mountAngle
- The amount of degrees back the limelight is.mountHeight
- Height in inches from center of limelight lens to floor.goalHeight
- Distance in inches from floor to center of target.topY
- Get the top most location from the camera. Seethis method.
- Returns:
- Distance to target, returns -1 on fail.
-
getMaxPointY
public double getMaxPointY()Sometimes, you may want to find the maximum Y for corners for the intake to suck in the top of a cone, or cube. This function is helpful for that.- Specified by:
getMaxPointY
in interfaceVision
- Returns:
- The maximum Y point for all corners, or -1 if none is found
-