rotate head to the left and to the right if the ball is not in the view

This commit is contained in:
Jonas
2018-06-04 12:46:05 +02:00
parent 76b53e83dd
commit 11769f1681

View File

@@ -44,9 +44,15 @@ class BallFollower(object):
x, y = self.video_bot.to_relative(x, y)
#print('Low camera')
except TypeError:
print("Ball is not in the view\n")
head_angles=self.mover.get_head_angles()
if head_angles[0]==-0.5:
self.mover.set_head_angles(0.5,0,0.05)
else:
self.mover.set_head_angles(-0.5,0,0.05)
return
#print(x, y)
#self.process_coordinates(x, y)
self.process_coordinates(x, y)
def process_coordinates(self, x, y):
x_diff = x - 0.5