Zones
package com.skeletonarmy.marrow.zones
Overview
The Zones system defines geometric regions on the field used for spatial reasoning and autonomous decision-making.
Zones represent physical areas - such as scoring areas - and can be circle-based or polygon-based.
Check out the "Spatial Awareness" page to learn how to use Zones for autonomous behaviors.

For Zones to work properly, the robot's position on the field must be accurate. Zones does not perform localization itself; instead, it relies on position data provided by any localizer you choose.
Usage
All zones implement the Zone interface, which provides common geometry methods.
Two built-in implementations are available:
CircleZone- circular areas defined by center and radiusPolygonZone- triangular, rectangular, or arbtrary-shaped areas defined by three or more points.
boolean contains(Point p)
Checks if a point lies within or on the zone.
double distanceTo(Point p)
Returns the shortest distance from a point to the zone boundary.
double distanceTo(Zone other)
Returns the shortest distance between two zones.
boolean isInside(Zone other)
True if this zone overlaps or is contained in another.
boolean isFullyInside(Zone other)
True if this zone is fully contained in another.
void moveBy(double dx, double dy)
Translates the zone.
void setPosition(double x, double y)
Moves the zone’s center or reference point.
Example Usage
The following example shows how Zones can be used with Pedro Pathing to detect if the robot is inside or near key areas on the 2025–2026 DECODE field:
Last updated