Skip to content

Commit 870ce8a

Browse files
committed
fix direct task check
1 parent a120c53 commit 870ce8a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ def __init__(self, cfg: DirectMARLEnvCfg, render_mode: str | None = None, **kwar
114114
print("[INFO]: Scene manager: ", self.scene)
115115

116116
# randomization at scene level
117-
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
118-
self._apply_scene_randomization()
117+
if self.cfg.events:
118+
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
119+
self._apply_scene_randomization()
119120

120121
# set up camera viewport controller
121122
# viewport is not available in other rendering modes so the function will throw a warning
@@ -576,10 +577,6 @@ def _apply_scene_randomization(self):
576577
577578
It must be called only before the simulation/physics is started.
578579
"""
579-
# check if events exist
580-
if not self.cfg.events:
581-
return
582-
583580
# check if scene randomization is enabled
584581
applied_scene_randomization = False
585582
# iterate over all event terms

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ def __init__(self, cfg: DirectRLEnvCfg, render_mode: str | None = None, **kwargs
119119
print("[INFO]: Scene manager: ", self.scene)
120120

121121
# randomization at scene level
122-
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
123-
self._apply_scene_randomization()
122+
if not self.cfg.events:
123+
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
124+
self._apply_scene_randomization()
124125

125126
# set up camera viewport controller
126127
# viewport is not available in other rendering modes so the function will throw a warning
@@ -518,10 +519,6 @@ def _apply_scene_randomization(self):
518519
519520
It must be called only before the simulation/physics is started.
520521
"""
521-
# check if events exist
522-
if not self.cfg.events:
523-
return
524-
525522
# check if scene randomization is enabled
526523
applied_scene_randomization = False
527524
# iterate over all event terms

0 commit comments

Comments
 (0)