mani_skill.utils.registration#
Attributes#
Classes#
like the standard gymnasium timelimit wrapper but fixes truncated variable to be a torch tensor and batched |
Functions#
|
Instantiate a ManiSkill environment. |
|
|
|
Register a ManiSkill environment. |
|
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:
uid (str) –
cls (Type[mani_skill.envs.sapien_env.BaseEnv]) –
asset_download_ids (Optional[list[str]]) –
default_kwargs (dict) –
- class mani_skill.utils.registration.TimeLimitWrapper(env, max_episode_steps)[source]#
Bases:
gymnasium.Wrapperlike the standard gymnasium timelimit wrapper but fixes truncated variable to be a torch tensor and batched
- Parameters:
env (gymnasium.Env) –
max_episode_steps (int) –
- step(action)[source]#
Uses the
step()of theenvthat can be overwritten to change the returned data.
- property base_env: mani_skill.envs.sapien_env.BaseEnv[source]#
- Return type:
- 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.register(name, cls, max_episode_steps=None, asset_download_ids=[], default_kwargs=None)[source]#
Register a ManiSkill environment.
- Parameters:
name (str) –
cls (Type[mani_skill.envs.sapien_env.BaseEnv]) –
asset_download_ids (list[str]) –
default_kwargs (dict) –
- 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!