From f651f4ea723d8bb845246c1046d7cbce4a94ad99 Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Tue, 31 Dec 2024 20:09:20 +0800 Subject: [PATCH 1/3] Add prev prev action --- .../omni/isaac/lab/managers/action_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py index 30ed9d41ef..26baab4ad0 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py @@ -195,6 +195,7 @@ def __init__(self, cfg: object, env: ManagerBasedEnv): # create buffers to store actions self._action = torch.zeros((self.num_envs, self.total_action_dim), device=self.device) self._prev_action = torch.zeros_like(self._action) + self._prev_prev_action = torch.zeros_like(self._action) # check if any term has debug visualization implemented self.cfg.debug_vis = False @@ -250,6 +251,11 @@ def prev_action(self) -> torch.Tensor: """The previous actions sent to the environment. Shape is (num_envs, total_action_dim).""" return self._prev_action + @property + def prev_prev_action(self) -> torch.Tensor: + """The previous actions sent to the environment. Shape is (num_envs, total_action_dim).""" + return self._prev_prev_action + @property def has_debug_vis_implementation(self) -> bool: """Whether the command terms have debug visualization implemented.""" @@ -307,6 +313,7 @@ def reset(self, env_ids: Sequence[int] | None = None) -> dict[str, torch.Tensor] if env_ids is None: env_ids = slice(None) # reset the action history + self._prev_prev_action[env_ids] = 0.0 self._prev_action[env_ids] = 0.0 self._action[env_ids] = 0.0 # reset all action terms @@ -328,6 +335,7 @@ def process_action(self, action: torch.Tensor): if self.total_action_dim != action.shape[1]: raise ValueError(f"Invalid action shape, expected: {self.total_action_dim}, received: {action.shape[1]}.") # store the input actions + self._prev_prev_action[:] = self._prev_action self._prev_action[:] = self._action self._action[:] = action.to(self.device) From b13324920ee3009eac98037fbd2adef8dc3f75f0 Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Tue, 31 Dec 2024 20:16:58 +0800 Subject: [PATCH 2/3] update doc --- .../omni.isaac.lab/omni/isaac/lab/managers/action_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py index 26baab4ad0..bc2a55d8b5 100644 --- a/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py +++ b/source/extensions/omni.isaac.lab/omni/isaac/lab/managers/action_manager.py @@ -253,7 +253,7 @@ def prev_action(self) -> torch.Tensor: @property def prev_prev_action(self) -> torch.Tensor: - """The previous actions sent to the environment. Shape is (num_envs, total_action_dim).""" + """The previous previous actions sent to the environment. Shape is (num_envs, total_action_dim).""" return self._prev_prev_action @property From b2b86b9378bf67ec72c3bb35460901cb286019fe Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Tue, 31 Dec 2024 20:20:36 +0800 Subject: [PATCH 3/3] add changelog --- source/extensions/omni.isaac.lab/docs/CHANGELOG.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/extensions/omni.isaac.lab/docs/CHANGELOG.rst b/source/extensions/omni.isaac.lab/docs/CHANGELOG.rst index a96a1c2c04..4ae3244167 100644 --- a/source/extensions/omni.isaac.lab/docs/CHANGELOG.rst +++ b/source/extensions/omni.isaac.lab/docs/CHANGELOG.rst @@ -1,6 +1,15 @@ Changelog --------- +0.30.2 (2024-12-31) +~~~~~~~~~~~~~~~~~~~ + +Added +^^^^^ + +* Added ``prev_prev_action`` and ``_prev_prev_action`` to :class:`omni.isaac.lab.managers.ActionTerm` + + 0.30.1 (2024-12-17) ~~~~~~~~~~~~~~~~~~~