fix knee action sign

This commit is contained in:
xxh
2026-04-11 04:23:01 -04:00
parent 239fbf4087
commit 43067000db

View File

@@ -554,7 +554,7 @@ class WalkEnv(gym.Env):
# Encourage active/varied knee motions early in training without dominating progress reward. # Encourage active/varied knee motions early in training without dominating progress reward.
left_knee_act = float(action[14]) left_knee_act = float(action[14])
right_knee_act = -float(action[20]) right_knee_act = float(action[20])
left_knee_delta = abs(left_knee_act - float(self.last_action_for_reward[14])) left_knee_delta = abs(left_knee_act - float(self.last_action_for_reward[14]))
right_knee_delta = abs(right_knee_act - float(self.last_action_for_reward[20])) right_knee_delta = abs(right_knee_act - float(self.last_action_for_reward[20]))
knee_action_mag = 0.5 * (abs(left_knee_act) + abs(right_knee_act)) knee_action_mag = 0.5 * (abs(left_knee_act) + abs(right_knee_act))
@@ -663,6 +663,8 @@ class WalkEnv(gym.Env):
# Boost knee command range so policy can produce visible knee flexion earlier. # Boost knee command range so policy can produce visible knee flexion earlier.
# action[14] = np.clip(action[14] * 1.1, -10.0, 10.0) # action[14] = np.clip(action[14] * 1.1, -10.0, 10.0)
# action[20] = np.clip(action[20] * 1.1, -10.0, 10.0) # action[20] = np.clip(action[20] * 1.1, -10.0, 10.0)
# action[14] = 1 # the correct left knee sign
# action[20] = -1 # the correct right knee sign
# action[11] = 1 # action[11] = 1
# action[17] = 1 # action[17] = 1
# action[12] = -0.01 # action[12] = -0.01