changed leg changed speed values of the kick

This commit is contained in:
Jonas
2018-06-15 15:51:30 +02:00
parent 81c9c174dc
commit f55a909867
2 changed files with 12 additions and 13 deletions

View File

@@ -6,4 +6,4 @@ if __name__ == "__main__":
cfg = read_config() cfg = read_config()
mover = NaoMover(cfg['ip']) mover = NaoMover(cfg['ip'])
mover.stand_up() mover.stand_up()
mover.kick() mover.kick(foot="R")

View File

@@ -7,17 +7,17 @@ from naoqi import ALProxy
class NaoMover(object): class NaoMover(object):
KICK_SEQUENCE = [ KICK_SEQUENCE = [
(0, 'ShoulderRoll', -45, 0.5), (0, 'ShoulderRoll', 45, 0.0125),
#'wait',
(0, 'AnkleRoll', 10, 0.05),
(1, 'AnkleRoll', 10, 0.05),
'wait', 'wait',
(0, 'AnkleRoll', -10, 0.1), (1, 'KneePitch', 90, 0.05),
(1, 'AnkleRoll', -10, 0.1), (1, 'AnklePitch', -40, 0.05),
'wait', 'wait',
(1, 'KneePitch', 90, 0.2), (1, 'HipPitch', -45, 0.08),
(1, 'AnklePitch', -40, 0.2), (1, 'KneePitch', 10, 0.20),
'wait', (1, 'AnklePitch', 20, 0.16)
(1, 'HipPitch', -45, 0.03),
(1, 'KneePitch', 10, 0.05),
(1, 'AnklePitch', 20, 0.03)
] ]
def __init__(self, nao_ip, nao_port=9559): def __init__(self, nao_ip, nao_port=9559):
@@ -40,11 +40,11 @@ class NaoMover(object):
self.set_hip_stiffness(0.8) self.set_hip_stiffness(0.8)
self.set_knee_stiffness(0.8) self.set_knee_stiffness(0.8)
self.set_ankle_stiffness(0.8) self.set_ankle_stiffness(0.8)
multiplier = 1 multiplier = 5
if foot == 'L': if foot == 'L':
sides = ['R', 'L'] sides = ['R', 'L']
elif foot == 'R': elif foot == 'R':
sides = ['R', 'L'] sides = ['L', 'R']
reverse = [] reverse = []
for motion in self.KICK_SEQUENCE: for motion in self.KICK_SEQUENCE:
if motion == 'wait': if motion == 'wait':
@@ -52,7 +52,6 @@ class NaoMover(object):
else: else:
print(motion) print(motion)
side, joint, angle, speed = motion side, joint, angle, speed = motion
reverse.extend(self.mp.getAngles([sides[side] + joint])
self.mp.setAngles( self.mp.setAngles(
[sides[side] + joint], [radians(angle)], speed * multiplier [sides[side] + joint], [radians(angle)], speed * multiplier
) )