added threshold in ball_approch for error prevention
This commit is contained in:
@@ -74,8 +74,12 @@ class BallFollower(object):
|
||||
d_yaw, d_pitch = x, 0
|
||||
print(d_yaw)
|
||||
|
||||
# dont move the head, when the angle is below a threshold
|
||||
# otherwise function would raise an error and stop
|
||||
if (abs(d_yaw)>=0.00001):
|
||||
self.mover.change_head_angles(d_yaw * 0.7, d_pitch,
|
||||
abs(d_yaw) / 2)
|
||||
|
||||
# self.counter = 0
|
||||
yaw = self.mover.get_head_angles()[0]
|
||||
if abs(yaw) > 0.4:
|
||||
|
||||
Reference in New Issue
Block a user