Package com.marswars.geometry
Class Region
java.lang.Object
com.marswars.geometry.Region
- Direct Known Subclasses:
CircularRegion,PolygonRegion
This class models a region of the field. Credit to frc-3061 for base code
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidConstructs the region and prepares it for logging.abstract booleanReturns true if the region contains a given Pose2d.abstract StringgetName()Returns the name of the region for logging purposes.abstract voidLog the points of the region.booleanwillContain(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.
-
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
Returns true if the region contains a given Pose2d. -
getName
Returns the name of the region for logging purposes. -
constructRegion
public abstract void constructRegion()Constructs the region and prepares it for logging. -
willContain
Returns true if the region will contain a given Pose2d after moving at a given speed for a given time.- Parameters:
robotPose- current robot poserobotSpeed- current robot speedtime- time to project forward- Returns:
- if the pose is inside the region after moving
-