From 6aefab5694534146e8f5e7476c4116990c0cc2bb Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 4 Jun 2018 12:57:14 +0200 Subject: [PATCH] added comment in ball approach, ball search, when ball is not in the view, needs to be improved --- scripts/ball_approach.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/ball_approach.py b/scripts/ball_approach.py index 9c2c126..96acdff 100644 --- a/scripts/ball_approach.py +++ b/scripts/ball_approach.py @@ -46,10 +46,14 @@ class BallFollower(object): 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) + # this conidition needs to be improved, as the robot tend starts to search in the right direction, + # as soon as the angle is not -1 anymore + if head_angles[0]==-1: + self.mover.set_head_angles(1,0,0.05) + print("move head to the left") else: - self.mover.set_head_angles(-0.5,0,0.05) + self.mover.set_head_angles(-1,0,0.05) + print("move head to the right") return #print(x, y) self.process_coordinates(x, y)