Class Region

java.lang.Object
com.marswars.geometry.Region
Direct Known Subclasses:
CircularRegion, PolygonRegion

public abstract class Region extends Object
This class models a region of the field. Credit to frc-3061 for base code
  • Constructor Details

    • Region

      public Region()
  • Method Details

    • logPoints

      public abstract void logPoints()
      Log the points of the region. These can be visualized using AdvantageScope to confirm that the regions are properly defined.
    • contains

      public abstract boolean contains(Pose2d other)
      Returns true if the region contains a given Pose2d.
    • getName

      public abstract String getName()
      Returns the name of the region for logging purposes.
    • constructRegion

      public abstract void constructRegion()
      Constructs the region and prepares it for logging.
    • willContain

      public boolean willContain(Pose2d robotPose, ChassisSpeeds robotSpeed, double time)
      Returns true if the region will contain a given Pose2d after moving at a given speed for a given time.
      Parameters:
      robotPose - current robot pose
      robotSpeed - current robot speed
      time - time to project forward
      Returns:
      if the pose is inside the region after moving