diff --git a/pykick/__init__.py b/pykick/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pykick/__main__.py b/pykick/__main__.py index 4f670bd..ea907cd 100644 --- a/pykick/__main__.py +++ b/pykick/__main__.py @@ -19,10 +19,10 @@ if __name__ == '__main__': ball_min_radius=cfg['ball_min_radius'], ) - striker.speak('tiger') - sleep(4.75) + # striker.speak('tiger') + # sleep(4.75) striker.mover.stand_up(1.0) - sleep(9) + # sleep(9) print('Initialized') striker.speak('Initialized') @@ -132,7 +132,7 @@ if __name__ == '__main__': sleep(0.3) if success: state = 'kick' - striker.speak('hasta') + # striker.speak('hasta') except ValueError: striker.ball_tracking() @@ -159,9 +159,9 @@ if __name__ == '__main__': else: striker.speak('I succeeded, confirmed') sleep(0.5) - break + else: + striker.speak('I succeeded, presumably') - striker.speak('I succeeded, presumably') striker.mover.stand_up() sleep(0.5) striker.speak('Nice kick. Lets do the dance') diff --git a/pykick/movements.py b/pykick/movements.py index ffb251b..638a1c4 100644 --- a/pykick/movements.py +++ b/pykick/movements.py @@ -32,8 +32,8 @@ class NaoMover(object): # [[(0, 1, 'ShoulderRoll', -70)], 0.5], # lean to the side using the ankle joints - [[(0, 1, 'AnkleRoll', -11), - (1, 1, 'AnkleRoll', -11)], + [[(0, 1, 'AnkleRoll', -12), + (1, 1, 'AnkleRoll', -12)], 1], # lift the foot using the knee joint and the ankle joint diff --git a/pykick/nao_defaults.json b/pykick/nao_defaults.json index d0a12f6..f59eb30 100644 --- a/pykick/nao_defaults.json +++ b/pykick/nao_defaults.json @@ -39,6 +39,6 @@ ] ], "cam": 1, - "ip": "192.168.0.11", + "ip": "10.152.246.74", "port": 9559 -} \ No newline at end of file +} diff --git a/pykick/striker.py b/pykick/striker.py index 2571f2c..6fd0f8e 100644 --- a/pykick/striker.py +++ b/pykick/striker.py @@ -185,21 +185,21 @@ class Striker(object): def distance_to_ball(self): camera = 'upper' angles = self.get_ball_angles_from_camera(self.upper_camera) - if angles == None: + if angles is None: camera = 'lower' angles = self.get_ball_angles_from_camera(self.lower_camera) - if angles == None: + if angles is None: raise ValueError('No ball in sight') y_angle = angles[1] - y_angle = pi/2 - y_angle - radians(15) - (radians(39) - if camera == 'lower' - else 0) + y_angle = pi/2 - y_angle - radians(16.5) - (radians(39) + if camera == 'lower' + else 0) print('Ball distance through', camera, 'camera') print('Angles', angles) return 0.5 * tan(y_angle) def walking_direction(self, lr, d, hypo): - return (asin(0.40 / d) if hypo == 'bdist' else atan(0.2 / d)) * lr + return (asin(0.43 / d) if hypo == 'bdist' else atan(0.23 / d)) * lr def ball_tracking(self, soll=0, tol=0.15): """Track the ball using the feed from top and bottom camera.