Package com.marswars.geometry
Class CircularRegion
java.lang.Object
com.marswars.geometry.Region
com.marswars.geometry.CircularRegion
This class models a region of the field. It is defined by its center and radius Credit to
frc-3061 for base code
-
Constructor Summary
ConstructorsConstructorDescriptionCircularRegion(Translation2d center, double radius, String region_name) Create a CircularRegion, defined by its center and radius. -
Method Summary
Modifier and TypeMethodDescriptionvoidConstructs the region and prepares it for logging.booleanReturns true if the region contains a given Pose2d.Get the center of the circular regiongetName()Returns the name of the region for logging purposes.doubleGet the radius of the circular regionvoidLog the circumference of the circle in 360 points.Methods inherited from class com.marswars.geometry.Region
willContain
-
Constructor Details
-
CircularRegion
Create a CircularRegion, defined by its center and radius.- Parameters:
center- the center point of the circular regionradius- the radius of the circular region in metersregion_name- the name of the region that is used for logging
-
-
Method Details
-
constructRegion
public void constructRegion()Description copied from class:RegionConstructs the region and prepares it for logging.- Specified by:
constructRegionin classRegion
-
logPoints
public void logPoints()Log the circumference of the circle in 360 points. 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
Description copied from class:RegionReturns the name of the region for logging purposes. -
getCenter
Get the center of the circular region- Returns:
- the center of the circular region
-
getRadius
public double getRadius()Get the radius of the circular region- Returns:
- the radius of the circular region
-