Class RectangularRegion

java.lang.Object
com.flarerobotics.lib.region.RectangularRegion

public class RectangularRegion extends Object
A rectangular region on the field used to divide field into sections.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RectangularRegion(edu.wpi.first.math.geometry.Translation2d bottomLeft, edu.wpi.first.math.geometry.Translation2d topRight)
    Create a 2D rectangular region.
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.math.geometry.Translation2d
    Returns the bottom left translation.
    double
    Returns the top right X position.
    double
    Returns the top right Y position.
    double
    Returns the bottom left X position.
    double
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.