From de18a567649964d5f12b2bc31f44489d3ef26229 Mon Sep 17 00:00:00 2001 From: xbpeng Date: Mon, 9 Jan 2023 14:26:42 -0800 Subject: [PATCH] fixing observation history shuffling bug --- ase/env/tasks/humanoid_amp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ase/env/tasks/humanoid_amp.py b/ase/env/tasks/humanoid_amp.py index f01285f7..09246c17 100644 --- a/ase/env/tasks/humanoid_amp.py +++ b/ase/env/tasks/humanoid_amp.py @@ -275,9 +275,11 @@ def _set_env_state(self, env_ids, root_pos, root_rot, dof_pos, root_vel, root_an def _update_hist_amp_obs(self, env_ids=None): if (env_ids is None): - self._hist_amp_obs_buf[:] = self._amp_obs_buf[:, 0:(self._num_amp_obs_steps - 1)] + for i in reversed(range(self._amp_obs_buf.shape[1] - 1)): + self._amp_obs_buf[:, i + 1] = self._amp_obs_buf[:, i] else: - self._hist_amp_obs_buf[env_ids] = self._amp_obs_buf[env_ids, 0:(self._num_amp_obs_steps - 1)] + for i in reversed(range(self._amp_obs_buf.shape[1] - 1)): + self._amp_obs_buf[env_ids, i + 1] = self._amp_obs_buf[env_ids, i] return def _compute_amp_observations(self, env_ids=None):