mani_skill.utils.wrappers.gymnasium#
Classes#
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.WrapperThis 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.
- reset(*, seed=None, options=None)[source]#
Uses the
reset()of theenvthat can be overwritten to change the returned data.
- step(action)[source]#
Uses the
step()of theenvthat can be overwritten to change the returned data.
- action_space[source]#
Return the
Envaction_spaceunless overwritten then the wrapperaction_spaceis used.
- property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
- Return type:
- observation_space[source]#
Return the
Envobservation_spaceunless overwritten then the wrapperobservation_spaceis used.