new leg ik for step

sprint
Her-darling 2 days ago
parent 0501c4bb46
commit ace001466f

@ -318,14 +318,14 @@ class sprint(gym.Env):
# Leg IK
a = self.act
l_ankle_pos = (a[0] * 0.02, max(0.01, a[1] * 0.02 + lfy), a[2] * 0.01 + lfz) # limit y to avoid self collision
r_ankle_pos = (a[3] * 0.02, min(a[4] * 0.02 + rfy, -0.01), a[5] * 0.01 + rfz) # limit y to avoid self collision
l_ankle_pos = (a[0] * 0.02, max(0.01, a[1] * 0.04 + lfy), a[2] * 0.02 + lfz) # limit y to avoid self collision
r_ankle_pos = (a[3] * 0.02, min(a[4] * 0.04 + rfy, -0.01), a[5] * 0.02 + rfz) # limit y to avoid self collision
l_foot_rot = a[6:9] * (3, 3, 5)
r_foot_rot = a[9:12] * (3, 3, 5)
# Limit leg yaw/pitch
l_foot_rot[2] = max(0, l_foot_rot[2] + 7)
r_foot_rot[2] = min(0, r_foot_rot[2] - 7)
l_foot_rot[2] = max(0, l_foot_rot[2] + 8)
r_foot_rot[2] = min(0, r_foot_rot[2] - 8)
# Arms actions
arms = np.copy(self.DEFAULT_ARMS) # default arms pose

Loading…
Cancel
Save