Skip to content

Commit 64cb3ac

Browse files
authored
Adds event manager call to simple manage-based env (isaac-sim#666)
# Description Earlier, the "startup" events were only triggered when used inside an RL environment. This MR makes sure they are also called inside the simple environment version as well. Fixes isaac-sim#664 ## 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
1 parent b92f199 commit 64cb3ac

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed

source/extensions/omni.isaac.lab/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.19.3"
4+
version = "0.19.4"
55

66
# Description
77
title = "Isaac Lab framework for Robot Learning"

source/extensions/omni.isaac.lab/docs/CHANGELOG.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
---------
33

4+
0.19.4 (2024-07-13)
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Fixed
8+
^^^^^
9+
10+
* Added the call to "startup" events when using the :class:`~omni.isaac.lab.envs.ManagerBasedEnv` class.
11+
Earlier, the "startup" events were not being called when the environment was initialized. This issue
12+
did not occur when using the :class:`~omni.isaac.lab.envs.ManagerBasedRLEnv` class since the "startup"
13+
events were called in the constructor.
14+
15+
416
0.19.3 (2024-07-13)
517
~~~~~~~~~~~~~~~~~~~
618

source/extensions/omni.isaac.lab/omni/isaac/lab/envs/manager_based_env.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ def load_managers(self):
223223
self.event_manager = EventManager(self.cfg.events, self)
224224
print("[INFO] Event Manager: ", self.event_manager)
225225

226+
# perform events at the start of the simulation
227+
# in-case a child implementation creates other managers, the randomization should happen
228+
# when all the other managers are created
229+
if self.__class__ == ManagerBasedEnv and "startup" in self.event_manager.available_modes:
230+
self.event_manager.apply(mode="startup")
231+
226232
"""
227233
Operations - MDP.
228234
"""

source/extensions/omni.isaac.lab/omni/isaac/lab/envs/manager_based_rl_env.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ def load_managers(self):
107107
# -- command manager
108108
self.command_manager: CommandManager = CommandManager(self.cfg.commands, self)
109109
print("[INFO] Command Manager: ", self.command_manager)
110+
110111
# call the parent class to load the managers for observations and actions.
111112
super().load_managers()
113+
112114
# prepare the managers
113115
# -- termination manager
114116
self.termination_manager = TerminationManager(self.cfg.terminations, self)
@@ -119,8 +121,10 @@ def load_managers(self):
119121
# -- curriculum manager
120122
self.curriculum_manager = CurriculumManager(self.cfg.curriculum, self)
121123
print("[INFO] Curriculum Manager: ", self.curriculum_manager)
124+
122125
# setup the action and observation spaces for Gym
123126
self._configure_gym_env_spaces()
127+
124128
# perform events at the start of the simulation
125129
if "startup" in self.event_manager.available_modes:
126130
self.event_manager.apply(mode="startup")

source/extensions/omni.isaac.lab/omni/isaac/lab/managers/event_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .manager_term_cfg import EventTermCfg
2020

2121
if TYPE_CHECKING:
22-
from omni.isaac.lab.envs import ManagerBasedRLEnv
22+
from omni.isaac.lab.envs import ManagerBasedEnv
2323

2424

2525
class EventManager(ManagerBase):
@@ -53,10 +53,10 @@ class EventManager(ManagerBase):
5353
5454
"""
5555

56-
_env: ManagerBasedRLEnv
56+
_env: ManagerBasedEnv
5757
"""The environment instance."""
5858

59-
def __init__(self, cfg: object, env: ManagerBasedRLEnv):
59+
def __init__(self, cfg: object, env: ManagerBasedEnv):
6060
"""Initialize the event manager.
6161
6262
Args:
@@ -295,7 +295,7 @@ class RandomizationManager(EventManager):
295295
renamed to EventManager as it is more general purpose. The RandomizationManager will be removed in v0.4.0.
296296
"""
297297

298-
def __init__(self, cfg: object, env: ManagerBasedRLEnv):
298+
def __init__(self, cfg: object, env: ManagerBasedEnv):
299299
"""Initialize the randomization manager.
300300
301301
Args:

tools/per_test_timeouts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@
99
"""
1010
PER_TEST_TIMEOUTS = {
1111
"test_environments.py": 1200, # This test runs through all the environments for 100 steps each
12+
"test_env_rendering_logic.py": 200,
13+
"test_rsl_rl_wrapper.py": 200,
14+
"test_sb3_wrapper.py": 200,
15+
"test_skrl_wrapper.py": 200,
1216
}

0 commit comments

Comments
 (0)