Apply bugfixes from Open House day
This commit is contained in:
0
pykick/__init__.py
Normal file
0
pykick/__init__.py
Normal file
@@ -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.mover.stand_up()
|
||||
sleep(0.5)
|
||||
striker.speak('Nice kick. Lets do the dance')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,6 +39,6 @@
|
||||
]
|
||||
],
|
||||
"cam": 1,
|
||||
"ip": "192.168.0.11",
|
||||
"ip": "10.152.246.74",
|
||||
"port": 9559
|
||||
}
|
||||
@@ -255,13 +255,13 @@ class Striker(object):
|
||||
"""
|
||||
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)
|
||||
y_angle = pi/2 - y_angle - radians(16.5) - (radians(39)
|
||||
if camera == 'lower'
|
||||
else 0)
|
||||
print('Ball distance through', camera, 'camera')
|
||||
@@ -269,7 +269,7 @@ class Striker(object):
|
||||
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):
|
||||
"""Turn the robot to the ball, find the ball if cannot see it.
|
||||
|
||||
Reference in New Issue
Block a user