Align Arena with Isaac Lab: stop unwrapping env after gym.make()#455
Closed
cvolkcvolk wants to merge 5 commits intomainfrom
Closed
Align Arena with Isaac Lab: stop unwrapping env after gym.make()#455cvolkcvolk wants to merge 5 commits intomainfrom
cvolkcvolk wants to merge 5 commits intomainfrom
Conversation
Isaac Lab keeps the wrapped gym env and uses env.unwrapped only as an explicit accessor for Isaac Lab-specific attributes. Arena was always calling .unwrapped at construction time, which conflicted with composing gym wrappers (e.g. RecordVideo) on top. gymnasium's Wrapper.__getattr__ forwards attribute access to the base env, so callers are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Clemens Volk <cvolk@nvidia.com>
- Use env.unwrapped.cfg explicitly to access Isaac Lab-specific attributes, since gymnasium's OrderEnforcing wrapper does not forward all attributes - Fix pbar UnboundLocalError when exception occurs before progress bar init - Use env.unwrapped.seed() in set_seed for the same reason Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Clemens Volk <cvolk@nvidia.com>
990d35f to
17624b0
Compare
After the previous commit stopped unwrapping the env in make_registered(), utility functions and tests that access IsaacLab-specific attributes (scene, cfg, device, termination_manager) now need env.unwrapped to reach past the gymnasium OrderEnforcing wrapper, which has no __getattr__ forwarding in gymnasium 1.2.1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cate_asset, test_events Four tests were still accessing IsaacLab-specific attributes (env.scene, env.device) directly on the wrapped env returned by make_registered(). Add .unwrapped to each access site. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.unwrappedfrommake_registered_and_return_cfgandpolicy_runner.pyso Arena aligns with how Isaac Lab itself handles environmentsmake_registered_and_return_cfgnow returns the wrapped env fromgym.make()directly, consistent with Isaac Lab's RL scripts (train.py,play.py) which keep the wrapped env and pass it to the RL runner.scene,.cfg,.device,.termination_manager) now useenv.unwrapped.Xexplicitly at each access siteRecordVideo) to be composed on top cleanly, without special-casing inmake_registered_and_return_cfgMotivation
PR #445 (video recording support) required adding
if render_mode is None: env = env.unwrappedto conditionally skip unwrapping — an awkward workaround caused by Arena's convention of always returning the base env. This refactor removes the root cause.