Package org.hivevisionftc.vision.weaver
Class WeaverRoute
java.lang.Object
org.hivevisionftc.vision.weaver.WeaverRoute
Plans a Marrow Weaver route through a list of detections.
List<Detection> detections = vision.fetchDetections(pose);
PathResult path = WeaverRoute.from(pose)
.avoid(new CircleZone(new Point(72, 72), 18))
.maxTargets(4)
.plan(detections);
if (path != null) follower.follow(PedroPathingConverter.toPath(path));
Detections must already be in field coordinates, which is what HiveVision.fetchDetections returns.
-
Method Summary
Modifier and TypeMethodDescriptionavoid(com.skeletonarmy.marrow.zones.Zone... zones) Adds zones, in field inches, that the route must bend around.avoid(Collection<? extends com.skeletonarmy.marrow.zones.Zone> zones) Adds zones, in field inches, that the route must bend around.Ends the route atendinstead of at the last detection.static WeaverRouteStarts a route atstart(field inches, heading in radians).maxTargets(int n) Visits at mostndetections, keeping the best ones.ordered()Visits detections in the order given instead of letting Weaver pick the cheapest order.com.skeletonarmy.marrow.weaver.PathResultPlans the route.
-
Method Details
-
from
Starts a route atstart(field inches, heading in radians). -
avoid
Adds zones, in field inches, that the route must bend around. -
avoid
Adds zones, in field inches, that the route must bend around. -
maxTargets
Visits at mostndetections, keeping the best ones. Zero or less means no limit. -
ordered
Visits detections in the order given instead of letting Weaver pick the cheapest order. -
end
Ends the route atendinstead of at the last detection. -
plan
Plans the route.- Parameters:
detections- detections in field coordinates- Returns:
- the planned route, or
nullif there are no detections - Throws:
RuntimeException- whatever Weaver throws for degenerate geometry; catch it to fall back
-