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 Request] Make GymLikeEnv compatible with IsaacLab Envs #2369

Closed
1 task done
yu-fz opened this issue Aug 6, 2024 · 1 comment · Fixed by #2380
Closed
1 task done

[Feature Request] Make GymLikeEnv compatible with IsaacLab Envs #2369

yu-fz opened this issue Aug 6, 2024 · 1 comment · Fixed by #2380
Assignees
Labels
enhancement New feature or request

Comments

@yu-fz
Copy link
Contributor

yu-fz commented Aug 6, 2024

Motivation

The current implementation of GymLikeEnv._step(...) is incompatible with IsaacLab environments due to the conversion to numpy when IsaacLab expects a torch tensor:

    def _step(self, tensordict: TensorDictBase) -> TensorDictBase:
        action = tensordict.get(self.action_key)
        action_np = self.read_action(action)
        reward = 0
        for _ in range(self.wrapper_frame_skip):
            (
                obs,
                _reward,
                terminated,
                truncated,
                done,
                info_dict,
            ) = self._output_transform(self._env.step(action_np))

Solution

Perhaps we can add a config parameter to GymLikeEnv to specify if the underlying environment uses either np.ndarray or torch.tensor types.

Checklist

  • I have checked that there is no similar issue in the repo (required)
@yu-fz yu-fz added the enhancement New feature or request label Aug 6, 2024
@yu-fz yu-fz changed the title [Feature Request] Make GymLikeEnv compatible with IsaacLab [Feature Request] Make GymLikeEnv compatible with IsaacLab Envs Aug 6, 2024
@vmoens
Copy link
Contributor

vmoens commented Aug 6, 2024

Sure I'll work on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants