Modules
What each class does.
HiveVision
Section titled “HiveVision”HiveVision(Limelight3A limelight, VisionConfig config)HiveVision(DetectionSource source, VisionConfig config)
HiveVision setAllowedClasses(BiobuzzClasses... classes)List<Detection> fetchDetections(Pose robotPose)fetchDetections returns a new list, nearest first. It drops detections that are older than maxStalenessMs, below minConfidence, or outside setAllowedClasses. Calling setAllowedClasses() with no arguments allows everything again.
VisionConfig
Section titled “VisionConfig”Camera geometry and thresholds. Every setter returns this.
| Method | Default |
|---|---|
cameraPitchDeg, cameraHeightIn, cameraForwardIn, cameraLeftIn, targetHeightIn |
0 |
minConfidence |
0.5 |
maxStalenessMs |
1000 |
limelightPipeline |
0 |
limelightPollingRateHz |
100 (1 to 250) |
limelightPipeline and limelightPollingRateHz are read once, when HiveVision is constructed. Setting them later does nothing.
Detection
Section titled “Detection”| Method | Returns |
|---|---|
getPose(), getX(), getY() |
Field position, inches |
getType(), getClassId() |
BiobuzzClasses and the detector’s raw id |
getConfidence(), getArea() |
Detector output |
getTx(), getTy() |
Camera angles, degrees |
Immutable position (inches) and heading (radians). Has distanceTo(Pose).
BiobuzzClasses
Section titled “BiobuzzClasses”POLLEN (0), NECTAR_RED (1), NECTAR_BLUE (2), UNKNOWN. Look one up with BiobuzzClasses.fromId(int).
DetectionSource
Section titled “DetectionSource”The camera backend interface. LimelightSource implements it for a Limelight 3A and HiveVision creates one for you. Implement it to use another camera or to fake detections in tests. FieldProjector.project(...) is the projection math, exposed for testing.
Weaver
Section titled “Weaver”WeaverRoute
Section titled “WeaverRoute”PathResult path = WeaverRoute.from(robotPose) .avoid(new CircleZone(new Point(72, 72), 18)) .maxTargets(3) .plan(detections);| Method | Effect |
|---|---|
from(Pose) |
Required. Start of the route. |
avoid(Zone...), avoid(Collection) |
Zones the route bends around. |
maxTargets(int) |
Visit at most this many. Zero or less means no limit. |
ordered() |
Keep the given order instead of the cheapest one. |
end(Pose) |
Finish here. Heading is ignored. |
plan returns null for an empty list. Weaver throws on degenerate geometry; catch it.