Class HyperbolicAxisAlignedBoundingBox
- java.lang.Object
-
- edu.wpi.first.wpilibj.geometry.Translation2d
-
- io.github.frc5024.lib5k.vision.types.Contour
-
- io.github.frc5024.lib5k.vision.types.AxisAlignedBoundingBox
-
- io.github.frc5024.lib5k.vision.types.HyperbolicAxisAlignedBoundingBox
-
public class HyperbolicAxisAlignedBoundingBox extends AxisAlignedBoundingBox
HyperbolicAxisAlignedBoundingBox is a non-euclideanAxisAlignedBoundingBox
in hyperbolic space
-
-
Field Summary
-
Fields inherited from class io.github.frc5024.lib5k.vision.types.Contour
NO_ROTATION
-
-
Constructor Summary
Constructors Constructor Description HyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d hRot, Rotation2d vRot)
Create a HyperbolicAxisAlignedBoundingBox from a horizontal and vertical thetaHyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d xRot, Rotation2d yRot, Rotation2d hRot, Rotation2d vRot)
Create a HyperbolicAxisAlignedBoundingBox from a horizontal and vertical thetaHyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d xRot, Rotation2d yRot, Rotation2d leftRot, Rotation2d rightRot, Rotation2d topRot, Rotation2d bottomRot)
Create a HyperbolicAxisAlignedBoundingBox using rotations for each side
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rotation2d
getBottomBoundRotation()
Get the rotation from the center to the bottom boundRotation2d
getHorizontalTheta()
Get the theta between the left and right boundsRotation2d
getLeftBoundRotation()
Get the rotation from the center to the left boundRotation2d
getRightBoundRotation()
Get the rotation from the center to the right boundRotation2d
getTopBoundRotation()
Get the rotation from the center to the top boundRotation2d
getVerticalTheta()
Get the theta between the top and bottom boundsboolean
isBalanced()
Get if isHorizontalBalanced and isVerticalBalanced are both trueboolean
isHorizontalBalanced()
Get if the left and right rotations are of equal proportionboolean
isVerticalBalanced()
Get if the top and bottom rotations are of equal proportion-
Methods inherited from class io.github.frc5024.lib5k.vision.types.AxisAlignedBoundingBox
contains, getAspectRatio, getBottomLeftCorner, getBottomRightCorner, getHeight, getTopLeftCorner, getTopRightCorner, getWidth, overlaps, toString
-
Methods inherited from class io.github.frc5024.lib5k.vision.types.Contour
getXRotation, getYRotation
-
Methods inherited from class edu.wpi.first.wpilibj.geometry.Translation2d
div, equals, getDistance, getNorm, getX, getY, hashCode, minus, plus, rotateBy, times, unaryMinus
-
-
-
-
Constructor Detail
-
HyperbolicAxisAlignedBoundingBox
public HyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d hRot, Rotation2d vRot)
Create a HyperbolicAxisAlignedBoundingBox from a horizontal and vertical theta- Parameters:
topLeft
- Left corner expressed as a percentage of the frame from the center (top left is -1,1)bottomRight
- Bottom right corner expressed as a percentage of the frame from the center (top left is -1,1)hRot
- Positive theta between the left and right boundsvRot
- Positive theta between the top and bottom bounds
-
HyperbolicAxisAlignedBoundingBox
public HyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d xRot, Rotation2d yRot, Rotation2d hRot, Rotation2d vRot)
Create a HyperbolicAxisAlignedBoundingBox from a horizontal and vertical theta- Parameters:
topLeft
- left corner expressed as a percentage of the frame from the center (top left is -1,1)bottomRight
- Bottom right corner expressed as a percentage of the frame from the center (top left is -1,1)xRot
- X angle from camerayRot
- Y angle from camerahRot
- Positive theta between the left and right boundsvRot
- Positive theta between the top and bottom bounds
-
HyperbolicAxisAlignedBoundingBox
public HyperbolicAxisAlignedBoundingBox(Translation2d topLeft, Translation2d bottomRight, Rotation2d xRot, Rotation2d yRot, Rotation2d leftRot, Rotation2d rightRot, Rotation2d topRot, Rotation2d bottomRot)
Create a HyperbolicAxisAlignedBoundingBox using rotations for each side- Parameters:
topLeft
- Top left corner expressed as a percentage of the frame from the center (top left is -1,1)bottomRight
- Bottom right corner expressed as a percentage of the frame from the center (top left is -1,1)xRot
- X angle from camerayRot
- Y angle from cameraleftRot
- Rotation of the left bound from the center pointrightRot
- Rotation of the right bound from the center pointtopRot
- Rotation of the top bound from the center pointbottomRot
- Rotation of bottom left bound from the center point
-
-
Method Detail
-
getHorizontalTheta
public Rotation2d getHorizontalTheta()
Get the theta between the left and right bounds- Returns:
- Theta between the left and right bounds
-
getVerticalTheta
public Rotation2d getVerticalTheta()
Get the theta between the top and bottom bounds- Returns:
- Theta between the top and bottom bounds
-
isHorizontalBalanced
public boolean isHorizontalBalanced()
Get if the left and right rotations are of equal proportion- Returns:
- Is left and right balanced
-
isVerticalBalanced
public boolean isVerticalBalanced()
Get if the top and bottom rotations are of equal proportion- Returns:
- Is top and bottom balanced
-
isBalanced
public boolean isBalanced()
Get if isHorizontalBalanced and isVerticalBalanced are both true- Returns:
- Is fully balanced
-
getLeftBoundRotation
public Rotation2d getLeftBoundRotation()
Get the rotation from the center to the left bound- Returns:
- Rotation
-
getRightBoundRotation
public Rotation2d getRightBoundRotation()
Get the rotation from the center to the right bound- Returns:
- Rotation
-
getTopBoundRotation
public Rotation2d getTopBoundRotation()
Get the rotation from the center to the top bound- Returns:
- Rotation
-
getBottomBoundRotation
public Rotation2d getBottomBoundRotation()
Get the rotation from the center to the bottom bound- Returns:
- Rotation
-
-