Package frc.lib5k.spatial
Class VisionTarget
- java.lang.Object
-
- frc.lib5k.spatial.VisionTarget
-
public class VisionTarget extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description VisionTarget(double x, double y)
VisionTarget to store positioning data about a point generated by a computer vision systemVisionTarget(double x, double y, double area)
VisionTarget to store positioning data about a point generated by a computer vision systemVisionTarget(java.awt.Point point)
VisionTarget to store positioning data about a point generated by a computer vision system
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
double
getArea()
double
getDistance()
Get the distance from the camera to the target in metersFieldPosition
getPosition(FieldPosition robot_position)
Get the target's field-relative position (does not account for angle)double
getX()
double
getY()
void
setArea(double area)
void
setExists(boolean exists)
void
setX(double x)
void
setY(double y)
-
-
-
Constructor Detail
-
VisionTarget
public VisionTarget(java.awt.Point point)
VisionTarget to store positioning data about a point generated by a computer vision system- Parameters:
point
- Point containing X, and Y positions
-
VisionTarget
public VisionTarget(double x, double y)
VisionTarget to store positioning data about a point generated by a computer vision system- Parameters:
x
- X position on video feedy
- Y position on video feed
-
VisionTarget
public VisionTarget(double x, double y, double area)
VisionTarget to store positioning data about a point generated by a computer vision system- Parameters:
x
- X position on video feedy
- Y position on video feedarea
- Area of target
-
-
Method Detail
-
getDistance
public double getDistance()
Get the distance from the camera to the target in meters- Returns:
- Distance in meters
-
getPosition
public FieldPosition getPosition(FieldPosition robot_position)
Get the target's field-relative position (does not account for angle)- Parameters:
robot_position
- Field-relative position of robot- Returns:
- Field-relative position of target
-
exists
public boolean exists()
-
setExists
public void setExists(boolean exists)
-
getY
public double getY()
-
setY
public void setY(double y)
-
getArea
public double getArea()
-
setArea
public void setArea(double area)
-
getX
public double getX()
-
setX
public void setX(double x)
-
-