Unverified Commit d41c5a98 authored by Felipe Mohr's avatar Felipe Mohr Committed by GitHub

Fixes modify_action_space in RslRlVecEnvWrapper (#2185)

# Description

This PR corrects the position of the method
`self._modify_action_space()` in the RSL-RL Wrapper, so that it is only
called after retrieving the dimensions of the environment, preventing
errors related to the use of uninitialized attributes when using
`clip_actions` in `RslRlVecEnvWrapper`.

Fixes https://github.com/isaac-sim/IsaacLab/issues/2184

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [X] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [X] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [X] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------
Signed-off-by: 's avatarMayank Mittal <12863862+Mayankm96@users.noreply.github.com>
Co-authored-by: 's avatarMayank Mittal <12863862+Mayankm96@users.noreply.github.com>
parent 02d79b9d
...@@ -49,6 +49,7 @@ Guidelines for modifications: ...@@ -49,6 +49,7 @@ Guidelines for modifications:
* CY (Chien-Ying) Chen * CY (Chien-Ying) Chen
* David Yang * David Yang
* Dorsa Rohani * Dorsa Rohani
* Felipe Mohr
* Felix Yu * Felix Yu
* Gary Lvov * Gary Lvov
* Giulio Romualdi * Giulio Romualdi
......
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.1.2" version = "0.1.3"
# Description # Description
title = "Isaac Lab RL" title = "Isaac Lab RL"
......
Changelog Changelog
--------- ---------
0.1.3 (2025-03-31)
~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed the location of :meth:`isaaclab_rl.rsl_rl.RslRlOnPolicyRunnerCfg._modify_action_space`
to be called only after retrieving the dimensions of the environment, preventing errors
related to accessing uninitialized attributes.
0.1.2 (2025-03-28) 0.1.2 (2025-03-28)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
......
...@@ -58,9 +58,6 @@ class RslRlVecEnvWrapper(VecEnv): ...@@ -58,9 +58,6 @@ class RslRlVecEnvWrapper(VecEnv):
self.device = self.unwrapped.device self.device = self.unwrapped.device
self.max_episode_length = self.unwrapped.max_episode_length self.max_episode_length = self.unwrapped.max_episode_length
# modify the action space to the clip range
self._modify_action_space()
# obtain dimensions of the environment # obtain dimensions of the environment
if hasattr(self.unwrapped, "action_manager"): if hasattr(self.unwrapped, "action_manager"):
self.num_actions = self.unwrapped.action_manager.total_action_dim self.num_actions = self.unwrapped.action_manager.total_action_dim
...@@ -81,6 +78,9 @@ class RslRlVecEnvWrapper(VecEnv): ...@@ -81,6 +78,9 @@ class RslRlVecEnvWrapper(VecEnv):
else: else:
self.num_privileged_obs = 0 self.num_privileged_obs = 0
# modify the action space to the clip range
self._modify_action_space()
# reset at the start since the RSL-RL runner does not call reset # reset at the start since the RSL-RL runner does not call reset
self.env.reset() self.env.reset()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment