mani_skill.utils.registration#

Attributes#

Classes#

EnvSpec

TimeLimitWrapper

like the standard gymnasium timelimit wrapper but fixes truncated variable to be a torch tensor and batched

Functions#

make(env_id, **kwargs)

Instantiate a ManiSkill environment.

make_vec(env_id, **kwargs)

register(name, cls[, max_episode_steps, ...])

Register a ManiSkill environment.

register_env(uid[, max_episode_steps, override, ...])

A decorator to register ManiSkill environments.

Module Contents#

class mani_skill.utils.registration.EnvSpec(uid, cls, max_episode_steps=None, asset_download_ids=[], default_kwargs=None)[source]#
Parameters:
make(**kwargs)[source]#
asset_download_ids = [][source]#
cls[source]#
default_kwargs[source]#
property gym_spec[source]#

Return a gym EnvSpec for this env

max_episode_steps = None[source]#
uid[source]#
class mani_skill.utils.registration.TimeLimitWrapper(env, max_episode_steps)[source]#

Bases: gymnasium.Wrapper

like the standard gymnasium timelimit wrapper but fixes truncated variable to be a torch tensor and batched

Parameters:
step(action)[source]#

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

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

mani_skill.envs.sapien_env.BaseEnv

mani_skill.utils.registration.make(env_id, **kwargs)[source]#

Instantiate a ManiSkill environment.

Parameters:
  • env_id (str) – Environment ID.

  • as_gym (bool, optional) – Add TimeLimit wrapper as gym.

  • **kwargs – Keyword arguments to pass to the environment.

mani_skill.utils.registration.make_vec(env_id, **kwargs)[source]#
mani_skill.utils.registration.register(name, cls, max_episode_steps=None, asset_download_ids=[], default_kwargs=None)[source]#

Register a ManiSkill environment.

Parameters:
mani_skill.utils.registration.register_env(uid, max_episode_steps=None, override=False, asset_download_ids=[], **kwargs)[source]#

A decorator to register ManiSkill environments.

Parameters:
  • uid (str) – unique id of the environment.

  • max_episode_steps (int) – maximum number of steps in an episode.

  • asset_download_ids (list[str]) – asset download ids the environment depends on. When environments are created this list is checked to see if the user has all assets downloaded and if not, prompt the user if they wish to download them.

  • override (bool) – whether to override the environment if it is already registered.

Notes

  • max_episode_steps is processed differently from other keyword arguments in gym. gym.make wraps the env with gym.wrappers.TimeLimit to limit the maximum number of steps.

  • gym.EnvSpec uses kwargs instead of **kwargs!

mani_skill.utils.registration.REGISTERED_ENVS: dict[str, EnvSpec][source]#