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:
Unknown
2019-09-17 11:22:54 +03:00
parent 6187b1a205
commit fca17885bb
2 changed files with 39 additions and 10 deletions

View File

@@ -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
}