diff --git a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py index 9e90458..8a1295f 100644 --- a/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py +++ b/motrix_envs/src/motrix_envs/locomotion/go1/dreamwaq.py @@ -335,11 +335,14 @@ class DreamWaQTask(Go1WalkTask): data.set_dof_pos(np.nan_to_num(np.array(dp), nan=0.0, posinf=0.0, neginf=0.0), self._model) obs = self._get_obs(data, state.info) - # 更新历史缓冲区 - old_history = state.info.get("obs_history", + # 更新历史缓冲区:CENet 用不含当前帧的历史预测下一帧(论文 LVAE = MSE(õ_{t+1}, o_{t+1})) + full_hist = state.info.get("obs_history_full", np.zeros((self._num_envs, self._cfg.num_history, 45), dtype=np.float32)) - new_history = np.concatenate([old_history[:, 1:, :], obs[:, np.newaxis, :]], axis=1) - state.info["obs_history"] = new_history + # 当前 CENet 输入:上一轮保存的历史(止于 o_{t-1}) + state.info["obs_history"] = full_hist + # 为下一轮准备新历史:滑窗 + 当前帧 + new_full = np.concatenate([full_hist[:, 1:, :], obs[:, np.newaxis, :]], axis=1) + state.info["obs_history_full"] = new_full current_step = state.info.get("steps", np.zeros(self._num_envs, dtype=np.int32))