-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add parameter to specify number of rerenders after environment reset #3818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
0cf11d6
ae0b64a
0b09800
5228332
90f521e
1a0e725
4de3256
e865f81
fe5d986
d29049b
cb80cc1
01506bc
bce53d5
7a683af
21683e2
1cc1e9f
e91a66c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| import builtins | ||||||||||||||||||||||||||||||||||||
| import torch | ||||||||||||||||||||||||||||||||||||
| import warnings | ||||||||||||||||||||||||||||||||||||
| from collections.abc import Sequence | ||||||||||||||||||||||||||||||||||||
| from typing import Any | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
|
|
@@ -190,6 +191,16 @@ def __init__(self, cfg: ManagerBasedEnvCfg): | |||||||||||||||||||||||||||||||||||
| if self.cfg.export_io_descriptors: | ||||||||||||||||||||||||||||||||||||
| self.export_IO_descriptors() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # show deprecation message for rerender_on_reset | ||||||||||||||||||||||||||||||||||||
| if self.cfg.rerender_on_reset: | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can throw the warning and then internally set the variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the recommendation. Setting the variable |
||||||||||||||||||||||||||||||||||||
| warnings.warn( | ||||||||||||||||||||||||||||||||||||
| "\033[93m\033[1m[DEPRECATION WARNING] ManagerBasedEnvCfg.rerender_on_reset is deprecated. Use" | ||||||||||||||||||||||||||||||||||||
| " ManagerBasedEnvCfg.num_rerenders_on_reset instead.\033[0m", | ||||||||||||||||||||||||||||||||||||
| FutureWarning, | ||||||||||||||||||||||||||||||||||||
| stacklevel=2, | ||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||
| self.cfg.num_rerenders_on_reset = 1 | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+195
to
+202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: if a user sets both
Suggested change
|
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| def __del__(self): | ||||||||||||||||||||||||||||||||||||
| """Cleanup for the environment.""" | ||||||||||||||||||||||||||||||||||||
| self.close() | ||||||||||||||||||||||||||||||||||||
|
|
@@ -353,8 +364,9 @@ def reset( | |||||||||||||||||||||||||||||||||||
| self.scene.write_data_to_sim() | ||||||||||||||||||||||||||||||||||||
| self.sim.forward() | ||||||||||||||||||||||||||||||||||||
| # if sensors are added to the scene, make sure we render to reflect changes in reset | ||||||||||||||||||||||||||||||||||||
| if self.sim.has_rtx_sensors() and self.cfg.rerender_on_reset: | ||||||||||||||||||||||||||||||||||||
| self.sim.render() | ||||||||||||||||||||||||||||||||||||
| if self.sim.has_rtx_sensors() and self.cfg.num_rerenders_on_reset > 0: | ||||||||||||||||||||||||||||||||||||
| for _ in range(self.cfg.num_rerenders_on_reset): | ||||||||||||||||||||||||||||||||||||
| self.sim.render() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # trigger recorder terms for post-reset calls | ||||||||||||||||||||||||||||||||||||
| self.recorder_manager.record_post_reset(env_ids) | ||||||||||||||||||||||||||||||||||||
|
|
@@ -413,8 +425,9 @@ def reset_to( | |||||||||||||||||||||||||||||||||||
| self.sim.forward() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # if sensors are added to the scene, make sure we render to reflect changes in reset | ||||||||||||||||||||||||||||||||||||
| if self.sim.has_rtx_sensors() and self.cfg.rerender_on_reset: | ||||||||||||||||||||||||||||||||||||
| self.sim.render() | ||||||||||||||||||||||||||||||||||||
| if self.sim.has_rtx_sensors() and self.cfg.num_rerenders_on_reset > 0: | ||||||||||||||||||||||||||||||||||||
| for _ in range(self.cfg.num_rerenders_on_reset): | ||||||||||||||||||||||||||||||||||||
| self.sim.render() | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # trigger recorder terms for post-reset calls | ||||||||||||||||||||||||||||||||||||
| self.recorder_manager.record_post_reset(env_ids) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,15 @@ | ||
| Changelog | ||
| --------- | ||
|
|
||
| 0.11.2 (2025-10-23) | ||
|
||
| ~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * Changed to use of ``num_rerenders_on_reset`` and ``DLAA`` in visuomotor imitation learning environments. | ||
|
|
||
|
|
||
| 0.11.1 (2025-09-24) | ||
| ~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: date format is MM-DD instead of YYYY-MM-DD - should be 2025-01-23 not 2025-10-23 based on the pattern in the file (version 0.47.1 is dated 2025-10-17, and versions progress chronologically)