mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
added pipeline listener methods and fixed centermost sort
-added change camera values function -added pipeline listener - added driver mode listener -changed centermost to use Collections and grab the minimum distance
This commit is contained in:
@@ -105,7 +105,8 @@ public class VisionProcess {
|
||||
case "Rightmost":
|
||||
return Collections.max(inputRects, Comparator.comparing(rect -> rect.center.x));
|
||||
case "Centermost":
|
||||
return inputRects.stream().sorted(SortByCentermostComparator).collect(Collectors.toList()).get(0);
|
||||
return Collections.min(inputRects, SortByCentermostComparator);
|
||||
// return inputRects.stream().sorted(SortByCentermostComparator).collect(Collectors.toList()).get(0);
|
||||
default:
|
||||
return inputRects.get(0); // default to whatever the first contour is, but this should never happen
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user