Align Arena with Isaac Lab: stop unwrapping env after gym.make()#472
Open
cvolkcvolk wants to merge 2 commits intomainfrom
Open
Align Arena with Isaac Lab: stop unwrapping env after gym.make()#472cvolkcvolk wants to merge 2 commits intomainfrom
cvolkcvolk wants to merge 2 commits intomainfrom
Conversation
Removes .unwrapped from make_registered_and_return_cfg and policy_runner.py so Arena aligns with how Isaac Lab itself handles environments. - make_registered_and_return_cfg returns the wrapped env from gym.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 - Utility functions and tests that need to reach past the gym API boundary to Isaac Lab-specific attributes (.scene, .cfg, .device, .termination_manager) now use env.unwrapped.X explicitly at each access site - Keeping the wrapped env allows gym wrappers (e.g. RecordVideo) to be composed on top cleanly, without special-casing in make_registered_and_return_cfg Signed-off-by: Clemens Volk <cvolk@nvidia.com>
Tests using make_registered() were accessing .device and .scene directly on the gym-wrapped env (OrderEnforcing), which doesn't expose these attributes. Use env.unwrapped.device and env.unwrapped.scene instead.
f73a8f6 to
2e7623d
Compare
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.