head moves back when ball is found. This ensures, that the robot can find the ball properly while rotating

This commit is contained in:
Jonas
2018-06-12 11:53:18 +02:00
parent 9bc732807a
commit 0823eac228

View File

@@ -85,7 +85,7 @@ class BallFollower(object):
if abs(yaw) > 0.4: if abs(yaw) > 0.4:
# self.counter = 0 # self.counter = 0
print('Going to rotate') print('Going to rotate')
# self.mover.set_head_angles(0, 0, 0.05) self.mover.set_head_angles(0, 0, 0.5)
self.mover.move_to(0, 0, yaw) self.mover.move_to(0, 0, yaw)
self.mover.wait() self.mover.wait()
if self.run_after: if self.run_after:
@@ -107,7 +107,7 @@ if __name__ == '__main__':
hsv_lower=tuple(map(cfg.get, ('low_h', 'low_s', 'low_v'))), hsv_lower=tuple(map(cfg.get, ('low_h', 'low_s', 'low_v'))),
hsv_upper=tuple(map(cfg.get, ('high_h', 'high_s', 'high_v'))), hsv_upper=tuple(map(cfg.get, ('high_h', 'high_s', 'high_v'))),
min_radius=cfg['min_radius'], min_radius=cfg['min_radius'],
run_after=False run_after=True
) )
try: try:
while True: while True: