Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
Kyle Corry edited this page Jan 9, 2019 · 2 revisions

Targets are typically FRC vision targets which are detected in an image. A Target provides several calculations about the target, such as its angle from the camera and skew (or rotation).

Understanding a Target's data

  • Horizontal angle: The horizontal angle in degrees from the center of the camera to the center of the target (based on camera view angle). Positive angles are to the right of the image. This can be used to generate a setpoint angle which your robot can align with using a faster sensor such as a gyroscope. Use target.getHorizontalAngle().
  • Vertical angle: The vertical angle in degrees from the center of the camera to the center of the target (based on camera view angle). Positive angles are to the top of the image. This can be used to calculate the distance to the target or align a shooting mechanism vertically. Use target.getVerticalAngle().
  • Boundary: The rotated rectangle (min area rectangle) bounding box which surrounds the target. Use this to outline a target on the image. Use target.getBoundary().
  • Percent area: The percent of the image area which the target takes up. This can be used to calculate the distance to a fixed size target or to select the largest target. Use target.getPercentArea().
  • Skew: The rotation angle in degrees of the target, which -90 is rotated 90 degrees to the left and 90 is rotated 90 degrees to the right. Use this to determine which way a target is angled toward (useful in the FRC 2019 game). This assumes the target has a tall aspect ratio. Use target.getSkew().
Clone this wiki locally