fix: remove broken feet_air_time override, use base class

This commit is contained in:
8x54zj-m
2026-06-30 15:03:52 +08:00
parent 3fd2793f28
commit f2a8e0e2ff

View File

@@ -547,15 +547,8 @@ class DreamWaQTask(Go1WalkTask):
# stand_still 在上游被注释掉 # stand_still 在上游被注释掉
} }
def _reward_feet_air_time(self, commands, info): # _reward_feet_air_time 使用基类实现walk_np.py
"""足部腾空时间奖励——与上游 legged_robot.py 公式一致。""" # 之前 override 读了不存在的 key 导致 reward 永远为 0
first_contact = info.get("first_contact")
air_time = info.get("air_time_at_contact")
if first_contact is None or air_time is None:
return np.zeros(self._num_envs, dtype=np.float32)
rew = np.sum((air_time - 0.5) * first_contact, axis=1)
rew *= np.linalg.norm(commands[:, :2], axis=1) > 0.1
return rew
def update_reward(self, state): def update_reward(self, state):
"""存储各项奖励到 TensorBoard + 累计 episode 总和。""" """存储各项奖励到 TensorBoard + 累计 episode 总和。"""