Package com.flarerobotics.lib.region
Class RectangularRegion
java.lang.Object
com.flarerobotics.lib.region.RectangularRegion
A rectangular region on the field used to divide field into sections.
-
Constructor Summary
ConstructorsConstructorDescriptionRectangularRegion
(edu.wpi.first.math.geometry.Translation2d bottomLeft, edu.wpi.first.math.geometry.Translation2d topRight) Create a 2D rectangular region. -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.math.geometry.Translation2d
Returns the bottom left translation.double
getMaxX()
Returns the top right X position.double
getMaxY()
Returns the top right Y position.double
getMinX()
Returns the bottom left X position.double
getMinY()
Returns the bottom left Y position.edu.wpi.first.math.geometry.Translation2d
Returns the top right translation.boolean
isPoseWithinArea
(edu.wpi.first.math.geometry.Pose2d pose) Returns whether the given pose is bound within the region.
-
Constructor Details
-
RectangularRegion
public RectangularRegion(edu.wpi.first.math.geometry.Translation2d bottomLeft, edu.wpi.first.math.geometry.Translation2d topRight) Create a 2D rectangular region.- Parameters:
bottomLeft
- The bottom left corner of the rectangle.topRight
- The top right corner of the rectangle.
-
-
Method Details
-
getBottomLeftPoint
public edu.wpi.first.math.geometry.Translation2d getBottomLeftPoint()Returns the bottom left translation.- Returns:
- The position.
-
getTopRightPoint
public edu.wpi.first.math.geometry.Translation2d getTopRightPoint()Returns the top right translation.- Returns:
- The position.
-
getMinX
public double getMinX()Returns the bottom left X position.- Returns:
- The position.
-
getMaxX
public double getMaxX()Returns the top right X position.- Returns:
- The position.
-
getMinY
public double getMinY()Returns the bottom left Y position.- Returns:
- The position.
-
getMaxY
public double getMaxY()Returns the top right Y position.- Returns:
- The position.
-
isPoseWithinArea
public boolean isPoseWithinArea(edu.wpi.first.math.geometry.Pose2d pose) Returns whether the given pose is bound within the region.- Parameters:
pose
- The pose to check.- Returns:
- True if bound within the region.
-