mani_skill.utils.wrappers.gymnasium#

Classes#

CPUGymWrapper

This wrapper wraps any maniskill env created via gym.make to ensure the outputs of

Module Contents#

class mani_skill.utils.wrappers.gymnasium.CPUGymWrapper(env, ignore_terminations=False, record_metrics=False)[source]#

Bases: gymnasium.Wrapper

This wrapper wraps any maniskill env created via gym.make to ensure the outputs of env.render, env.reset, env.step are all numpy arrays and are not batched. Essentially ensuring the environment conforms entirely to the standard gymnasium API https://gymnasium.farama.org/api/env/. The wrapper also optionally records standardized evaluation metrics like return and success.

This wrapper should generally be applied after all other wrappers as most wrappers for ManiSkill assume data returned is a batched torch tensor

Parameters:
  • env (gym.Env) – The environment to wrap.

  • ignore_terminations (bool) – If True, the environment will ignore termination signals and continue running until truncation. Default is False.

  • record_metrics (bool) – If True, the returned info objects will contain the metrics: return, length, success_once, success_at_end, fail_once, fail_at_end. success/fail metrics are recorded only when the environment has success/fail criteria. success/fail_at_end are recorded only when ignore_terminations is True.

render()[source]#

Uses the render() of the env that can be overwritten to change the returned data.

reset(*, seed=None, options=None)[source]#

Uses the reset() of the env that can be overwritten to change the returned data.

step(action)[source]#

Uses the step() of the env that can be overwritten to change the returned data.

action_space[source]#

Return the Env action_space unless overwritten then the wrapper action_space is used.

property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
Return type:

mani_skill.envs.sapien_env.BaseEnv

ignore_terminations = False[source]#
observation_space[source]#

Return the Env observation_space unless overwritten then the wrapper observation_space is used.

record_metrics = False[source]#