Saner color calibration. Finder API changed

This commit is contained in:
2018-06-23 13:08:12 +02:00
parent 2fff7d19a2
commit 126329bafd
6 changed files with 129 additions and 104 deletions

View File

@@ -68,9 +68,7 @@ class Striker(object):
def get_ball_angles_from_camera(self, cam):
"""Detect the ball and return its angles in camera coordinates."""
ball = self.ball_finder.find_colored_ball(
cam.get_frame()
)
ball = self.ball_finder.find(cam.get_frame())
if ball is None:
return None
@@ -194,9 +192,7 @@ class Striker(object):
self.mover.wait()
return False
goal_contour = self.goal_finder.find_goal_contour(
self.upper_camera.get_frame()
)
goal_contour = self.goal_finder.find(self.upper_camera.get_frame())
if goal_contour is not None:
goal_center_x = self.goal_finder.goal_center(goal_contour)
gcx_rel, _ = self.upper_camera.to_relative(goal_center_x, 0)