Skip to content

Commit b663ad1

Browse files
authored
Initialize extras dict before loading managers (#2178)
# Description Unable to add new entries to self.extras dictionary in ManagerBasedEnv because the dictionary was initialised after loading the managers. Fixes #2177 ## 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` - [x] 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 - [ ] 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
1 parent 3c3103f commit b663ad1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Guidelines for modifications:
6767
* Johnson Sun
6868
* Kaixi Bao
6969
* Kourosh Darvish
70+
* Kousheek Chakraborty
7071
* Lionel Gulich
7172
* Louis Le Lay
7273
* Lorenz Wellhausen

source/isaaclab/isaaclab/envs/manager_based_env.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def __init__(self, cfg: ManagerBasedEnvCfg):
122122
# counter for simulation steps
123123
self._sim_step_counter = 0
124124

125+
# allocate dictionary to store metrics
126+
self.extras = {}
127+
125128
# generate scene
126129
with Timer("[INFO]: Time taken for scene creation", "scene_creation"):
127130
self.scene = InteractiveScene(self.cfg.scene)
@@ -170,9 +173,6 @@ def __init__(self, cfg: ManagerBasedEnvCfg):
170173
# if no window, then we don't need to store the window
171174
self._window = None
172175

173-
# allocate dictionary to store metrics
174-
self.extras = {}
175-
176176
# initialize observation buffers
177177
self.obs_buf = {}
178178

0 commit comments

Comments
 (0)