Skip to content
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

[Feature] Support wrapping IsaacLab environments with GymEnv #2380

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
move kwarg pop to env base
  • Loading branch information
yu-fz committed Aug 8, 2024
commit 73596a8d43204b1f0a9ac00e73f4038bce9b229d
1 change: 1 addition & 0 deletions torchrl/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3039,6 +3039,7 @@ def __init__(

self._constructor_kwargs = kwargs
self._check_kwargs(kwargs)
self._convert_actions_to_numpy = kwargs.pop("convert_actions_to_numpy", True)
self._env = self._build_env(**kwargs) # writes the self._env attribute
self._make_specs(self._env) # writes the self._env attribute
self.is_closed = False
Expand Down
1 change: 0 additions & 1 deletion torchrl/envs/gym_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ class GymLikeEnv(_EnvWrapper):
def __new__(cls, *args, **kwargs):
self = super().__new__(cls, *args, _batch_locked=True, **kwargs)
self._info_dict_reader = []
self._convert_actions_to_numpy = kwargs.pop("convert_actions_to_numpy", True)

return self

Expand Down
1 change: 0 additions & 1 deletion torchrl/envs/libs/gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ def _build_env(
env,
from_pixels: bool = False,
pixels_only: bool = False,
convert_actions_to_numpy: bool = True,
) -> "gym.core.Env": # noqa: F821
self.batch_size = self._get_batch_size(env)

Expand Down
Loading