Skip to content

Align Arena with Isaac Lab: stop unwrapping env after gym.make()#472

Open
cvolkcvolk wants to merge 2 commits intomainfrom
cvolk/refactor/no-unwrap-arena-env-v2
Open

Align Arena with Isaac Lab: stop unwrapping env after gym.make()#472
cvolkcvolk wants to merge 2 commits intomainfrom
cvolk/refactor/no-unwrap-arena-env-v2

Conversation

@cvolkcvolk
Copy link
Collaborator

@cvolkcvolk cvolkcvolk commented Mar 6, 2026

Summary

  • 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 now 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

Motivation

PR #445 (video recording support) required adding if render_mode is None: env = env.unwrapped to conditionally skip unwrapping — an awkward workaround caused by Arena's convention of always returning the base env. This refactor removes the root cause.

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.
@cvolkcvolk cvolkcvolk force-pushed the cvolk/refactor/no-unwrap-arena-env-v2 branch from f73a8f6 to 2e7623d Compare March 6, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant