Skip to content

Commit

Permalink
fix direct task check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayankm96 committed Oct 7, 2024
1 parent a120c53 commit 870ce8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def __init__(self, cfg: DirectMARLEnvCfg, render_mode: str | None = None, **kwar
print("[INFO]: Scene manager: ", self.scene)

# randomization at scene level
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
self._apply_scene_randomization()
if self.cfg.events:
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
self._apply_scene_randomization()

# set up camera viewport controller
# viewport is not available in other rendering modes so the function will throw a warning
Expand Down Expand Up @@ -576,10 +577,6 @@ def _apply_scene_randomization(self):
It must be called only before the simulation/physics is started.
"""
# check if events exist
if not self.cfg.events:
return

# check if scene randomization is enabled
applied_scene_randomization = False
# iterate over all event terms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def __init__(self, cfg: DirectRLEnvCfg, render_mode: str | None = None, **kwargs
print("[INFO]: Scene manager: ", self.scene)

# randomization at scene level
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
self._apply_scene_randomization()
if not self.cfg.events:
with Timer("[INFO]: Time taken for scene randomization", "scene_randomization"):
self._apply_scene_randomization()

# set up camera viewport controller
# viewport is not available in other rendering modes so the function will throw a warning
Expand Down Expand Up @@ -518,10 +519,6 @@ def _apply_scene_randomization(self):
It must be called only before the simulation/physics is started.
"""
# check if events exist
if not self.cfg.events:
return

# check if scene randomization is enabled
applied_scene_randomization = False
# iterate over all event terms
Expand Down

0 comments on commit 870ce8a

Please sign in to comment.